Arduino Night Watchman Light

by VasooV in Circuits > Arduino

1707 Views, 0 Favorites, 0 Comments

Arduino Night Watchman Light

sleeping.jpg

When you leave your house for extended periods, you may want to make it seem as if someone is at home switching lights on and off in the evening. Contrary to a preset scheduled timer (or one which sleeps) and can easily be detected from outside, this DIY Arduino based timer uses light intensity to detect low light levels and randomly turn lights on and off all through the night making it seem as if there was someone present in the house.

Supplies

Disclaimer: I receive commissions from purchases related to the links on this page.

1x Electrolytic Capacitor capacitance 100µF; voltage 16V

1x Keyes Relay

1x Arduino Mega 2560 (Rev3)

1x KY-018 Photoresistor

All the components can be found on BangGood by clicking on this link

Arduino Night Watchman - Wiring Diagram

LightGuard_bb.png

Arduino Night Watchman - Code

The code was written using the standard Arduino IDE and contains comments for each section.

You can also get it from my GitHub

Arduino Night Watchman Code

How does it work ?

//Sample the ambient light

//Only operate at night

//Create a schedule to turn on the lights randomly between 45 - 90 minutes for a period of 2 - 7 minutes

//Repeat untill morning

Downloads

Arduino Night Watchman - the Actual Physical Setup

20201101_161646.jpg

Could be cleaner, but it does the job.

Happy building :)