Friday 2 March 2018

How to Make a Line Following Robot without Microcontroller

Line Following Robot 


Learn - how to make a Line follower robot Without microcontroller DIY at home




It is a Robert that follows a line, either a black line on white surface. 

IR sensor will send a HIGH digital signal ("1"). similarly when the sensor is on a black surface IR rays will be emitted and will not be reflected back which will be absorbed by the black surface, in this state the IR sensor will send LOW digital signal ("0"). Thus with these digital values 1 and 0 we can easily identify the state of the sensors

Required Components :- 

1. Zero PCB Board 
2. IR Infrared Obstacle Avoidance Sensor Module 
3. 16 pin Ic base 
4. L293d ic base 
5. 60W Multi Purpose Hot Melt Glue Gun 
6. 7805 voltage regulator 
7. wood bit (10cm x 5cm x 2.5cm) 
8. BO Motor L Type - 60 RPM 
9. Red BO Motor Wheels 
10. plexiglass piece (10 x 5 cm) 
11. soldering wire 50gm 
12. Yellow Soldering Iron 
13. 10K ohm Variable Resistor 
14. Resistor(100ohm, 1k, 10K) etc.

Diagram:



INPUT 1,2,3 and 4 of L293D will be thrown back to the OUTPUT 1,2,3 and 4 respectively. The INPUT 2 and 3 of L293D is connected to ground which is LOW("0") and the signal from the IR sensors are connected to INPUT 1 and 4. Hence the value of OUTPUT 2 and 3 will be constantly LOW("0") while the value of OUTPUT 1 and 4 will be HIGH("1") when the IR sensor is on the white surface and will be LOW("0") when the sensor is on black surface

Line Follower Robot using Arduino

IR sensor modules namely left sensor and right sensor. When both left and right sensor senses white then robot move forward





source code:



/*------ Arduino Line Follower Code----- */
/*-------definning Inputs------*/
#define LS 2      // left sensor
#define RS 3      // right sensor
/*-------definning Outputs------*/
#define LM1 4       // left motor
#define LM2 5       // left motor
#define RM1 6       // right motor
#define RM2 7       // right motor
void setup()
{
  pinMode(LS, INPUT);
  pinMode(RS, INPUT);
  pinMode(LM1, OUTPUT);
  pinMode(LM2, OUTPUT);
  pinMode(RM1, OUTPUT);
  pinMode(RM2, OUTPUT);
}

void loop()
{
  if(digitalRead(LS) && digitalRead(RS))     // Move Forward
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
  }

  if(!(digitalRead(LS)) && digitalRead(RS))     // Turn right
  {
    digitalWrite(LM1, LOW);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, HIGH);
    digitalWrite(RM2, LOW);
  }

  if(digitalRead(LS) && !(digitalRead(RS)))     // turn left
  {
    digitalWrite(LM1, HIGH);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, LOW);
    digitalWrite(RM2, LOW);
  }

  if(!(digitalRead(LS)) && !(digitalRead(RS)))     // stop
  {
    digitalWrite(LM1, LOW);
    digitalWrite(LM2, LOW);
    digitalWrite(RM1, LOW);
    digitalWrite(RM2, LOW);
  }
}

............................................................................................................................................................

.


More projects:


No comments:

Post a Comment