555 Timer and BS2 Infrared Detector
luminastrum
Posts: 4
Gentlemen,
Need help with the BS2 and infrared detector.
I have wired a standalone infrared modulator using an IR LED, a CMOS 555 timer and it's own 5V regulated power supply. The circuit is configured to output a 38.5Hz signal with a 50% duty cycle. I used my multi-meter to adjust and confirm the frequency.
Here's the problem... I have a working BS2 stamp with an infrared detector that I've used for "object avoidance" projects. The problem is that the BS2 detects my infrared modulator, but only for a split second. If I block the detector with my hand and remove my hand quickly and repeatedly, the BS2 stamp detects but stops detecting at about the same frequency as my hand.
Shutting OFF & ON the infrared modulator has the same effect. Anyone know what's going on? Thank you.
D.O.
Need help with the BS2 and infrared detector.
I have wired a standalone infrared modulator using an IR LED, a CMOS 555 timer and it's own 5V regulated power supply. The circuit is configured to output a 38.5Hz signal with a 50% duty cycle. I used my multi-meter to adjust and confirm the frequency.
Here's the problem... I have a working BS2 stamp with an infrared detector that I've used for "object avoidance" projects. The problem is that the BS2 detects my infrared modulator, but only for a split second. If I block the detector with my hand and remove my hand quickly and repeatedly, the BS2 stamp detects but stops detecting at about the same frequency as my hand.
Shutting OFF & ON the infrared modulator has the same effect. Anyone know what's going on? Thank you.
D.O.
Comments
D.O.
The 40 kHz detectors are designed to pick up signal modulated at that frequency and decode the output. Typically there is a signal encoded onto the 40 kHz carrier wave. It may be modulated in many ways including PWM, but it usually has to be there to do anything useful with the signal. Just sending a 40 kHz square wave isn’t likely to do anything. The output is likely going to be HIGH when idle and briefly go LOW upon detection, but if you’re not modulating the signal, nothing interesting is going to happen. Forrest M. Mims III wrote some interesting articles about communication using a 555 Timer IC. Typically the output is modulated by pulsing the trigger pin on the 555. I would do some research into this. I just did a search on Google and found hundreds of websites explaining the theory of how these systems work, including example circuits. There was even a BASIC Stamp 1 AppNote some years ago that demonstrated serial transmission of data over such a link. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thanks very much for your tip. I added a second 555 timer to modulate my 38kHz carrier signal. I set the modulator frequency at 1kHz (50% duty cycle) and verified it with my multi-meter. This circuit has its own separate power and is independent from the BS2 module. So then I powered the BS2 module with the off-the-shelf infrared detector and no luck, the BS2 detected for a split second only. Cycling the 555 circuit switch helped, but the BS2 detection was intermittent at best.
I did some more research and found that the infrared detector offered by Parallax (and others) stops detecting if it encounters a clean and CONTINUOUS 38kHz signal. This feature is built-in to avoid detecting noise, which can be continuous. Although I modulated the 38khz carrier with a 1kHz signal, it's still considered noise apparently. So then I tried something different on the BS2 module. Instead of connecting the infrared detector's input power pin to +Vdd, I connected it to a BS2 output pin. With basic stamp code shown below, I modulated the power feeding the infrared detector, and partial success (the 1 milli-second PAUSE is crucial). The detection occurred but pulsed. Then I increased the 555 modulator frequency beyond 1kHz and the detection pulse increased. At 4kHz, great success! No more pulsing, just solid detection!
I think the BS2 off-the-shelf "crash avoidance" projects avert the un-modulated 38kHz problem with the 1 milli-second pulse of power to the infrared LED. This is equivalent to cycling the power to my 555 timer circuit.
I can use some help as to why the 38Khz on 4khz is still considered noise. I prefer to power the infrared detector with +Vdd instead of a BS2 output pin. I hope these findings help someone else.
FOR ii=1 TO 2000
HIGH 10
PAUSE 1
detect_left = IN11
LOW 10
DEBUG CRSRXY, 1, 1, "left =", DEC5 detect_left
NEXT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support