Connect the wires to the motors. Then attach the motors to the chassis using Zip ties. Attach the wheels to it.
Now the body is complete.
Here we are using an L298N motor driver module which is a dual H-Bridge driver. It can drive 2 motors bi-directionally or 4 motors uni-directionally.
Connect the motors to the driver.
Connect the power source to the power pins of the driver.
The IR sensor module has an emitter and a receiver. The IR light is absorbed by black surfaces and reflected by white surfaces. This helps us to follow the black line.
Connect 3 jumpers to the IR sensors.
One for data and the rest two for power.
Connect the input pis of the motor driver to the digital pins of the Arduino. Assign them using the code. Do the same for the IR sensors.
Link to the code: https://github.com/sairushan/Line-follower
Upload the code and enjoy!
Comments