Interface LDR with Arduino
ARDUINO

LDR


Description

An LDR (Light Dependent Resistor) is a type of sensor that changes its resistance based on the amount of light falling on it. It is also commonly referred to as a photoresistor.LDRs can be used in light-sensitive circuits to activate or deactivate devices based on ambient light conditions. For example, they can be employed in automatic streetlights that turn on at dusk and turn off at dawn.


Sensor Details
  • Maximum power dissipation is 200mW
  • The maximum voltage at 0 lux is 200V
  • The peak wavelength is 600nm
  • Minimum resistance at 10lux is 1.8kΩ
  • Maximum .resistance at 10lux is 4.5kΩ
  • Typical resistance at100lux is 0.7kΩ
  • Dark resistance after 1 sec is 0.03MΩ
  • Dark resistance after 5 sec is 0.25MΩ

Wiring Details

LDR sensor positive point to Arduino 5V

LDR sensor negetive point to Arduino A3

1000k Resistors positive point to arduino A3

1000k Resistor negative point to Arduino Gnd

Bulb positive point to Arduino 12

Bulb negetive point to Arduino Gnd


Circuit Image
Circuit Code
                                        
                                            
//start coding
const int Bulb = 12;
int ADC_value;
void setup() {
pinMode(Bulb, OUTPUT);
Serial.begin(9600);
}
void loop() {
ADC_value = analogRead(A3);
Serial.println(ADC_value);
delay(1000);
if (analogRead(A3) > 100) {
digitalWrite(Bulb, HIGH);
}
else{
digitalWrite(Bulb, LOW);
}
}