Sunday, September 13, 2015

Custom Stairway + Hallway Lighting Project - Part 1

A while back (last year) I considered the thought of adding some custom lighting to the stairway and hallways of the house.  I looked around online and there were really 2 options you could go with.  The first is an off the shelf solution like this: http://www.amazon.com/Thefancy-Wireless-Wardrobe-Hallway-Stairway/dp/B00NFEQYVC/ref=sr_1_3?ie=UTF8&qid=1442177711&sr=8-3&keywords=infrared+light+stairway .  These seem like they'd probably work, but I'm not really a fan of any of the kinds I found in terms of aesthetics.  I also don't like having these as battery powered.

The 2nd option was to buy something more expensive that could be hard wired, but while those solutions looked great, they were super costly and most of them still were just simple on/off kinds of deals. (Though to be fair, I'm sure when this project is all said and done it'll still have costed just as much, but at least I'll have had the chance to learn and tinker in the process.

So I'm going for a third option, which is to design and build my own lighting system based around an Arduino clone (specifically an Arduino Uno R3 clone from SparkFun called RedBoard).  I have a basic understanding of electricity from High School Physics and from my dad who is a mechanical/electrical engineer. (or more specifically a field engineer for GE Medical Systems.  He works on X-Ray Machines, CT, PET, PET/CT, you get the picture.)  That said it's been quite a few years since HS and this was going to be a little more than I've ever tried to accomplish.

My first task before anything else was to get up to speed on the basics again.  This entailed a great deal of reading and also watching of videos.  I found the "According to Pete" series on SparkFun was particularly valuable.  Of course just trying stuff is a great teacher too.


My first circuit was basically akin to "hello world" in programming.  Simple powering of an LED using PWM based on the light level of the room.  Darker room = more light.  This was mostly just to make sure the board worked and that I wasn't a total failure in terms of basic wiring. (yay to both as it worked).

During my reading/watching/playing I was also working through how exactly I wanted to set this whole thing up.  I decided that I'd have 3 zones of lights.  One for the stairs, one for the hall between the guest room, guest bath, and Girl-Child's room and one between the Master and the stairs.  In each zone there would be a total of 4 sensors. Two light sensors and two motion sensors (one at each end).  For the light sensors I'm using a basic CdS photo resistor.  For motion I was originally thinking of  PIR (Passive Infrared) sensor.  After playing with it though I found it to be too broad in sensing motion.  I ordered an active IR range finder that I'm going to be testing soon.  Each pair of sensors will be at one end of the zone so that as you cross into the zone that zone will turn on.  This will work in most places I think, but there is one spot where I'm considering a Sonic Range finder instead.  The photo sensor will limit the lights from turning on if it is already light and the movement will limit them to only when folks are around.  That said, the code I have allows for alot more than 4 sensors if I wanted (though the board is nearly full as you'll see).  So all told I'll have 12 sensors to keep track of.

For the lights themselves I am going to be using PCB Mounted LED strips.  These strips accept 12vDC.  I've calculated that a string for the stairs will be about 1.4 Amps.  (and another 1.4 for the hallway and probably around half that for the master hall).  I needed a good way to switch them on and ended up settling for a N-Channel MOSFET (which can do 60v with 30A, so I think I've got the headroom).



So I strung up a couple of the LED bars and the MOSFET to test how well it worked and what do you know, it did.  Yay...  You might ask yourself what is up with the giant pile of speaker wire.  Mostly that was to make sure that 100' of 16ga wire wouldn't drop the voltages too much on the light strip.  I'm figuring it'll be about 60' total for the stairs.

I spent this afternoon designing the actual schematics for the box (I took last week to draw up everything to see how it'd physically layout.  Those are hand drawn though, so no picture for now).

I think this is close to the final layout of the board.





At this point I'm waiting on the Active IR sensor (should have been here Friday, but got lost in the USPS system.  They found it and I should get it Tuesday).  Once I have that and can confirm it works as expected I'll hook up the 2 bars I have now and the 2 sensors I have now and test run it on the bottom part of the stairs for a few days.  If that all works then it'll be time to order the rest of the components and start building it out in earnest.

No comments:

Post a Comment