Skip to content

kenkl/MotionNightlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

##MotionNightlight

An Arduino-based motion-activated nightlight

Going to the bathroom at 2am doesn't have to be a retina-searing affair. With lighting in the red-end of the visible spectrum, night-vision is preserved (for the trip back to bed), and sleep-cycle is less disturbed (I consistently fall back to sleep within five minutes). This is an Arduino-based solution that uses a passive infrared sensor to detect motion and turn on a bank of LEDs to light the bathroom for a period of time. The "lights on" period is extended while the lights are on and additional motion is detected. The lights will go out if no motion is detected after an adjustible (in code) period.

The 1.0.0 version of this project utilizes an Adafruit DC Boarduino mounted on a perfboard. It "listens" for motion via PIR to switch on a bank of LEDs connnected via a TIP120 Darlington transistor. This is what the current version of the project looks like. The PIR is connected via the CAT6 cable shown, and effectively lights up the entire bathroom when activated.

A Fritzing diagram of the circuit is included. There isn't a Fritzing part for the DC Boarduino, so I used the USB Boarduino (same layout) instead. Of note there is that Collector on the TP120 must be connected to a source with sufficient current to light the LEDs connected to the Emitter. For this version, I'm using 25 bright red LEDs which are rated for 20mA of current draw - 500mA for the LEDs alone. The output of the 7805 regulator is exposed on the DC Boarduino at Vin, providing 1-1.5A, which is sufficient.

Inspired by this thread, v101 now includes:

  • Ambient light sensor. Why switch on the LEDs if the room is already lit?
  • Red laser illuminating the toilet bowl. Target acquired!

I might revisit this at some point, but for now, full Arduino/ATMEGA328-based devices are so cheap, I'm not sure if I can be arsed to bother with it:

  • Instead of ATmega328, this should be possible to construct using an ATtiny85 with minimal code changes.

Also, as discussed in the reddit thread, it is possible to build a device like this with discreet components if one is so inclined. One of the posts details using a diode, a capacitor, and a high-ohm resistor/potentiometer to do this. If one is so inclined.

Finally, just for fun...

alt text

About

An Arduino-based motion-activated nightlight

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%