Wall follower – AVR Based Autonomous Robot

An intelligent machine like robot is used for various applications such as line following, obstacle avoidance and colour detection. One of the application is automatic navigation employed in wall following robot. It is used for parallel parking of vehicles and auto detection of obstacles. This robot can be made by using ultra sonic sensors and ir sensors for distance measurement. The control for the wall follower is provided by using actuators i.e. motors. The direction for motor control is done using PWM technique and are driven by using motor driver L293D. A 16×2 LCD is interfaced with robot to display the directions FORWARD, LEFT, RIGHT, and STOP.  The robot design is based on Atmega 8 controller board.

Buy Now on RoboMart

Working Principle


When the robot moves towards the wall the obstacle sensor detects the wall and moves in other

direction. Depending upon the control input when the Left sensor is ON the robot moves in right direction. When the left sensor is OFF the robot moves in left direction.




Controller Board Atmega 8

The wall follower robot design is based on Atmega 8 as the main controller. As many variants of AVR are available in the market, compared to others 8-bit is enough for this application. Some of the features of Atmega 8 are:

  • It design is based on RISC architecture.
  • It has flash memory of 8kb, EEPROM of 512 bytes and 1kilobytes of internal static RAM.
  •  Support three types of communication on the board SPI, USART and two wire interface.
  • Built in analog comparator for comparing voltages.
  •  In built ADC providing a digital output data of 10 bit resolution.
  • 3 PWM channels for speed control of motor.
  • 23 programmable input and output lines.
  • Special features like power on reset and brown out detection and internal calibration capability.

Actuation using PWM

PWM(pulse width modulation) generation using Atmega 8


Microcontroller is a device which can control the devices like LED and electrical appliances for ON/OFF control but it is not possible for a microcontroller to control the brightness of a LED or speed of a motor. To overcome that problem Pulse width modulation technique is used.

In PWM (pulse width modulation) the output pin of microcontroller is made high and low at repeated intervals this makes the output pulse to be low (0v) for logic low and high (5v) for logic high.

If it is in between logic high and logic low it produces the output in between 2.5v.

This can be done by changing the duty cycle of the pulse generated. Pulse width modulation is used for controlling speed of servo motors and for controlling brightness of various devices.

IR Sensors – Wall follower Robot

IR sensors uses infrared technology to determine the object i.e. wall. It uses a specific light sensor, which when detects the object reflects the infrared light and when no object is present no ir light is reflected back.


Motor Driver L239D

For moving the robot in either direction we need to drive the motor. But it is not possible to control a motor with one IC like ULN 2003, and here comes the advantage with L293D. It is a special IC of 16 pin designed to control the motor in both directions simultaneously.


ATmega 8 microcontroller genarates very less current in milli amperes which is not able to drive the motor. Hence a driver L293D is interfaced with motor. It is most popular ones which draws less amount of current and operates 2 dc motors. The advantage of L293D is it is easy to hook up.

16×2 LCD

LCD is display device used for displaying ascii characters. It gives an indication to the user specified commands by displaying them. Commonly used LCD are 16×2 display with 2 lines, each line having 16 characters. It is used for displaying alpha numeric characters and symbols. Most of the today’s displaying gadgets are using LCD’s. Some of the features are

  • It can support upto 2 lines with 16 different characters on each line, animations can be drawn.
  • It has extra support of LCD firmware for serial control display.
  • Mostly used LCD’s are having green background display with black text on screen.
  • Easily programmable and interfaceable.

Suitable for: Beginners, Hobbyists, Students

Buy Now on RoboMart