The author gave his partner a radio-controlled (RC) model car as a gift. She found it a lot of fun but thought that adding realistic lights would be a definite improvement. So the author went back to his shed, plugged in his soldering iron, and set to work equipping the car with realistic indicators, headlights, tail lights and brake lights.
The basic idea was to tap into the signal from the radio control receiver and, with a bit of help from a microcontroller, simulate indicators using flashing yellow LEDs and brake lights using red LEDs. Further red LEDs are used for the tail lights, and white LEDs for the headlights. Connectors JP4 and JP5 (channel 0) are wired in parallel, as are JP6 and JP7 (channel 1), allowing the circuit to be inserted into the servo control cables for the steering and drive motor respectively. The ATtiny45 microcontroller takes power from the radio receiver via diode D1. T1 and T2 buffer the servo signals to protect IC1’s inputs from damage.
IC1 analyzes the PWM servo signals and generates suitable outputs to switch the LEDs via the driver transistors. T3 drives the two left indicators (yellow), T4 the two right indicators, and T5 the brake LEDs (red). The red tail lights (JP2-8 and JP2-8) and the white headlights (JP2-9 and JP2-10) are lit continuously. The brake lights are driven with a full 20 mA, so that they are noticeably brighter than the tail lights, which only receive 5 mA. If you wish to combine the functions of tail light and brake light, saving two red LEDs, simply connect pin 10 of JP2 to pin 14 and pin 12 to pin 16. Then connect the two combined brake/tail LEDs either at JP2-5 and JP2-6 or at JP2-7 and JP2-8.
JP3 is provided to allow the use of a separate lighting supply. This can either be connected to an additional four-cell battery pack or to the main supply for the drive motor. The values given for resistors R8 to R17 are suitable for use with a 4.8 V supply. JP2 can take the form of a 2×10 header.
As usual the software is available as a free download from the Elektor web pages accompanying this article , and ready-programmed microcontrollers are also available. The microcontroller must be taught what servo signals correspond to left and right turns, and to full throttle and full braking. First connect the finished circuit to the radio control electronics in the car, making sure everything is switched off. Fit jumper JP1 to enable configuration mode, switch on the radio control transmitter, set all proportional controls to their centre positions, and then switch on the receiver. The indicator LEDs should first flash on both sides. Then the car will indicate left for 3 s: during this time quickly turn the steering on the radio control transmitter fully to the left and the throttle to full reverse (maximum braking).
Hold the controls in this position until the car starts to indicate right. Then set the controls to their opposite extremes and hold them there until both sides flash again. Now, if the car has an internal combustion engine (and so cannot go in reverse), keep the throttle control on full; if the car has an electric motor, set the throttle to full reverse. Hold this position while both sides are flashing. Configuration is now complete and JP1 can be removed. If you make a mistake during the configuration process, start again from the beginning. www.elektor.com/090834