Low-Tech IR Remote
erco
Posts: 20,257
I had to make my own IR remote for faster recognition than the venerable and well-documented Sony protocol. Specifically, I needed my BS2 to complete the whole read routine in 10 milliseconds, between sending servo pulses and reading sensors each 20 ms on my balancing robot. The Sony codes take ~8-15 ms each and repeat after a 20-30 ms pause, so those wouldn't work in my application. I just needed 4 commands for driving: forward, reverse, left & right.
As usual, I sought a quick & dirty but effective analog method. I modified my favorite LM556-based IR homing beacon circuit to send out 4 different user-selected frequencies on a 38 kHz carrier. The Stamp COUNTs the pulses in a 10 ms period. The numbers fluctuate a count every so often, so I spaced the frequencies apart enough to avoid any possible overlap.
Schematic & photo attached. Hope it may help someone somewhere somehow someday. BTW, you could also use these as beacons for robot navigation that your bot could tell one from the other.
Sample code:
' {$STAMP BS2}
' {$PBASIC 2.5}
'homemade IR for balance bot
'IR input on PIN 14
a:COUNT 14,10,B0
IF B0>=18 THEN DEBUG "reverse",CR:GOTO a
IF B0>=15 THEN DEBUG "left",CR:GOTO a
IF B0>=13 THEN DEBUG "forward",CR:GOTO a
IF B0>=10 THEN DEBUG "right",CR:GOTO a
IF B0=0 THEN DEBUG "stop",CR
GOTO a
As usual, I sought a quick & dirty but effective analog method. I modified my favorite LM556-based IR homing beacon circuit to send out 4 different user-selected frequencies on a 38 kHz carrier. The Stamp COUNTs the pulses in a 10 ms period. The numbers fluctuate a count every so often, so I spaced the frequencies apart enough to avoid any possible overlap.
Schematic & photo attached. Hope it may help someone somewhere somehow someday. BTW, you could also use these as beacons for robot navigation that your bot could tell one from the other.
Sample code:
' {$STAMP BS2}
' {$PBASIC 2.5}
'homemade IR for balance bot
'IR input on PIN 14
a:COUNT 14,10,B0
IF B0>=18 THEN DEBUG "reverse",CR:GOTO a
IF B0>=15 THEN DEBUG "left",CR:GOTO a
IF B0>=13 THEN DEBUG "forward",CR:GOTO a
IF B0>=10 THEN DEBUG "right",CR:GOTO a
IF B0=0 THEN DEBUG "stop",CR
GOTO a
Comments
-Phil
(I jest.)
@PJ: A match? Right now I'm only working on IR signals, but I suppose I'll get around to smoke signals eventually, thanks...
I'm at the high end of the modulation frequency with that 556. Much higher and the IR modules stop detecting the 556's signal. I think it's the duty cycle causing the problem. It won't work at all without that 1N914 diode, which drops the duty cycle below 50% per http://electronicsclub.info/555timer.htm .
@PJ: Nice codin', ToughGuy!