Light Follower Robot Using Arduino

by DavidM386 in Circuits > Arduino

1928 Views, 13 Favorites, 0 Comments

Light Follower Robot Using Arduino

Screenshot (8).png

The circuit is used to control a robot by increasing or reducing the light intensity.circuit components are,

potential meter,arduino uno,operational amplifier, npn darlington transistor, motor,Ldr-light dependent resistor,

Working

Screenshot (9).png

when the intensity of light to the ldr is increased current flows to the amplifier then to the arduino.This causes the motor to rotate,.The motor rotates the wheels of the robot

Code

int in=13;

int out=12;

int pinState=0;

void setup() {

pinMode(in,INPUT);

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

}

void loop() {

pinState=digitalRead(in);

if(pinState==HIGH)

{ digitalWrite(out,HIGH);

} else

{ digitalWrite(out,LOW);

} // put your main code here, to run repeatedly:

}