LIne following robot
Making a simple line following differential drive robot using the theory learnt in last tutorial
Electrical Components used:
- IR Sensor- It will act as an input device for us which will detect the color of the ground.
- Crux- When the sensor is above a white surface, it will give a HIGH signal and when it is above a black surface, it will give a low signal.
- The sensors will be placed at the front side of the robot facing the ground:

- Two DC Motors to drive the wheel.
- Arduino UNO Board
- L298 Motor Driver
For other components used, you may refer to the following slide made by Robotics Club, IITD:
RW on Line following robot
Circuit
- IR Sensor has 3 pins
- Connect Vcc to 5V of arduino
- Connect GND to ground of arduino
- Connect SIG(Signal pin) to any of the digital pin of arduino
- The connections of other electronics are already covered in the previous tutorial: DC Motor Speed Control
Concept:
- When both left and right sensor senses white then robot move forward.(Both wheels move with same speed)

- If left sensor comes on black line then robot turn left side.(speed of right wheel will be more than speed of left wheel)

- If right sensor sense black line then robot turn right side until both sensor comes at white surface. When white surface comes robot starts moving on forward again.

- If both sensors comes on black line, robot stops.

Code:
That’s your next assignment ;)