IR Encoder/Decoder with PIC12C508


Posted on Aug 19, 2012

The receiver chip uses a Panasonic 4602 38KHz receiver and that's it for external components. It has the serial input (GP3) , two RC hobby servo outputs (GP0/GP1) and three digital outputs (GP2,4,5). Here is the code for the receiver chip. It is a bit of a specialty in that the digital outputs are actually `momentary contact` type outputs because I only needed a pulse to go out to trigger a cheap sound board I got from a $6 toy! I don't even use the GP2 output in this design. The receiver uses 4 NiCd 115MAH cells, the largest set I could fit into the Rhino! The transmitter chip uses 5 pullup resistors and an IR LED powered through a 330 resistor - quite a bit of power I think. To keep things simple, I used a 78L05 to power the PIC so I could use a 9V battery and keep the whole project box size small. It will run fine on 3 alkaline cells, or, from 4.5 to 5.5V.


IR Encoder/Decoder with PIC12C508
Click here to download the full size of the above Circuit.
IR Encoder/Decoder with PIC12C508 - image 1
Click here to download the full size of the above Image.

The transmitter reads the status of the 5 momentary contact buttons and decides what messages to send to the receiver. Here, I give priority by bit value, just so there needs to be no encoding and it keeps the code simple. Also, when a direction command is given (forward, reverse, left, right) I also give the 'go' command and the 'motor noise' commands. If a button is pressed and immediately released, the transmitter waits a couple seconds and sends the 'stop' command. This allows you to hold a button down, issue a series of commands continuously but still stop nicely. The transmitter issues a constant stream of 'stop' commands when no button is pressed. This is a nice troubleshooting method as well as insuring that the unit doesn't just take off! Here is the code for the IR transmitter. Building the Rhino was a challenge. It is about 5 inches long and about 3.5 inches wide and about 2 inches tall. Into that I needed to put a battery pack, two motors, two motor drivers, the IR receiver board and actual drive wheels and wiring with a sound board and speaker. Wow. I used two LEGO micro motors for the drive motors, they were connected to two LEGO medium pulleys via rubber bands and held in place using two-stud LEGO axels through a two stud Technic rail - If you know LEGO, you know what I mean by that. I drove the motors by connecting them to the "guts" of two old hobby servos. This gave me two small bi-directional motor...




Leave Comment

characters left:

New Circuits

.

 


Popular Circuits

Two 8-bit dacs make a 12-bit dac
Squib-firing circuit
Dc-motor-drive-with-fixed-speed-control
Data Acquisition System I
LWDAQ Driver (A2037) Manual
DIY Infrared Sensor Module using Arduino
easy and cheap cdv 700 tube adapter
555 Timer astable oscillator circuit



Top