Arduino Uno LDR Servo Control is a unique program used by the uno to control two servos based on the Light falling on two separate LDRs. the Arduino code provided has been tested in our lab and it seems to be working according to the need. additionally , interested viewers can also watch our YouTube channel for its operation.

Control Two Servo motor using LDR with single Arduino UNO.

Arduino Uno Code:

//like share and subscribe

#includeServo myservo;
int pos = 0;
int lightPin = A0;

Servo myservo1;
int pos1 = 0;
int lightPin1 = A2;

void setup() {

void loop() {
int lightLevel =analogRead(lightPin);
int lightLevel1 =analogRead(lightPin1);
lightLevel = map(lightLevel, 0, 1023, 0, 179);
lightLevel1 = map(lightLevel1, 0, 1023, 0, 179);
pos = constrain(lightLevel, 0, 179);
pos1 = constrain(lightLevel1, 0, 179);




Leave a Reply