Friday, January 9, 2009
IR Remote Controlled Car (PWM motor control using ATmega8)
in my last post of Simple DC motor Control, I've discussed controlling a small DC motor using the PWM method with MOSFET H-bridge. The circuit was build with microcontroller ATmega8.
Here, I'm extending the same circuit to control the DC motor with IR remote control. The motor is fitted on a toy car wheels with gears, as shown in the figure above.
Following is the schematic (Click on the image to enlarge it):
The circuit uses two PWM channels of ATmega8 for controlling the speed and direction (reverse, forward) of the car, based on the command received from the IR remote. Here, a Sony TV remote was used. The IR codes were received by using TSOP1738 IR detector from Vishay. (Thanks a lot to Michael Spiceland from tinkerish.com, for helping me out with the code for IR signal decoding!).
Following buttons on the remote are used for control:
'1' : Start motor
Volume+ : Increase speed
Volume-: Reduce speed
Channel+: Forward direction
Channel-: Reverse Direction
'0': Stop motor
Check out the video (the LED blinks whenevr a key on the remote is pressed. The remote is not visible in the video as I was holding the camera and remote both!!)
The coding is done with ICCAVR compiler. It can be easily adapted to other compilers with minor changes. Complete code is given here:
View Code on Google Docs
Download source code files (zip)
Download datasheet & further info:
Info on Sony remote control codes
Thanks & Regards,