loading

Hi everyone. creating a robot that follows the light you are giving as input is simple . we create this project using arduino and three LDR that are mounted in front, left side and right side. we give light input to any of these ldr's and the robot detects the light and follows it. The program and other instructions are provided below.

MATERIALS USED:

  1. arduino uno
  2. LDR - 3
  3. 9v battery 2
  4. dc motor 2
  5. bread board
  6. connecting wires
  7. chassis
  8. l293d motor driver

Step 1: Using L293d Motor Driver Ic

L293d motor driver connections are as shown in picture

  1. the 1st and 9th pins are enable pins they always should be given HIGH. connect it to 5v
  2. pins 4,5,12,13 are ground connect it to the ground
  3. pins 2 and 7 are inputs for the left motors connect this pins to the arduino gpio pins
  4. pins 10 and 15 are input pins for right motor connect it to the arduino gpio pins
  5. pin 8 is vcc pin that is we should give the batteries positive to vcc and ground should be connected to the ground
  6. pin 16 we can connect it to 5v
  7. pins 3 and 6 are output pins for motor connect it to the left motors wire
  8. pins 11 and 14 are output pins for right motor connect it to the right motor wires

CHECK THE MOTORS WORKING:

code given below is to check the working of motor alone:

int input1leftmotor=7;
int input2leftmotor=3;

int input3rightmotor=2;

int input4rightmotor=4;

void setup() {

pinMode(input1leftmotor, OUTPUT);

pinMode(input2leftmotor, OUTPUT);

pinMode(input3rightmotor, OUTPUT);

pinMode(input4rightmotor, OUTPUT); // put your setup code here, to run once:

}

void loop() {

digitalWrite(input1leftmotor,HIGH);

digitalWrite(input2leftmotor,LOW);

digitalWrite(input3rightmotor,HIGH);

digitalWrite(input4rightmotor,LOW); // put your main code here, to run repeatedly:

}

About This Instructable

201views

5favorites

License:

Bio: ARDUINO AND RASPBERRY PI
More by prajitkk:Light Following Robot Using Arduino HOME MONITORING USING ARDUINO AND IOT 
Add instructable to: