Thursday, 6 September 2012

IR amplifier for Scalextric Raspberry Pi interface



Circuit diagram for the IR track mounted sensor. Using a BC549B (pretty generic NPN silicon) transistor to square up the blip received on the infrared sensor I get a really clear 2ms wide pulse from supply to 0.7v . I have tried a sensor chip and a even single IR diode sensor with similar results, both generated about 400mV swing on 5V rails (I reduced this later on to a 3.3v supply, so I should still get about 200mV pulse.) DC blocking capacitor C1 (electolytic with negative terminal facing the transistor) means this pulse sits around the on/off point for the transistor, if trimming R3 till the transistor just turns off. T1 is in current amplification mode, so a small bias signal via C1 causes the full supply to appear across R4.
Load for T1 is 10K Ohm, plenty to drive a CMOS chip with.
R1=470 Ohm (IR transmitter drive)
R2=100KOhm (IR Reciever source)
R3=500K trimmer (bias)
R4=10KOhm (load)
T1=BC549B
C1=1uF electrolytic
D1&D2 are matched frequency range IR in an 3mm LED package. All resistors 1/4 watt 5%.
The IR diodes were easy to mount in hot-melt, but you can also use epoxy once you have tested them. I build everything on veroboard.

I changed the component values here later, but this bit creates a delayed 25ms Pulse, slow enough for the computer to register. To get it widened to ~25ms I used the rough formula T=0.69 RC. With 1uF and 47000 ohms that's 0.69*0.000001*47000 = 32ms.
My actual values due to the cap chosen came out a bit shy of 30ms, electrolytics are temperature sensitive, and at low charging voltages, caps will give varying results. But my target was >25ms so it all worked out.
Approximate parts list for 2 channels


1x 4011 CMOS quad NAND (need not be a shottky chip)
2x IR transmitters : https://www.rapidonline.com/Electronic-Components/Kingbright-L-34F3C-3mm-Infrared-Emitting-Diode-58-0100
2x IR receivers : https://www.rapidonline.com/Electronic-Components/Kingbright-L-3DP3C-3mm-Infrared-Sensor-58-0105
Replaced the 100K trimmers for the timer circuit with 47K Ohm.

No comments:

Post a Comment