LDR MODULE

TINKS029

  1. A Light dependent resistor (LDR) is a device with variable resistance whose resistance falls with increase in the intensity of light.
  2. LDR module provides a digital as well as analog value.
Features:-
  1. Variation of LDR Resistance with Variation in Light Intensity.
  2. Light Intensity vs. LDR Resistance.
  3. Light Dependent Resistor Circuit.
  4. 5V DC operating voltage.
  5. I/O pins are 5V and 3.3V compliant.
Applications:-
  1. LDR used for automatic contrast and brightness control in television receivers.
  2. LDR is used in the infrared
  3. LDR is used in optical coding.
  4. Used in light-activated control circuits.
  5. Used in light failure alarm circuits and used in light meter.

    


int ldr = A0;
void setup() //define pinmode
{
Serial.begin(9600);
pinMode(ldr, INPUT);
}
void loop() //write main code
{
int ldrValue = analogRead(ldr);
if (ldrValue >= 800) {
Serial.print("Its DARKNESS, Turn on the LIGHT : ");
Serial.println(ldrValue);
} else {
Serial.print("Its BRIGHTNESS, Turn off the LIGHT : ");
Serial.println(ldrValue);
}
}