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
4.Dupont wires 200mm.
5.VS1838B IR reciever.
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.
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.
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.