How To Make DIY Automatic Night light using Arduino & LDR by WTC Zone
Creating an Automatic Night Light using an LDR (Light Dependent Resistor Module), LED, and Arduino is a straightforward project. The LED will turn on automatically when it’s dark and turn off when there’s sufficient light, providing a hands-free solution for low-light conditions.
Parts Required
- Arduino Uno
- LDR Module (with VCC, GND, and OUT pins)
- LED
- 220Ω Resistor (to limit current for the LED)
- Breadboard and Jumper Wires
Circuit Connections
LDR Module:
- VCC → 5V on Arduino.
- GND → GND on Arduino.
- OUT → Digital Pin 2 on Arduino (this will output HIGH in light and LOW in darkness).
LED Circuit:
- Anode (long leg) of LED → Digital Pin 9 on Arduino.
- Cathode (short leg) of LED → 220Ω Resistor → GND on Arduino.
Video Link: - Click Here For Video
How To Make DIY Automatic Night light using Arduino & LDR by WTC Zone simple Circuit: -
Arduino IDE Program
Code for Automatic Night Light using LDR Module
This code reads the digital signal from the LDR module on Pin 2. When it’s dark, the module outputs LOW to Pin 2, triggering the LED to turn on.
-----------------------------------------------------------------------------------------------------------------------------Explanation of the Code
- LDR Module Output Reading:
int ldrState = digitalRead(ldrPin);
reads the state of the LDR module. The module will output LOW when it’s dark, and HIGH when it’s light. - LED Control:
- If
ldrState
is LOW (dark), the LED is turned on. - If
ldrState
is HIGH (light), the LED is turned off.
- If
- Serial Monitor: Optional, but helpful for confirming the module’s state changes as lighting conditions vary.
How the Project Works
When the surrounding area becomes dark, the LDR module outputs LOW on the OUT pin, which the Arduino reads to turn on the LED. In bright conditions, the module outputs HIGH, and the Arduino turns off the LED, making it an automatic night light. This project is straightforward to adjust for different brightness levels by replacing the LDR module if necessary.
- LDR Module Output Reading:
Circuit Simulation:
You can use Tinkercad to simulate this project. Let me know if you need more details or help setting up.
Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #UltrasonicSensor #HeightMeasurement #TechDIY #WeTechCreators
0 Comments