Robotics Circuit Diagrams

Line Follower Robot using Microcontroller

Have you ever ventured into creating your own robot? Here’s a straightforward and user-friendly robotic project for you. In this endeavor, I will guide you through the process of designing and constructing a Line Follower Robot using a microcontroller. This Line Follower Robot is a fundamental robot that autonomously traces a predefined path outlined by a line, typically a black line on a lightly colored surface, with a specific width.

Outline

  • Line Follower Robot Circuit Principle
  • Line Follower Robot Circuit Diagram
  • Components in the circuit
  • How to Design a Line Following Robot?
    • Design of IR Sensors
    • Working of IR Sensors
  • Line Following Robotic Vehicle Circuit Working
  • Code
  • Line Following Robot Circuit Applications
  • Limitations of Line Follower Robot

Line Follower Robot Circuit Principle

The key components of this circuit include an 8051 microcontroller, two IR sensors, motors, and a motor driver IC (integrated within a module). The physical structure of the chassis is essential for the line-following robot, and for this project, a 4WD Acrylic chassis was utilized. The two infrared sensors are positioned at the front of the robot, with their diodes oriented towards the ground.

When the robot is placed on a predetermined path, it detects the line and adheres to it. The outputs of the two sensors determine the robot’s movement direction. If both sensors register that they are on the same path, the robot moves forward. When the left sensor detects a deviation from the line, the robot steers to the right. Similarly, if the right sensor detects a deviation, the robot turns to the left.

Each IR sensor consists of an IR transmitter and an IR receiver on a single board. While the robot is traveling on a black line, the IR rays are continually absorbed by the black surface, resulting in a high output. However, when the robot transitions to a white surface, it starts reflecting the IR rays, causing the output to go low. Consequently, based on the output of the IR sensor, the microcontroller instructs the motors to adjust their direction accordingly.

Line Follower Robot Circuit Diagram

Line Follower Robot using Microcontroller

Components in the circuit

  • 8051 Microcontroller
  • Development Board for 8051 Microcontroller (preferred)
  • 10KΩ Resistors X 2
  • 10µF Capacitor
  • 11.0592MHz Crystal
  • 33pF Capacitors X 2
  • Push Button
  • Motor driver Module (L298N)
  • Robot Chassis with Motors
  • IR Sensors x 2

How to Design a Line Following Robot?

The circuit comprises several essential components: an 8051 microcontroller, IR Sensors equipped with both IR transmitters and IR receivers, an L298N Motor Driver Module, a robot chassis equipped with four wheels and four motors, and a battery holder.

At the heart of this project is the 8051 microcontroller, a robust 8-bit microcontroller boasting 32 programmable I/O pins. It comes equipped with various peripheral features such as programmable UART, dual 8-bit timer/counters, two interrupt sources, and external memory access capabilities.

To facilitate the connection between the microcontroller and the robot’s DC motors, a motor driver IC is employed. The microcontroller’s output is limited to 5V with a very low current capacity, making it insufficient to power the motors directly. Consequently, a motor driver IC, specifically the L298N, is utilized to amplify the voltage. The L298N is capable of driving motors with voltages up to 36 volts and currents up to 3 amps.

Typically, the 15-pin driver IC is housed in a multiwatt15 package. These ICs are readily available in module form on the market. To establish a connection, PORT2 pins P2.0, P2.1, P2.2, and P2.3 are utilized to interface with the Motor Driver Module’s inputs.

Additionally, the two IR sensors are connected to the microcontroller’s P2.6 and P2.7 pins. The robot chassis is configured, and the four wheels are linked to the robotic vehicle’s motors, which, in turn, are connected to the microcontroller.

Design of IR Sensors

The IR sensor circuit primarily comprises an IR transmitter and an IR receiver. The IR transmitter functions much like an LED, with an operational voltage of approximately 1.4V. To safeguard it, a 150Ω resistor is inserted in series and connected in a forward-biased manner. Meanwhile, the IR receiver is set up in a reverse-biased configuration, and a 10KΩ resistor is situated between VCC and the receiver. The output is extracted from the junction between the resistor and the IR receiver.

As this output is analog in nature, it can be converted into digital signals (HIGH and LOW) using a straightforward comparator IC like the LM358, for instance. The IR Sensor Module utilized in this project follows the same arrangement, and you can refer to the circuit diagram provided below for further details.

Working of IR Sensors

The IR transmitter consistently emits infrared rays. When the IR transmitter is positioned on a black surface, these rays are absorbed by the surface, whereas they are reflected when it’s on a white surface. In the absence of detected IR rays, when the voltage from VCC flows through the resistor, the IR receiver exhibits the highest resistance. Consequently, the voltage at the output pin remains at approximately 5V.

The resistance value decreases as the intensity of IR photons received by the receiver increases, leading to a phenomenon known as reverse breakdown. Consequently, the voltage passing through the resistor gets grounded, resulting in an output pin voltage of 0V.

Line Following Robotic Vehicle Circuit Working

  1. Initially draw the path on a light colored surface with black color tape.
  2. Place the robot on the floor.
  3. Now power on the circuit.
  4. Robot moves in the specified path.
  5. When it moves out of path, sensors check it and automatically adjust the robot.

Code

  #include<reg51.h>
  sbit mot1=P2^0;
  sbit mot2=P2^1;
  sbit mot3=P2^2;
  sbit mot4=P2^3;
   
  sbit s_left=P2^6;
  sbit s_right=P2^7;
   
  void forward (void);
  void backward (void);
  void left (void);
  void right (void);
   
  void forward (void)
  {
  mot1=0;
  mot2=1;
  mot3=1;
  mot4=0;
  }
  void backward (void)
  {
  mot1=0;
  mot2=1;
  mot3=0;
  mot4=1;
  }
  void left (void)
  {
  mot1=0;
  mot2=1;
  mot3=0;
  mot4=0;
  }
  void right (void)
  {
  mot1=0;
  mot2=0;
  mot3=1;
  mot4=0;
  }
  void stop (void)
  {
  mot1=0;
  mot2=0;
  mot3=0;
  mot4=0;
  }
   
   
   
  void main()
  {
  s_left=1;
  s_right=1;
  while(1)
  {
  if(s_left==0 && s_right==0)
  {
  forward();
  }
  else if(s_left==1 && s_right==1)
  {
  stop();
  }
  else if(s_left==0 && s_right==1)
  {
  left();
  }
  else if(s_left==1 && s_right==0)
  {
  right();
  }
  }
  }

Line Following Robot Circuit Applications

  • This can be used in driver less car system with some added features like obstacle detection.
  • This can also be used in industrial and defense applications.

Limitations of Line Follower Robot

  • Line follower robot requires 2-3 inches broad line.
  • It may not move properly if the black line drawn is of low intensity.
  • The IR sensors may sometimes absorb IR rays from surroundings also. As a result, robots may move in improper way.

 

Tags

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button
Close
Close