You are on page 1of 13

Line Follower Robot,,

Introduction:

Line following Robot is a machine that can follow a


path. The path can be visible like a black line on a
white surface (or vice-versa)
versa) or it can be invisible like
a magnetic field.
Materials:
The materials list for a Line Following Robot is pretty basic and straight
forward.
1. ATmega8:
This is going to be the main processing unit for our robot. All the
logic operations will be performed by ATmega8. Besides, it will do the
work of commanding all other components to start/stop their work.
work
2. Motor: Motor is a very important part of robot.
3. Motor Driver(L293D):
All motors are directly connected to the motor driver. Motor driver
receives command from the microcontroller in form of PWM signals and
accordingly drives the motors at varying speed.
4. Sensor Plate:
This would the main input sources for feedback on the
whereabouts of the robot with respect to the line. We can use any
number of sensors in the array but generally, we use 4,5 or 7 sensor array
plate.
5. Power Supply:
We are going to need a 12V external power supply/battery as the main power
source for our battery.
Motor Driver IC
PWM

PWM

IR Sensor
Connections:
Connection of atmega8 with sensor and motors

SENSORS: MOTOR:
sensor connected with PORTD Motor connected with PORTC
L = D3 IN1 = C0
C1= D2 IN2 = C1
C2= D1 IN3 = C2
R = D0 IN4 = C3
Color Detection
Sensor Arrangement On Robot
1C2 R Input Turns

Condition 6 0000 Turn 180 degree


obot

Condition 5 0111 Turn right

Condition 4 1110 Turn left

Condition 3 0010 Turn soft right

Condition 2 0100 Turn soft left

Condition 1 0110 Forward


Motor Speed control by PWM
Programming of ATmega8 controller

Normal Programming
PWM programming

Let see normal programming


PWM programming of atmega8

atmega8 have 3 PWM outputs.


PIN 15 OC1A PIN 16 OC1B PIN 17 OC2

Timer1 Timer2

Here we are using timer1 and OC1A & OC1B to get PWM
utput to control the speed of motor.
Registers:
Here are some registers of AVR, which is used for
programming of PWM.

OCR1A & OCR1B


OUTPUTS:

TCNT1
OCR1x + 1
Duty cycle = X 100
256
OCR1A=191

OCR1B=63

OC1A

OC1B

You might also like