Saturday, August 29, 2015

Arduino Controlled Automatic LED Pantry Lighting

We recently started a pantry project, and having just finished the new barn doors we needed to install the shelving and Arduino controlled lighting.

Parts List:
1x Arduino (I used a Nano I had lying around)
1x relay
1x reed switch
3x LED lighting
1x 1x8 DC splitter
1x 10pack DC pigtails
1x 10 amp power supply
1x 5pack 4' DC extensions
1x project box


I built an Arduino controller with a reed switch to know when the door are open/closed, and a relay to turn the lights on and off based on the reed switch  Testing the set up:

And the final set up wired in place:  
  • The wire coming out of the right of the box on the far right is the output from the power supply
  • The wire coming out of the right (middle) of the box is the relay-controlled power supply output.  This feeds a 1->8 DC splitter, which feeds the lights.
  • The wire coming out of the left side of the box goes to the reed switch which tells the arduino when the doors are open or closed.  


I wrote a 10 line sketch that checks the state of the reed switch and turns the relay on or off based on the state, pausing for 100ms between loops.  It doesn't even remember the state, it just sets the output pin to the relay either HIGH or LOW 10 times/second.

Now when you open the doors the lights turn on, and when you close them they turn off.  No light switch! :)

Here's what the lighting looks like in the pantry.
Notes:

  1. Only one door is on the track right now, and we're waiting for the new flooring before installing the lower portion of the pantry:
  2. the 3rd shelf from the top (second from the bottom) is slightly more yellow than the other 3 shelves.  All 3 reels of lighting were labeled the same warm white but one is definitely not the same color.  I ordered another reel and will replace it when it gets here.


Related posts:

No comments:

Post a Comment