Brat,

Hi

I am really new in this area and my academic knowledge is up to physics A-level.

I would like to build my own IR sensors and implement them on Brat with Bot Board 2. The receiver will be on Brad and the transmitter on another robot, for communicating purposes. I don’t have any problem with the hardware part since my circuit is simple with just resistors. But I am struggling with the software.

The pulses I should be sending must be at frequency 38kHz because of the filter band pass of my receiver, how do i generate these? Is it possible with just using the code (high p0 pause smth low p0 pause smth) if that is feasible how do i estimate it to be at 38 kHz? Can I use the other function frequout p0, 38000??

Second question is about my receiver, for example I have it connected at p1, how do I let the chip now about its current state (what kind of code do i use to get the 1 or 0 into the program)? As soon as it detects a positive signal for example I want it to do a specific task as well.

Thank you so much

First of all, what microcontroller are you using?

Why not use the available 38 KHz IR control hardware?

You might possibly set up a baud rate and toggle a bit with that clock chain, or an interrupt.

What processor? What Language??

Alan KM6VV

Or just use one of these…

lynxmotion.com/p-260-sharp-g … ensor.aspx

I am using the BAP 28 microcontroller and the language is the one that the website has examples on…
I would rather not to use the sharp sensor, but to do my own circuit so as to learn both, hardware and software aspects.

So I would like to have an example of a code that my Brat could send pulses to the transmitter but also to detect a high or low states of the receiver, in order to do a specific walk when the state of the receiver is high for example.

Thank you in advance

That helps a lot.

I get it that you want to roll your own IR sensors.

Here is the information on the IRPD we used to make. The magic is the IR receiver. The oscillator can be made, or you can just use freqout and hang the led on an IO pin. Using the oscillator is easier. The IR receiver has filtering to eliminate unmodulated background IR.

lynxmotion.com/images/data/irpd.pdf