Smart Street lights are needed as they improve energy efficiency, enhance public safety, reduce operational costs, and provide better lighting control. They can automatically adjust brightness based on activity and weather conditions
In this experiment we are going to consider a prototype of the smart street light using LDR. As soon as the light reaching the LDR falls below a certain level, the Arduino microcontroller automatically turns ON a couple of LEDs. Based on the value the microcontroller reads, the program will subsequently set the LEDs to HIGH or LOW. This simulates how to turn ON and OFF the light on the street at night.
Objectives #
The aim of this experiment is to help a leaner:
- To begin with, understand the operation of the Light Dependent Resistor (LDR) in order to effectively control the street light.
- To understand the working principle of street lights.
- Make a prototype and design of an automatic street light.
Material to Use #
Circuit diagram #
Figure: Schematic diagram
Figure: Components used to make connection on the board
Arduino Code #
Code knowledge #
The loop() function runs continuously and reads the light level from the LDR.
ldrStatus: Holds the analog reading from the LDR, which ranges from 0 (dark) to 1023 (bright).
When the LDR detects a light level of 200 or lower (considered dark), the system then prints the message “light ON” on the LCD. It then turns on each LED (connected to pins 10 to 5) one after the other using digitalWrite(pin, HIGH), with a one-second delay (delay(1000)) between each. This creates a sequential lighting effect.
If the light level is greater than or equal to 100, the system displays the message “light OFF” on the LCD and turns off all LEDs by setting digitalWrite(pin, LOW). Meanwhile, the system continuously monitors the light level from the LDR and therefore updates the light status accordingly.
Result #
Visual Output:
In the dark, the system lights up the LEDs one by one and displays “light ON” on the LCD.