Introduction: Tracked Robot IR Remote Control by Arduino
Many years ago,I had studied Dual H-bridge motor drive control by hacking cheap 4 channals toy remote control board and applied it to remote twin motors track and wheel set.Now I try to use Arduino controller with IR remote to control it again.That's also work.
Step 1: Materials and Tools
1.Track and wheel set.
2.Gear box - Individual drive-two motors
3.Arduino UNO
4.Dupont wires 200mm.
5.VS1838B IR reciever.
6.Battery 5-12V.
7.IR remote (Can use also old TV remote)
8.L298N Dual H-Bridge motor drive module.
Step 2: Mechanical Assembly & Electrical Connecting
1.Assembly Track and wheel set as manual instruction.
2.Install Arduino UNO controller ,IR reciever , L298N motor drive module and battery on chassis.
3.Wiring
Arduino pins to IR reciever :
11 - IR reciever o/p signal
5V - IR reciever Vcc
GND - IR reciever ground
Arduino pins to L298N motor drive module :
10 - ENA
9 - IN1
8 - IN2
7 - IN3
6 - IN4
5 - ENB
Connect Arduino GND pin and L298N motor drive module GND.
L298N motor drive module :
Connect power o/p to Motor A and B
Connect battery to Arduino controller and L298N drive module (can use battery up to 12V.)
Step 3: Collect IR Remote Code
Use Arduino UNO IR remote button decode sketch to decode your each IR remote buttons' hexa code.You can apply any type of IR remotes TV,LCD, DVD player,etc.
(Refer to https://arduino-info.wikispaces.com/IR-RemoteContr... )
Collect each IR remote button's hexa code.We will use 7 buttons' hexa codes for main sketch.
In this instruction ,My own IR remote ,I selected :
Button 2 - forward direction - Hexa code FF18E7
Button 8 - backward direction - Hexa code FF5AA5
Button 4 - turn left direction - Hexa code FF10EF
Button 6 - turn right direction - Hexa code FF5AA5
Button 3 - rotating right direction - Hexa code FF7A85
Button 1 - rotating left direction - Hexa code FF18E7
Button 5 - stop all direction - Hexa code FF38C7
Step 4: Modify Dual H-bridge Motor Drive Control Sketch and Comply.
Download the main sketch.Before complying ,modify the 7 control buttons' hexa codes in attached sketch to be your own IR remote hexa codes.Then comply and upload it.
Test the robot is running correctly or not by pushing button as wanted direction.If :-
1.Motor turn on wrong direction - interchange power o/p of motor drive module.
2.Sleep L298N motor drive module - check GND connection between Arduino controller and motor drive module.
3.Speed of each motor can be adjusted by changing value in sub-sketch from 0-255.In the attached sketch default = 100
Thank to L298N dual H-bridge motor drive control sub-sketch from Tronixlabs.
And thank to vigneshraja for IR remote sub-sketch.
15 Comments
6 years ago
Do I need to use two power sources one for Arduino board and one for the motor controller? (I am a total noob)
Reply 6 years ago
It's just use 5V supply at L298N module.See circuit diagram.
6 years ago
This sketch had been run without problem.I guess you have problem with compiling error.Try to re-add IRremote library to you Arduino software from https://github.com/z3t0/Arduino-IRremote.If the errors still exist,try to delete the files that have errors.
6 years ago
I have another question, I got troubles with the IR remote control part of the sketch, could you please upload you sketch complete? please bro
7 years ago
This project run with L298N no need to modify,but if you want to change pin number,it's possible.
7 years ago
This project run with L298N no need to modify,but if you want to change pin number,it's possible.
7 years ago
can i make it with l298n,if yes do i need to chang the code.
7 years ago
Great job! but does it work whit L298 Dual H-Bridge motor drive module?
Reply 7 years ago
Yes,it works.It can drive step motors by leaving the small clips on enable motor A and B pins.When driving ordinary motors,take it off.And enable PWM by program.
Reply 7 years ago
ajajja how can I be so blind? thanks a lot! but how can I enable PWM by program? I m new on the arduino world
Reply 7 years ago
Let see the attached sketch,enA enB o/p pin 10,5.
Reply 7 years ago
HI! well I have troubles, starting for the IR receiver stop working and I dont know why
Reply 7 years ago
Perhap your batt out,just a joke.You can use serial monitor to see which step it stop,You can modify sketch by add serialprnt to check that it pass your point or not.For hardware you can check circuit ,there're something wrong or not.
Reply 7 years ago
ajjaja when I read was like WTF? ok I will try, thanks for your time
7 years ago
the TV remote controlled modified car sounds amazing actually, but were do I buy the materials for the cheapest price.