LDR-Based Light Detection System
Using Arduino – Project

Description

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.

Working Principle:

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:

  • The system can trigger an LED or buzzer when light levels fall below or rise above a certain threshold.
  • The readings can also be displayed on an LCD or serial monitor for monitoring.

Main Components:

  • Arduino Uno – Processes the input from the sensors.
  • LDR Sensors–Measure the intensity of light in the environment.
  • Resistors – Used to form voltage dividers with the LDRs.
  • Output Devices – (Optional) such as LEDs, buzzers, or displays to indicate light levels.
  • Power Supply – Provides power to the Arduino.

Circuit Diagram:

Coding:

Arduino LDR Code
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);
  }
}
Code copied to clipboard!