Last chance to enter The Hackaday Prize.

Automatic Closet Lightswitch

closet-door-switch-box

[Dillon] wrote in to tell us about his latest project, an automatic light switch for a the hallway closet in his house. Although this project could probably be done very simply, [Dillon] accomplished everything in a way that actually looks professionally done and has some neat features. Check out his site for more pictures of the build.

Not that we at [HAD] mind a bit of messy wiring, but if it’s going inside a house, neater is always better. On the other hand, this project took nearly a year to go from idea to implementation, so please keep submitting your spaghetti-wired projects.  We understand.

As an electrical engineering major, [Dillon] didn’t skimp on basic electrical components, and has schematics available on his site. A MSP430 microcontroller provides the “brains” for everything, turning the light off after 5 minutes if the doors are not shut. Be sure to check out his video overview after the break with footage of it in action.

Comments

  1. Laszlo says:

    I like the Ikea stock clost light better. It uses a proximity sensor on the light itself, and absolutely no cabling required between the sensor and the light.

    It is called ‘ikea KOMPLEMENT light strip’, more info here:
    http://www.ikea.com/us/en/catalog/products/90163846/

    I would like to see a hack, which adds to this an automatic delay switch off function, like after 20 minutes or so.

  2. vonskippy says:

    Rube Goldberg would be oh so proud.

    Nothing like taking a VERY simple switch and timer and making it into a huge over complicated micro controller based frankenswitch.

    What are they teaching EE’s these days (or should I say what AREN’T they teaching them)?

    • Matt says:

      Can you do this whole project with a mechanical switch and a 555 timer? Sure. But why? There’s nothing wrong with using a microcontroller to do something simple.

      An MSP430 costs <$1.50 in quantities of 1 at Digikey. Microcontrollers are easy to program and it's fast to get something working. You can solve a lot of problems without placing an order if you have a few spare microcontrollers sitting around.

      There's nothing wrong with microcontrollers, and there's nothing wrong with the engineers using them. This is a good project; I suggest that there's something wrong with the engineers who think otherwise.

      • ColdTurkey says:

        I agree with you in that there is nothing wrong with using a micro to do something simple, it just seem that this is so simple that it seems almost unnecessary (like using a micro to turn on an LED). I just feel that there is nothing useful to learn in doing this.

        • mb says:

          Well, maybe there’s nothing for you to learn with this project. Of course the guy who built it isn’t you, so he did learn something. Don’t think of it as a waste of time, think of it as a practical experiment for what he’s learning in class. Maybe what he learned was you’re right, that it was overkill for this application.

    • gabriel says:

      …it’s still an engineering course, so what would you expect?

      of course i could argue he’s still missing a motion detector. Or It could be much more efficient and use two laser or ultrasound switches to detect people going in and out and turning the light only when there were somebody inside. …or maybe a floor pressure plate…

    • allan says:

      Your 555 probably needs more power than a properly programmed MSP430 ;)
      granted, with his PSU that probably isn’t that important.

  3. ColdTurkey says:

    I like the end result, simple and functional. I do agree with vonskippy though, this is MASSIVELY over-engineered. Personally, I would have probably used a 555 in monostable to provide the 5min timer rather than waste an entire avr, Also I think it would have been cool (and pointless) to add some sort of dimmer so the more open the door is the brighter the light.

    • andres says:

      it’s not an avr. it’s an msp430.

    • ColdTurkey says:

      Thinking about it, wasn’t there a post on here recently using a 555 as an auto-off?

    • Garbz says:

      Really I’m getting sick of these “over engineered” comments. Quite often the results are actually cheaper, simpler with less component counts, use lower power, and far more configurable by reaching for a simple microcontroller.

      Just think about that section of the datasheet next time you make a project. A NE555 uses 2-3mA, an AVR with a timercounter and interrupt enabled uses an order of magnitude less.

      • ColdTurkey says:

        If I were to use an msp for this incredibly simple function then I would need to splash out approx $1.50 for the part, buy a programmer, plus learn how to program it, AND add passive components. If I were to use a 555 timer, I would spend about $0.15(if I didn’t use one of the many I already have), use 3 or 4 passive components, have it set up the same time or less whilst excercising my knowledge and experience of digital logic (something incredibly valuable to everyone). Really I’m getting sick of these lazy people who think the simplest thing should be done with a microcontroller ‘coz it’s ‘easier’.

  4. ColdTurkey says:

    sorry I meant msp, not avr. bad habit

  5. $25 motion sensing thing for light sockets. Granted it will always be a timed shut off since a door jam switch would probably push open a sliding closet door.

  6. donnie darko says:

    Unless you really really like leaving your closet door open, you can for the cost of wire and a small microswitch wire the light to go out when the door is shut. Simple and requires only 2 pieces of wire and 1 microswitch. Oh and a screw or two.

  7. Petiepooo says:

    I’d be concerned about two things: resale and insurance. Home inspectors get really nervous whenever the homeowner touches the home’s electrical system. You’d better be prepared to rip that all out and put the original gear back in when you get ready to sell the unit.

    Also, if your home ever catches on fire, be prepared to definitively prove to your insurance company that it wasn’t due to your non-UL approved gear. If your mods caused the fire, or even perhaps if they believe it may have, you might not be receiving an insurance check.

    I’m looking at doing some similar things regarding home automation, etc. But to keep everything UL approved, I’m looking at Insteon for any of the switches and wallplates. With a USB dongle and a RPi, you can add any sensors you want, but they need not be UL approved, as the approval requirements end when line voltage does; at the RPi power supply.

    • Petiepooo says:

      Oh, the drawback is Insteon is MUCH more expensive than this elegant, low-cost hack. A KeypadLinc Timer and an I/O Linc Sensor kit will run you about 110 USD. But between those two items, I believe you could replicate 100% of this hack’s functionality.

    • Taylorian says:

      The answer to your proposed insurance dilemma is in your post…use a UL approved power source and and a UL approved relay…Problem Solved….that is all

      • Petiepooo says:

        Are you a certified electrician or home inspector? Can you provide citations for your assertion?

        I’m not, but I think it’s more than just using a UL approved relay. There are requirements concerning separation of voltage levels and such. The whole system that uses the relay would likely have to be UL approved, not just built with UL components.

        That’s where X10, Insteon, and the like come in; they’ve gone through the underwriting process with the completed device.

  8. Gigawatts says:

    My roommate and I came up with this several years back as a similar solution. Fridge door switch + light socket.

    http://mehax.blogspot.com/2010/10/worlds-easiest-hack.html

  9. biozz says:

    well D2 and D4 are backwards but still nice job!

  10. Mike says:

    If he were able to modify the closet and household electrical setup more directly he should have gone with this instead. http://amzn.com/B0007NLVMQ

    But still an awesome idea.

  11. ino says:

    The fuse is in the wrong place.
    It should protect the transformer. If the secondary of the transformer fails, you could potentially have a fire on your hands.
    CFL doesn’t need fuse as it’s already protected by the fuse on the main electrical panel.

  12. Sven says:

    I really don’t see a problem with using a µC for timing, it makes it very simple to set up different times and changing the circuit function after putting away the soldering iron. I do however not like the enormously huge wires used for the sensors, he could have gotten away with something like a 3-way strip of ribbon cable or a thin headphone extension wire, it would have let him drill a 3mm hole in the ceiling instead of the enormous hole that’s there now.

    Also there is nothing limiting the current to the sensors, if something goes wrong the sensor boards could easily heat up enough to cause a fire, there should be fuses or at least resistors on the power lines to those boards.

    Also no consideration of EMI on those long wires.

  13. Well, my bedroom closet automatic light switch went from concept to finished in about 3 hours, including drive time. I got some of that LED rope light and lined the inside of the doorway into the closet so it would illuminate fairly evenly from the front of both sides and across the top, I plugged that into an outdoor motion sensor floodlight fixture I had installed one of those screw-in-base-to-two-prong-outlet adapters, and I wired that to an extension cord that I plugged in to an outlet I had located inside the closet. The motion sensor was mounted above the doorway inside the closet pointing down so all one needs to do is waive their hand inside the closet and the rope light (which draws ridiculously low current, provides sufficient light output and doesn’t present a fire risk from heat) comes on. The turn-off timer was set so that it turns off after a short delay when no motion is sensed. I adjusted it so that if my wife or I are putting clothes away it mostly stays on and you rarely have to re-activate the light intentionally. It is angled just so that traffic outside of the boundary of the closet does not activate the light and we both got instantly accustomed to it. It just works.

    Not as elegant as the one featured here, but it is all inside the closet and nothing is visible from the outside unless, say, a clip comes off the rope light or something and it hangs in view.

  14. jpa says:

    Seriously Hackaday? “Looks professionally done”?

    http://3.bp.blogspot.com/-e4kzgYNEiBM/T_O20jVvClI/AAAAAAAAKL8/__Dy_DMWKB0/s1600/19C21D78-1448-4EA9-B47F-22FB9079CE59.JPG

    Paint for isolating mains voltage? On a protoboard without any copper removed for proper isolation gaps? I know hacks are hacks, but this is a serious fire and electrical safety risk.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 91,115 other followers