This project is a simple light detection system built using an Arduino Uno and Light Dependent Resistors (LDRs). The system detects the intensity of ambient light and responds accordingly, making it suitable for applications like automatic lighting, light alarms, or smart home systems.
The LDRs change resistance based on the amount of light falling on them. This change is read as an analog voltage by the Arduino. Based on the value:
int ldr;
void setup()
{
Serial.begin(9600);
pinMode(5,OUTPUT);
}
void loop()
{
ldr=analogRead(A0);
Serial.print("LDR Value=");
Serial.println(ldr);
delay(400);
if(ldr<30)
{
digitalWrite(5,HIGH);
}
else
{
digitalWrite(5,LOW);
}
}
WhatsApp us