Hacker News new | ask | show | jobs
by failedartifact 2918 days ago
I automated my bedroom lights in a house share. I have 3 lights: the main cieling and 2 more which are a floor standing and a desk light. For sensors, I have a magnet door switch and a PIR sensor to detect direction of travel (enterring or leaving the room) and a photocel sensor to detect day/night).

The main lihht turns on for 1.5 minutes, then the other 2 switch take over for 'chilled' lighting. If i leave, the lights go on a timer for 10 minutes. If the PIR doesnt pick up movement, or i have not returned, the lights go off. When going to sleep, i have an acarde button as a master switch to either turn on chilled lights or off.

The lights are controlled with 5v relay switches. No intrusive adjustment were made to the main light, as i bought male / female bayonet socket to wire/ wire to bayonet socket adapters.

An Arduino is controlling the whole thing, and the wire used is cheap RGB 4 pin wire off ebay which is i belive 24gauge?

Still a bit buggy after refactoring, but ill get there eventually: https://github.com/alfanhui/automated_home_lights