Hi Friends,
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):
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:
TSOP1738 datasheet
Info on Sony remote control codes
Thanks & Regards,
ccd@dharmanitech.com
67 comments:
Do you have a video of it in action?
I just put it up! check it out.
Hello
Did u find a Sony RC encoded remote in India? Coz most of common remotes I came across were NEC format encoded. So I made AVR Interface to them you can check it out here.
http://extremeelectronics.co.in/code-libraries/using-ir-remote-with-avr-mcus-part-ii/
Hi Arvind,
I've got a Sony TV remote, so I got the codes online for it and tried the code and it worked. So,I think you can get it easily in India. I've not tried other remotes yet, but shortly I'll test them with same code and post the results here.
Thanks for that link, it'll be really useful for many beginners!
Hi,
I have doubt in the H-Bridge operation, in your circuit you have connected Q1 and Q4 then Q3 and Q2
and it is very clear for me you are operating High side Cross Low side to operate the Motor, but can you clarify me on the following design where a bridge driver is used and with different configuration
http://hades.mech.northwestern.edu/wiki/index.php/Driving_a_high_current_DC_Motor_using_an_H-bridge
Hari Haran.C
Hello sir i just wanted to know whether u can just mail me the hex file of this project..... Please depending on u only coz i cant generate hex file... Email: Prashanth_eng@yahoo.com
great project! very cool blog
thanks for such an interesting project... can u plz let me know what is the total cost of the project....
i used diferent sony remote but not worked please tell which Sony TV remote you r used
please give remote or TV modle no.
Hi,
the Sony TV remote which I used here is: RM-GA002
It is for Sony Triniton TV.
while going through comments I came to knoe that you hve used same dc motor control ckt for RC car too.But voltage supply is not same in case of motor you r giving 9 v across mosfet.Can it be done with same ckt.
Yes, you can use the same circuit to drive the motor from VCC, if your motor doesn't need higher power. Make sure that you connect the electrolyte capacitor across the supply, as shown in the circuit, to stop the controller from resetting when motor starts.
Hello Dharmani sir....
can you help me build this remote controlled car project from the scratch - step by step ?
I am a 7th sem B.Tech student and I got to make my final year project...And I think if I am able to make this , I would become a rocking star overnight...
Thank you sir (my ID : manurs87@gmail.com)
Hello Mr Dharmani,
I am working on ATMega128 + H-Bridge + DC motors.
in source code, I saw macros.h and I would like to know get that macros.h
I am still learning about macros.
I am using WinAVR to compile my code.
Thanks in Advance.
sorry for grammatical mistake and also I want to past this in other post. but please Help me with macros.h
Hi,
macros.h is header file specific to ICCAVR compiler. If you are using other compiler, you don't need it, you can simply remove that line from the code.
For example, if you are using winAVR, then including 'avr/io.h' is sufficient.
Thanks a lot for replying. That will make my work lot easier.
I am using winAVR.
Hi Dharmani sir,
I'm a 4th sem B.Tech student and am making a prototype of a simple wireless rc vehicle. So could you help me with it by explaining this bot you've made in layman's terms? i'm a begineer at robotics, you see.
Thank you.
Chinmay Kulkarni.
chk5391@gmail.com
can i know voltage tat should be given at vcc..... i'm still new to tis field....
hello
i want do make a wire less remote for robo war ...but i m something new in robotics...
so i require dc remote controlling to drive two or four dc motors....
can u help me for designing the simplest remote controlling for dc motors.....
hello sir
can u provide me the picture of designed pcb connections , used in this car .....
i want to just know that all these motors , used in this car are moving simultaneosly or not ...
can we control the motors one at a time to move the car right or left.....
Hi Ankit,
these project uses only one motor, so the car can move only in reverse and forward direction. Speed is variable (using remote). If you want to use more that one motor, you need to provide a driver (H-bridge) per motor (and also atlet one PWM channel per motor). Then you can change the speed of motors independently.
hai
kindly let me know how to connect RF transmitter and receiver instead of IR....do yo have source code for RF tansmitter and receiver.
I see you connected high-side N-Channel MOSFETs source pin to the motor. Since the NMOS is activated when voltage at the gate is over the voltage at the source pin... I wonder, have you considered this? Are the High-side MOSFETs getting hotter or something?
Forget about my last commentary. I read the comments related to a previous post about the same issue I noticed in your circuit.
We have experienced technicians to help you through our ordering process for your truck body replacement parts or your car body parts and body parts for cars and trucks.
Thanks
Mini Cooper parts
'very interesting post'
can you send me the hex codes plesase .my mail id is acp.9669@gmail.com
I am student at the British university in Egypt . I am proceeding this project for my course in electronics 2 and i really need help . I carried out all the project , but
the hex that i used to burn the atmega8 is corrupted . I am really in need for the code and the hex file for this project. If you could send it today ,i will be grateful for ever.because my due time is tomorrow my e-mail is
my_best_gift@ Hotmail.com
thank you in advance
Hi Sir
Could u please suggest and give some robotic project using atmega16 except the line follower. My email id
mashok74@gmail.com
I would like to use ATtiny261. But I don't know where "int0_isr" should be placed. Can I put it in Timer/Counter0 Overflow? Thanks.
hello sir,
Iam mukilan of 4th sem ECE and beginer in robotics can u please send me the .hex file of the remote control car to mashok74@gmail.com
hello sir,
Iam mukilan of 4th sem ECE and beginer in robotics can u please send me the .hex file of the remote control car to mashok74@gmail.com
can it be implimented using 8051??
Yes, it can be done with 8051, but you'll need to write the code for software implementation of PWM, as 8051 doesn't have hardware PWM. It's just a little extra work.
Thank Dharmani. I use ATtiny261V to control the motor and use ATtiny13A for the IR remote using SIRC. It works!
how to do the IR remote interfacing with ATMEGA128 using c code...please reply soon.i need the code.
thank you.
hello ,
I was wondering weather i need the following file for the project to work :
#include "PWM_main.h"
However i have successfully compiled and programmed with avrstudio using only
#include
#include
is this the correct way?
hello ,
I was wondering weather i need the following file for the project to work :
#include "PWM_main.h"
However i have successfully compiled and programmed with avrstudio using only
#include avr/io.h
#include avr/interrupt.h
is this the correct way?
Yes, that is a correct way.
The code given here is actually in two parts, if you read the comments there, the upper part is to be copied into a file "PWM_main.h" & the lower part in the "PWM_main.c".
This is just for simplicity, as many people prefer to have a header file for all the definitions.
But if you copy the complete code into one C file, no problem, you don't need #include "PWM_main.h" statement.
The remaining two included files are part of ICCAVR compiler, so if you are using other compiler like winavr, you need to replace those files with your compiler specific header files, just like you did.
Hi,
I reckon the most amazing and challenging part of your project is the ir remote control receiving part of your code. I guess you have had some problems with it too. It is more challenging for me though since i have aiwa remote with no idea which protocol or any parameters for it.
Cold you please help me clear the basic things about ir. I guess the main parameters used are: address bit length and command bit length and protocol bitrate. Am i right?
My second question would be would it be enough to have atmega32 to control up to 4 outputs, which microcontroller should i use to have 6 outputs? Is it the number of clocks in it?
Then again, because i cant use my aiwa remote i have found and tried circuit with another sony remote not exactly same as you have , it did not work. I suppose the leds should blink only when i turn it on by pressing 0. What could be the difference with other sony remotes. At least it should support same protocol but the address bit length and command bit length. Am i right?
regs.
I have found another sony TV remote, not exactly same as you have ,and tried my circuit with it, it did not work. I suppose the leds should blink only when i turn it on by pressing 0. What could be the difference with other sony remotes. At least it should support same protocol but the address bit length and command bit length could be different. Am i right?
how to write a sourcecode in embedded C
I have LG TV remote
what will change in code?
please reply me on below:
dharmesh25_6@rediffmail.com
thanks
HI CC DHARMANI !!
first of all thank you very much for providing the relevant files for the 3310-ATMEGA8 thermometer, thanks.
i am facing some errors while compiling the codes in the AVRSTUDIO as well as the ICCAVR (by imagecracker)
can you please guide me on how to compile and load the c as well as the header files in any compiler or on the atmega8 controller.
sorry to give you some trouble but i am using the ATMEL products (and so AVR) for the very first time so i am new and unknown...
waiting for you reply!!!
thanks!!!
ANKIT JOSHI
Hello Dharmani,
Thank you very much for sharing such an interesting and useful project. I would like to try this project with Onida Remote Control. I googled to find any information related to ondia remote, but unsuccessful. Please share me if you have any information related to Onida Remote Control.
hi dharmani its a nice project.
i am working on ir remote controllers, can i build the same project using 8051/52 and i have designed a ir remote of my own using 555timers which has 4 switchs, so plz help me......
or there any codes for this then send to my mail....
jayanth_vits@yahoo.co.in
thanks .......
Your project helped a lot, thanks for sharing.
Hi... sorry for replying to such an old post. anyway, i have AVR Studio 5. do i have to include macros.h or can I use something else? or do I just cut it out?
Thanks so much in advance for replying
macros.h is required only if you are using ICCAVR compiler. For AVRstudio, you can remove that and include instead the usual header file avr/io.h
The circuit blueprint is simple enough. But the remote pulses are the most difficult here.
hello Dharmani,
how do i change his code to source code codevision? I do not understand iccavr
hello,
this is just a wonderful tutorial.......i am like kind of beginner in this so do u have the source code for just running motors using the remote without pwm.........cos i find to confusing to understand the code............if yes pls forward to my mail id........thanks in advance for ur kind help
karthik(karthik4294@gmail.com)
HI,
Can I get the assembly language code for this??
my email: maasimislam@hotmail.com
hello sir can you please provide me the program for IR controlled car using 8051 as i am working on this project.
neat and clean explanation. But i have a doubt? what is the range of IR tansmitter and receiver. Generally we need to generate 38KHz signal as a carrier.
http://www.npeducations.com/2011/01/design-of-ir-transmitter-and-receiver.html
we implemented same ckt but TSOP pin connected to INT0 of atmega 8 does not reduce below 3.5V on detection of remote signal.
Please suggest as soon as possible!
Check the circuit connections again. If that doesn't help, try another TSOP, or try with different remote. The LED connected to ATmega must glow on detection of a code from TSOP.
From Anonymous:
I used the same remote model that u used but we implemented on bread board.We used ceramic capacitor.
please suggest
what is the programme for micro-controller to drive 2 motors.
Circuit worked! No problem with ur circuit diagram.Mistake was of programming.
Nice project!!!!!!!!!!!!!!
Sir have u posted anything about creating our own programmers for atmega 8 or 16 on ur website?
If s please tell as soon as possible.
Thank u.
Visit this post on my blog to see how to make your own AVR programmers:
http://www.dharmanitech.com/2008/09/diy-avr-programmers.html
Very useful articles. I and my friend to do some research. I am very glad to see such information, I find the very long period of time, was finally I found, thank you.
hello
please mail me the hex file of this project to
rayapatimohith@gmail.com
thanks in advance
can i use atmega16 instead of atmega 8
hi sir,
sirc protocol using 40 khz carrier signal for sending data but in this project you are using tsop1738 reciever.
it is an 38khz signal.
so how it decodes the 40khz signal pulses.
Post a Comment