LDR
(Light Dependent Resistor)

Description:
A photoresistor or LDR (Light Dependent Resistor), as the name suggests will change it resistance based on the light around it. That is when the resistor is placed in a dark room it will have a resistance of few Mega ohms and as we gradually impose light over the sensor its resistor decrease from Mega Ohms to few Ohms.


Working Principle:
A light dependent resistor works on the principle of photo conductivity. Photo conductivity is an optical phenomenon in which the materials conductivity is increased when light is absorbed by the material. When light falls i.e. when the photons fall on the device, the electrons in the valence band of the semiconductor material are excited to the conduction band. These photons in the incident light should have energy greater than the band gap of the semiconductor material to make the electrons jump from the valence band to the conduction band. Hence when light having enough energy strikes on the device, more and more electrons are excited to the conduction band which results in large number of charge carriers. The result of this process is more and more current starts flowing through the device when the circuit is closed and hence it is said that the resistance of the device has been decreased. This is the most common working principle of LDR.
Features:
- Quick Response
- Reliable Performance
- Good Characteristic of Spectrum
Specification:
Resistance : 400ohm to 400Kohm
Normal resistance variation: 1Kohm to 10Kohm (in the robots which i used for line following for identifying black and white strips)
Sensitivity: about 3msec(Sensitivity is defined as the time taken for output to change when input changes, i got this reading by verifying with ADC interfaced with parallel port, sensitivity of LDR’s is in milliseconds. This is the best sensitivity obtained to me).
Link to datasheet:
Applications:
- Automatic Street Light.
- Detect day or night.
- Automatic head light dimmer.
- Automatic bedroom light.
Advantages:
- LDR’s are cheap and are readily available in many sizes and shapes.
- Practical LDRs are available in a variety of sizes and package styles, the most popular size having a face diameter of roughly 10 mm.
- They need very small power and voltage for its operation.
Disadvantages:
Highly inaccurate with a response time of about tens or hundreds of milliseconds.
Connection With Arduino:


Pin1: One of the Pin of LDR would be connected to 5v and the analog pin of arduino.
Pin2: remaining Pin of LDR would be connected to ground of the circuit.
Arduino Code:
int sensorPin = A0; // select the input pin for LDR
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600); //sets serial port for communication
}
void loop() {
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); //prints the values coming from the sensor on the screen
delay(100);
}
Reference:
https://www.electrical4u.com/light-dependent-resistor-ldr-working-principle-of-ldr/
http://www.geocities.ws/njbibin/robo17b.html
https://maker.pro/arduino/tutorial/how-to-use-an-ldr-sensor-with-arduino