Introduction
In this article, we are going to see how to work with infrared sensors and Arduino to create a line follower Bot. The infrared sensors use the Laws of Reflection to detect a Black Line. The basic phenomenon happening is a black body absorbs the heat radiation much more than a white body absorbs it, the same phenomenon is used in solar cookers. The Op-Amp compares the input and output of the sensors and hence produces the output to the Arduino in the form of digital signals.
Requirements
- Arduino UNO
- IR sensor
- Gear Motor
- Robot chassis
- Connecting wires
- L293D motor drivers
The process is a comparison between the sensor1 and sensor2. If sensor1 is high and sensor2 is low, then turn to the left of the Blackline; similarly vice versa for a right turn. If there is no input the bot will stop moving.
- Open the Arduino Software.
- Initialize the Pins used in the codings.
- Declare whether it's input or output.
- In the void loop, the coding for the Bot movement is provided. We declare Left motor as LM and Right motor as RM and IR Sensor value as LS and RS as per the requirement.
- Compile the coding in the Arduino. Go to sketch, then compile, we can use shortcut ctrl+R.
- Upload the code, put a black line and test the Bot movement. Here is an example from the internet.
In this article, we learned how to work with the IR sensor and Arduino and create Line follower Bot using gear motor and L293D motor driver. This can be further modified to create an automated delivery system for the household.