A Smart Street Light System Using ESP32, LDR, and IR Sensors Automatically Controls Lighting and Saves Energy by Detecting Motion.
by contactsumanbelel in Circuits > Arduino
125 Views, 1 Favorites, 0 Comments
A Smart Street Light System Using ESP32, LDR, and IR Sensors Automatically Controls Lighting and Saves Energy by Detecting Motion.
The Smart Street Light System is an energy-efficient IoT project using an ESP32, LDR, and IR motion sensor. The LDR automatically switches the lights ON at dusk and OFF during daylight, while the PIR sensor increases brightness only when pedestrians or vehicles are detected, reducing unnecessary power consumption. To further conserve energy and improve public health, the street lights automatically dim at 9:00 PM and change to red illumination, which minimizes light pollution and reduces sleep disturbances caused by blue-rich white light. The ESP32 enables intelligent control and can support remote monitoring through Wi-Fi. By combining adaptive lighting, motion-based operation, and health-conscious nighttime illumination, the system lowers electricity consumption, decreases maintenance costs, and promotes sustainable and smart urban infrastructure.
Supplies
- ESP32
- IR Sensor
- LDR Sensor
- RTC Module
- BC547 Transistor
- LCD Display with I2C Module
- RGB LED
- Resiors
Features of the System
The proposed system includes several smart features:
- Automatic day and night detection using an LDR.
- Motion-based brightness control using a IR Proximity sensor.
- Energy-saving dim mode when no motion is detected.
- Automatic transition to dim red lighting at 9:00 PM.
- Reduced light pollution and improved nighttime comfort.
Working Principle
The LDR continuously measures the ambient light level. During the daytime, the ESP32 keeps all LEDs turned off. When darkness is detected, the system enters night mode and turns on the street light at a low brightness level. The PIR sensor then monitors the surrounding area for movement. If a person or vehicle is detected, the ESP32 increases the brightness of the white LED to provide better visibility. After the motion disappears, the light returns to a dim state to save energy. At 9:00 PM, the controller automatically switches the system into a low-intensity red lighting mode, reducing glare, light pollution, and potential sleep disturbances.
Circuit Connections
The LDR is connected as a voltage divider and its output is connected to an analog pin of the ESP32. The IR sensor output is connected to a digital input pin. The white and red LEDs are controlled using separate GPIO pins through BC547 transistor. The ESP32 processes the sensor data and controls the LEDs according to the programmed logic.
Hardware Assembly
First, assemble the circuit on a breadboard and verify all connections. After successful testing, the circuit can be transferred to a zero PCB for a more reliable and permanent installation. Mount the sensors and LEDs properly to ensure accurate motion detection and effective illumination.
Software Development
The ESP32 program performs the following tasks:
- Reads the LDR value.
- Determines day or night conditions.
- Monitors the PIR sensor.
- Controls LED brightness according to motion detection.
- Checks the current time and activates red dim mode after 9:00 PM.
Downloads
Testing and Results
The prototype was tested under different conditions. During daylight, all lights remained off. At night, the system operated in low-power mode and increased brightness only when motion was detected. After 9:00 PM, the system successfully switched to dim red lighting. The results demonstrated reduced energy consumption and improved nighttime lighting conditions.
Conclusion
The Smart Street Light System demonstrates an effective approach to reducing energy consumption while improving environmental sustainability and human comfort. By combining motion sensing, automatic dimming, and sleep-friendly red illumination, the system offers a practical solution for future smart city lighting applications