Automatic Night Light

Requires ,

This project creates an automatic night light that activates an LED when the ambient light level falls below a set threshold.

The system uses a photoresistor to detect ambient light levels and compares these readings against a predefined threshold value (500). When darkness is detected, the LED turns on automatically. The microcontroller continuously reads the light sensor, displays values via Serial communication, and updates the LED state accordingly. The 100ms delay between readings provides stability by preventing the system from reacting to momentary light fluctuations while maintaining responsive operation.

Parts List

  • Arduino board
  • Photoresistor (light-dependent resistor)
  • LED
  • 220Ω resistor (for LED)
  • 10kΩ resistor (for photoresistor voltage divider)
  • Breadboard
  • Jumper wires

Assembly Instructions

  1. Connect the photoresistor to analog pin A0:
    • Attach one leg of the photoresistor to 5V
    • Connect the other leg to both the 10kΩ resistor and analog pin A0
    • Connect the other end of the 10kΩ resistor to ground
  2. Connect the LED to digital pin 7:
    • Connect the anode (longer leg) of the LED to digital pin 7
    • Connect the cathode (shorter leg) to the 220Ω resistor
    • Connect the other end of the resistor to ground
  3. Double-check all connections before powering the board