Input/Output: Remote Control
Zip File ©Christopher Leigh
Infra-red Input
You can use a Temic 1836 device to receive signals from an ordinary remote control which can then be processed by a Picaxe chip. As long as it uses the standard RC5 coding system then the Picaxe can understand it using Infrain and Infra commands. This program turns LEDs on and off depending on which keys on the remote are pressed. The pcb looks more complicated than it is really because it passes through 4 of the inputs.loop: infrain 'must uses pin 0
if infra = 1 then swon1
if infra = 2 then swon2
if infra = 3 then swon3
if infra = 4 then swoff1
if infra = 5 then swoff2
if infra = 6 then swoff3
goto loop
swon1: high 1
goto loop
swon2: high 2
goto loop
swon3: high 3
goto loop
swoff1: low 1
goto loop
swoff2: low 2
goto loop
swoff3: low 3
goto loop
|
|
36kHz Infra Red Modulator
|
You can build your own remote transmitter using a Picaxe chip to gate a simple 555 astable or a Nand gate oscillator using a 4093. Use the Picaxe to generate standard serial output, and then make that output turn the 36kHz oscillator on and off. The signal can then be picked up by the Temic 1836 block shown above and fed to another Picaxe. This microcontroller receives the serial data stream and turns it back into the original bytes.
The first program shown takes data from a 4-key pad (see Picaxe Inputs) and translates it into a serial byte which controls the Infra Red transmitter shown below. The second program receives input from the Temic 1836 as a serial byte and turns four LEDs on and off appropriately. To make the system more robust you could add a check digit and if you want several receivers you could add an addressing byte. |

|
main: let b0=pins 'get inputs
b1=b0&%11000011 'mask unwanted bits
serout 4,N2400,(b1) 'takes roughly 3mS
pause 100 'governs speed of response
goto main
main: serin 0,T2400,b0 'wait for input then read input 1
b1=b0&%11000011 'mask unwanted bits
b2=b1^%11000011 'XOR so Leds on for key press
let pins=b2 'show output
goto main
|
Infra Red Transmitter
|
This block modulates the output of two infra red LEDs, along with a visible LED just to show you that it is working. It is designed as part of the infra red transmitter described above but could be used in any infra red system - perhaps a beam-break security device. You will get the best current through the LEDs by using a Field Effect Transistor with a low on resistance. Infra red LEDs can usually take a lot of current and in any case they are being pulsed so the 27R resistor is quite reasonable (85mA in my version).
|
|
Radio Transmitter
Radio Receiver