Line Follower Robot with ATmega16 using Analog IR Sensor
The Line follower robot is a mobile machine that can detect and follow the line drawn on the floor. Generally, the path is predefined and can be either visible like a black line on a white surface with a high contrasted color or it can be invisible like a magnetic field. Therefore, this kind of Robot should sense the line with its Infrared Ray (IR) sensors that installed under the robot. Line follower robot is a useful robot that is used in ware houses, industries, and stores etc, where it follows a dedicated path.
In this project, we will learn How to design a line follower robot with AVR ATmega16 microcontroller using Analog IR Sensor. This robot is an automatic robot i.e no manual control is needed. The robot automatically follows a line without any deviation from the line. The robot changes its direction incase it deviates from the line. Generally, the line is of black color on white surface or white line on black surface. To detect white and black color, we will use IR sensor because white surface reflects IR rays and black surface absorbs IR rays. In this way, the output of IR sensor defers in black and white surface. In our case, we will use a black line on white surface.
Here, we will use three analog IR sensors. All the three sensors will be placed in the front side of the robot and all will be pointing downward. One sensor will be placed above the black line and the other two will be on left and right side of middle sensor. The output of the IR sensor changes when the sensors moves from white surface to black surface or from black surface to white surface and this change will be detected by the microcontroller. But the outputs of the three analog IR sensors are analog in nature, so these signals cannot be processed directly by the microcontroller. For this, we will use the ADC of the ATmega16 microcontroller to convert the analog signals to digital values. After converting the analog signals of analog IR sensors to digital values, the ATmega16 microcontroller will compare the sensor values with a reference value(3V in our case) to know the position of the sensors.
When the position of the middle IR sensor is above the black line, the ATmega16 microcontroller will send the forward control signal to the DC motor driver (L293D) of the robot to move the robot in forward direction and when the left sensor is above the black line, the ATmega16 microcontroller will send the left control signal to the DC motor driver (L293D) of the robot to move the robot in left direction and when the right sensor is above the black line, the ATmega16 microcontroller will send the right control signal to the DC motor driver (L293D) of the robot to move the robot in right direction. The above processes of ADC conversions, sensors output comparison and robot control continues. In this way, the robot follows the black line.
|AVR Trainer Board-100 with ATmega16||1pc|
|AVR USB Programmer||1pc|
|Analog IR Sensor||3pc|
|DC Motor Driver||1pc|
|Robot V 4.1||1pc|
|1 to 1 Connector-Female to Female||10pc|
|10 to 10 FRC Female to Female Connector||2pc|
|12V, 1A DC SMPS Adaptor||1pc|
The step-by-step connection guide for Line Follower Robot with ATmega16 using Analog IR Sensor is as follows
Steps - 1 ( 0f 11 )
Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.
Steps - 2 ( 0f 11 )
Connect PortB header of AVR Trainer Board-100 with Input header of DC Motor Driver with a 10 to 10 FRC Female Connector.
Steps - 3 ( 0f 11 )
Connect the 12V pin of PWM & Motor Voltage header of DC Motor Driver with the 12V header of AVR Trainer Board-100 with a 1 to 1 Connector.
Steps - 4 ( 0f 11 )
Connect the Robot connector to the Output header of the DC Motor Driver.
Steps - 5 ( 0f 11 )
Switch off the Mode Switch of DC Motor Driver.
Steps - 6 ( 0f 11 )
Connect the VCC and GND pins of three Analog IR Sensor with 5V and GND header pins of AVR Trainer Board-100 with 1 to 1 connectors.
Steps - 7 ( 0f 11 )
Connect the O/P pins of left, front and right Analog IR Sensor with PA0, PA1 and PA2 pins of PortA header of AVR Trainer Board-100 with 1 to 1 Connectors.
Steps - 8 ( 0f 11 )
Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of AVR USB Programmer with a 10 to 10 FRC Female Connector.
Steps - 9 ( 0f 11 )
Connect the AVR USB Programmer to the PC/Laptop's USB Port directly or with the help of USB AM-AF Cable.
Steps - 10 ( 0f 11 )
Download Line Follower Robot with ATmega16 using Analog IR Sensor Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR USB Programmer.
Steps - 11 ( 0f 11 )
Switch on the power with the help of Power Switch of AVR Trainer Board-100 and see the output.