Remote Servo-controlled Lightswitch

remoteServoLightSwitch

We frequently get home automation tips, many of which have simple circuit-based on/off control for lights. [Paulo Borges] has created something quite different, however, with his in-the-wall servo-controlled light switch. This build forgoes the need of any relay to switch mains power, and because it’s physically flipping your switch, provides a distinct advantage over other builds that require a phone or tablet interface: you can use your switches as you normally would.

[Paulo] picked up a rocker-type switch at the local hardware store and carefully pried off the large, flat switch plate to notch out a small hole at its fulcrum. He then carefully shaped a piece of 12 gauge wire to provide a pivot point for the servo. His choice to use wire here seems to be entirely to provide a sturdy yet bendable component that functions mechanically rather than electrically. A small 9G servo fits to the back of the switch’s housing, and the servo’s arm connects up to the previously attached 12 gauge wire. He pieced together the remote control feature with an RF link kit with an inexpensive 433mhz Code duplicator from eBay.

[Paulo] explains that his Instructable is simply an overview rather than a step-by-step guide, so if you’re eager to reproduce this hack you’ll have to work out the code and the remote control portion yourself. He also acknowledges the biggest remaining hurdle: finding space in the wall to shove all the microcontroller guts. Check out a couple of videos of the switch after the break, and remember, there’s always the option of doing away with all light switches.

73 thoughts on “Remote Servo-controlled Lightswitch

      1. The range of movement of the servo is greater than the range of the switch.
        Modify the servo horn so that the pole on the switch can’t touch it while the servo is centered, but the servo can still flip the switch as it moves near the end of it’s travel.

      2. Some of the larger (for offices) multi-function printers have a mechanical switch that has a solenoid in it as well, the printer can do a “hard” off on it’s own.
        So somebody has to manufacture this kind of switch in not-so-small series…

      1. You could do that anyway! Either include, in your relay circuit, a couple of push buttons for a manual override, or wire it up DPDT the way landing lights are, the ones where either of 2 switches can control the lights.

        What he’s essentially done here is re-invent the relay, only more expensive, less reliable, and more dangerous.

        1. Exactly my thoughts when I read the title. But then I thought that you need power to keep the relay “closed”, where as this contraption can sleep after getting the commands to power on (or off) the light. I think that this is easier to set up since you don’t have to physically alter the wiring of the light switch, and can be easily removed and replaced.

          1. You could use a latching relay, which only requires power to change state, not hold it. Instead of a spring, it has magnets to hold the reed in the last set position. Two coils are used to set the reed to either position, which exceed the holding force of the magnets when powered.

            Or perhaps use a single solenoid to operate a latching push button, the kind you push once for on, and twice for off. The X10 appliance module has a custom mechanism which seems to operate using something like this technique.

          2. There’s plenty of power in a light switch, and they’re not exactly difficult to wire up. 2 wires, or 3 if you wanna do changeover / landing light mode. If you can wire a plug, you can wire a light switch, must be well within this dude’s abilities.

          3. I concur with Chris C. This project is a Rube Goldberg imitation of a latching relay. You can get a real one one in quantities of one from Digikey for <$7 that can handle 16A and can be switched with 5V. No power required unless switching. As for the manual override, you can use whatever you want– use a conventional light switch as an input to the micro controller (one side grounded and the other with a pull-up resistor. But that depends on the microcontroller working. The more robust method would be to wire the SPDT relay as a conventional "traveler" — two switches that control one light, except that one of the three way switches is replaced by the relay.

          4. Peter, could you link me to this part you have in mind? i looked on mouse i think but didnt find anything cheaper then $20 for one latching relay with the correct amperage,

            as for using a solenoid, i looked into doing this aswell, but could not find a cost effective push pull type solenoid that was small enough to fit behind the switch, AND be able to be fired from 5v. again if you have seen one please send me a link.

            im going to look making a compressed traveler circuit with a latching relay, but ill probably have to put in another box to hide that. considering id still be using one of those large toggle switches in the current box.

            ive gotten alot of criticism for this, i just wanted to show a way i found to switch 110v semi safely, utilizing existing wiring, and not getting to fancy :P

            seriously though, those links would be appreciated :)

          5. [Paulo], in case Peter doesn’t get back to you, I found an example for you. Although I’m not sure what amperage you actually need, 8A should be more than sufficient:

            http://www.digikey.com/product-detail/en/DSP1A-L2-DC5V/255-1620-ND/570757

            I’ve found it pays to shop around beyond your main suppliers for the “oddball” parts. You can cut the price in half, and double the amperage, with Ebay Item #151128968924 for example. Also check surplus dealers. All Electronics, Electronics Goldmine, and BG Micro are my top three, and I have picked up some nice latching relays from them a few years ago at around $3. They might just have a reasonably sized push-pull solenoid as well; or two small and cheap enough you could mechanically link together. You never know with surplus. ;)

            And don’t take the criticism too hard. You did in fact come up with a novel solution, and shared it. I say that counts for something, even if the solution might need some refinement.

          6. thanks for the link, i would like to keep it at 15amp because well, the switch is 15a and im not an electrician, i dont know how much amperage a fan draws (although from experience with my in ceiling speakers poping when i flick that on and off id say its more then a light bulb lol) my biggest qualm with using relays is they cannot be mechanically over ridden when things do go wrong, (like the servo dies or w.e) i really liked this design because it augments the existing functionality of a lightswitch. i did do some experiments with relays but i havnt tried the three way traveler solution. id love if someone did a write up on that! who knows maybe i will next weekend. although im sure ill still catch quite a bit of flack :P

  1. The hacker in me looks at this and says, “Meh, use a relay.”

    The electrician in me looks at this and says, “That’s insane, dangerous, and almost certainly a code violation.”

    1. Wouldn’t using a relay be the less hacky method?

      And being an electrician and all, aren’t you supposed to know _exactly_ which hacks are code violations and which are not?

      1. >>>
        And being an electrician and all, aren’t you supposed to know _exactly_ which hacks are code violations and which are not?
        >>>

        Anyone who presumes to know what specs are without referring to the book is doomed to repeated failure.

        This hack being rare and uncommon, it is not likely that any electrician would know whether it is a code violation or not without referring to the code book. In addition, what is a code violation one one city/town/community, may not be in another. That’s why licensed professionals are expected to look the stuff up in a book.

        But then again, maybe you have one of those photographic memory things going on in which you rarely if ever forget anything while at the same time have deluded yourself into thinking that is the norm.

        Well let me be the first to tell ya loud and clear: IT’S NOT NORMAL!
        So if you do, be thankful that you have such a gift.

        If you don’t, grow up and stop being rude.

        1. You don’t need to refer to NEC to know that this is very likely not code compliant. Also, the National Electric Code is a bare minimum standard. Some jurisdictions may choose to not strictly enforce certain parts of it, and almost every jurisdiction has a different permit and inspection process, but none of that changes if something is code compliant or not. For the sake of simplifying things for you, everything inside the junction box must have the same minimum rating on insulated parts.

          1. I get the obviously not code compliant, but seriously, how often are prototypes code compliant. This is first and foremost a proof of concept.

            Personally, I would have opted for something that mounts on the wall over the switch, perhaps with a switch extension. There are certainly easier ways to do this.

            One could also just utilize a double or triple switch box and house the guts in that which would move closer to code compliance.

        2. Thank you, SATovey. I couldn’t have said it better myself.

          As a retired electrician, I have a good idea of what is a code violation and what isn’t due to years of experience, training, and studying. However, I would never presume to know what is legal in every jurisdiction, nor am I up to date on recent code changes.

          All that being said, it doesn’t take a genius to look at that and say, “wrong”.

      2. It’s hard to judge the code compliance of the parts used when you can’t see if they’re UL listed or what voltage rating they’re made to withstand. Modifying the switch will more than likely invalidate it’s UL listing. Using parts that aren’t UL listed and more importantly aren’t rated for 110V/250V is a code violation. The box fill is probably past the allowed amount with the addition of these parts, which in turn could affect the deration values of the wire used. Any sort of fire/property damage caused by this coupled with a decent insurance investigator would shift the blame dramatically to the person modifying and/or installing these hacks.

  2. I’m at least glad that someone seems to have the same line of thinking as me. Being able to physically flip a switch using a remote command is _awesome_. Sure, it’s cool to be able to control power remotely without flipping the actual physical switch, but there’s something so satisfying about seeing the switch flip.

  3. not worth not getting paid out from insurance company if/when/else something goes wrong and they have a ‘reason’ to deny coverage. cool ‘hack’ but really, better (in many ways) to do it properly.

    1. That was my thought as well. Even if a fire doesn’t start at that point, an insurance company will do their best to get a jury to think it did.. I sat on such a jury once. The experience left me with a low opinion of “expert” witnesses and lawyers.

      1. I sat on a jury for a criminal case where the jury was expected to find the defendant guilty of distributing marijuana without actual evidence proving that the defendant was distributing marijuana. It was all predicated on the officers expert opinion that no one would have a pound of uncleaned marijuana sitting in his freezer unless that person was distributing it. They wanted a conviction based solely on conjecture and would have gotten it if it weren’t for myself and another juror who happened to be an attorney that like myself, was also concerned with the lack of hard evidence showing the defendant actually handing the marijuana. No pictures of a deal, no audio of a deal and no video of a deal. Absolutely nothing that would lend credibility to the charge.

        1. Could’ve done with you for a friend who was recently sentenced. Some judges are abusive, and they pursue vendettas! In this case, the defense asked for a retrial since something was said that shouldn’t have been. Judge refused. Later, when the verdict came and it was “not guilty”, THEN the judge decided the trial was void and started a second one. With her judging, of course.

          In the second trial, after 4 expert witnesses proved the defendant couldn’t have committed the crime, the judge said something like “Well, you’ve heard what the experts say, but…” then shrugged and gave a “I don’t give a shit” kind of face. The judge has twice been investigated for (I dunno the term, being a bad judge!) in previous cases.

          Anyway, my friend is now awaiting sentence, on remand. The crime is basically an assault involving biting somebody. My friend doesn’t have any teeth! He couldn’t bite a grape!

          This, and the few other cases I’ve seen of courts, make me really really worry in case I ever end up in front of one.

          What’s funny is the time a friend of mine went to the police station to drop off some stuff for another friend. The police were SURE this friend of mine was colluding. They were POSITIVE, all the “just tell us, it’ll go easier for you” shit. And he wasn’t. It’s funny being told the police KNOW something when you know they don’t. Shows how cheap and lazy their methods are.

          Obviously, gods help anyone who’s ever wrongly accused, cos you’re three-quarters fucked just for being there…

          This is the British police / courts, btw, tho I’m sure other countries are as bad.

          Oh and I don’t have the space really to tell all the stories from victims of crime who found the police lazy and useless, to an unbelievable degree. I’ll tell ya next time.

          1. The only solution to a corrupt judge is removal from the bench followed by criminal charges for abuse of power.

            Here in America, in some States, judges are elected rather than appointed.
            In addition to the Constitutional protection to one’s right to trial by jury and double jeopardy. But we still get the occasional ego tripping nut job that thinks he or she is above the law and at liberty to do whatever he or she pleases with impunity.

            Here in Michigan, we’ve had several judges removed from the bench due to either criminal activity or some other stupid egotistical thing they end up doing. We are fortunate to have a hierarchy in place that will enforce judicial ethics. That unfortunately does insure that all trial verdicts are based on truth and therefore just.

            I have heard of people going to prison due to Police being lazy or presuming they got their man. In some cases, that means the actual guilty party is not caught and people end up loosing their lives because of it. I think a solution would be to follow the old testament rule that passed the same punishment upon those that bore false witness against an accused. If it turned out that the witness were in fact lying, then the lying witnesses were sentenced to same fate that the accused would have faced. If police officers faced the possibility of going to jail for neglecting their duties, I don’t think any clue would go UN-investigated and the truth would be found out as would most of the guilty parties.

            I’m of the opinion that there would be fewer innocent people locked up as a result.

    1. Belkin wemo will not mount in a switch hole without an extreme amount of cutting or dict tape. They still have not released their wall switch. Also the Wemo is a epic fail as they will not work with WPA2 you pretty much have to have an open no security wireless for them. No thanks.

  4. I could see something similar as a way to operate a dimmer if the servo where slowed, but for just an on/off a setup using a coil and plunger to operate the switch would be faster and safer.

  5. Or you could go get a 40 dollar z-wave switch and a controller, (between 50 and 250 bucks) and have a programmable light switch with spousal approval. No exposed wires or anything.

    I understand if one doesn’t own the apartment but even still its not rocket science to flip a breaker and change a light switch at move out time.

  6. Too bad he used THE cheapest crap servo in the world. I bought a couple of Tower Pro servos, these are made by the same manufacturer and uses the same hardware as TG9e and HXT900 except for plastic quality, Tower Pro uses appalling quality plastic, i managed to break one within seconds of receiving it, the second one may have survived for a few minutes.

    I made the same mistake and bought a bunch of TG9e servos for a project, this is biting me in the ass right now as i have to replace them as the potentiometer fails in half of them after just a few thousand operations. I would recommend to anyone to spend a little more and get metal geared “digital” servos which tend to last a lot longer.

    The idea itself is actually really cool, having a physical light switch move when activating the remote, depending on country it might not even be a code violation as long as you keep the low and high voltages clearly separated and don’t modify the high voltage switch part at all.

      1. I recently bought a pack of 10 HK-15178B servos from Hobbyking, these are in no way the best servos out there, but they are probably about the best servo you will get for that kind of money. They are out of stock at the moment but they generally come back again in a few days or weeks.

        The ones you linked seem to have similar specifications but i can’t really say if they are good since i have never used that brand. The good thing about metal geared servos is that it’s very hard to break the gears by hand, and the “digital” part really only means better positioning resulting in less jitter.

  7. Because relays or solenoids are too mainstream! XP

    he really should use either a nicer servo or some sort of latching system and detect when the sw…. or just put 2 magnets inside and use 2 decent size magnet coils ….

  8. If he attached it to the outside of the switch I could understand it, not modifying the electrical system and stuff (which you might not be allowed to do, e.g. in a dorm). But this seems strange, although a self-flipping switch IS kinda cool.

    1. Usually in this situation, on one side, one switch’s pole (the bit that moves) is connected to the power, the other switch’s pole is connected to the bulb. Then the 2 throw contacts are wired between each switch, as in this diagram.

      I can see that this way would work, but is it the standard way?

  9. I get a kick out of you guys that go out of your way to do it the hard and expensive way.
    at least MOD an X10 relay switch with a duino so it’s reliable and will not break in 1 week.

    Or better yet, hack an existing product that already has control but uses RF. there are tons of those kinds of switches out there on the market.

    1. i had actually looked into doing this the cheapest i have found those x10’s is about 25$ and once you modify it probably not going to be reliable anymore ha this hack cost me less then $5. $2.30 for a servo on ebay, and about $1.60 for the lightswitch. ( i bought in bulk )

      besides if your handy with a dremel its not very hard, did you see the pictures in the instructable?

      also the only RF controlled lightswitches i found where very very ugly.

      do you have any specific ones in mind?

  10. All safety and snarking aside, this fixes my biggest annoyance with remote control switches like X10 and so on. For loads that are out of sight like outdoor lighting or controlling an outlet that may not be powered on, it’s helpful to have the haptic feedback.

  11. Hey guys,
    Im the guy who submitted this, and i figure if you don’t defend your own work, no one will.
    First things first, “is it safe”, although i never claimed it to be safe, nor do i now, i would like to put these points out there. all i am doing is attaching a lever to the existing toggle. and actuating said toggle with a servo. PERSONALLY i think its safer then shoving a relay on perfboard with random wire that probably isn’t rated for 110v, and i can guarantee that this is prettier (if you find a nice way of hiding the guts lol and if you do let me know) besides, would you really want to see ANOTHER “i used a relay to turn a light on and off” post? i did learn some things, the 3 way lighting thing does open up some windows, i hadent thought of that and will defiantly look into it.

    There were a few comments about how i “re invented the relay” and i just wanted to take one moment to fix this statement. what i really did was “re invent the latching relay for less then $5 that also doubles as a presentable lightswitch” hmm sounds good to me :)

    i KNOW it isnt to code. because i never submitted it to UL or anyone like that.
    that being said, stating the obvious “that doesnt look like its to code” isnt very helpful is it?
    a few people did state more specific codes it violates, such as the insulation one and sharing of high and low voltage in a single gang box and i thank you for that,
    but this is hack a day, not pimp my house, i wouldn’t expect to see many UL listed off the shelve things here.

    besides, isnt manually actuating a UL listed lightswitch pretty safe?
    i mean sure i could have put the lever and servo outside the box… but then i would have been submitting this http://www.instructables.com/id/Easy-Home-Automation-using-servo-switches/
    and don’t get me wrong this guys solution is awesome, safe and simple.
    but its also ugly in my opinion.

    ok this is getting too long, thank you everyone for taking the time to read,
    and comment,

    P.S joshstarsick
    i dig it, i know what im doing next weekend :)

      1. its not inside the switch, the switching mechanism is stored in the black portion of the switch, in the white portion is just the toggle, take a look at the instructable to see the extent of the modifications,

        although yes having the servo INSIDE of the box probably isn’t the safest thing in the world. but it is prettier :)

        1. It is prettier, but yes, that’s what I meant, ‘switch’ is everything behind the wall plate.

          Just because there’s a bit of space doesn’t mean it’s good idea to shove extra stuff in there.

          Putting a cover over the black bit (where the high voltage is) that has a hole for the (plastic) actuator is how it’s supposed to be (and would cheer up the electricians a bit plus give you a reason for a 3D printer).

      2. He isn’t doing it inside the switch though, he is doing it behind the floppy plastic bit on the front.

        I think it’s a really cool idea, especially the way it mechanically moves the switch so you can tell what way it’s pointing. The only complaint i have is the choice of servo.

    1. Modifying or altering a UL (and probably CE, CSA, ETL as well) certified device usually invalidates the listing on the device. An insurance/fire inspector would move to shift the blame of any/all damage based on your modification and the fact that you’re neither certified or qualified to make any changes to said devices.

      You’re allowed to mix high and low voltage wiring in the same box as long as the box is clearly labeled as to having separate voltages and sources, and as long as the minimum rating on the insulated parts meets or exceeds the maximum voltage available inside the j-box (either phase to ground or phase to phase, whichever is higher). An example would be high quality multi-conductor “thermostat” wire – the good stuff will have a 600V rated jacket. Totally overkill for the 24V your T-stat is running at… unless the T-stat wire was run in the same conduit to the (single phase two pole) AC unit.

      Also keep in mind that electrical components have multiple ratings based on how they’re used, and those ratings can be significantly changed based on temperatures, fill capacity, etc. If you have too many current carrying conductors at a specific amperage in a conduit, you have to derate the conductors. If the new derated value is too small for the intended load, you have to increase the size of the wire. If the new wire size is too large for the raceway or box… you have to increase the size of them, as well. Conduit fill, box fill, wire derating – all things Joe Public doesn’t quite grasp. It’s not the end of the world, to have the servo in there, but it could be yet another straw on an overloaded camel’s back.

      Just because you “can” doesn’t mean you should. While your hack might work for you, and the servo will probably fail before any real electrical issues arise, it’s not safe. There’s a reason being an electrician requires certification, and there’s a reason we have electrical and fire codes.You’re consciously incompetent regarding the electrical system in your house.

      1. Thanks GF357,
        lots of good information in this reply,
        i know its not safe.
        but im glad you took the time to point out WHY instead of stating the obvious fact of its un-safe-titude.

        thank you,

    2. I think it is a pretty cool idea and like the concept of ghost switching like a motorized sliders on a recording studio mixer, of course if you triggered an ALL OFF scene there would be a lot of clicking going off at once.

  12. Hey guys,
    Im the guy who submitted this, and i figure if you don’t defend your own work, no one will.
    First things first, “is it safe”, although i never claimed it to be safe, nor do i now, i would like to put these points out there. all i am doing is attaching a lever to the existing toggle. and actuating said toggle with a servo. PERSONALLY i think its safer then shoving a relay on perfboard with random wire that probably isn’t rated for 110v, and i can guarantee that this is prettier (if you find a nice way of hiding the guts lol and if you do let me know) besides, would you really want to see ANOTHER “i used a relay to turn a light on and off” post? i did learn some things, the 3 way lighting thing does open up some windows, i hadent thought of that and will defiantly look into it.

    There were a few comments about how i “re invented the relay” and i just wanted to take one moment to fix this statement. what i really did was “re invent the latching relay for less then $5 that also doubles as a presentable lightswitch” hmm sounds good to me :)

    i KNOW it isnt to code. because i never submitted it to UL or anyone like that.
    that being said, stating the obvious “that doesnt look like its to code” isnt very helpful is it?
    a few people did state more specific codes it violates, such as the insulation one and sharing of high and low voltage in a single gang box and i thank you for that,
    but this is hack a day, not pimp my house, i wouldn’t expect to see many UL listed off the shelve things here.

    besides, isnt manually actuating a UL listed lightswitch pretty safe?
    i mean sure i could have put the lever and servo outside the box… but then i would have been submitting this http://www.instructables.com/id/Easy-Home-Automation-using-servo-switches/
    and don’t get me wrong this guys solution is awesome, safe and simple.
    but its also ugly in my opinion.

    ok this is getting too long, thank you everyone for taking the time to read,
    and comment,

    P.S joshstarsick
    i dig it, i know what im doing next weekend :)

  13. The big challenge to projects like this is getting the circuitry small enough to safely (actually no, not safely… opposite of safely) fit inside the wall. It doesn’t look like that is going to happen with this project.

    Also, codes are for cowards, go dangerous or go home. #thuglife

  14. Expanding slightly on what [Chalkbored] suggested earlier, I think it would be pretty easy to fix any issues of gear stripping by adding a flexible linkage between the servo horn and the lever. Like a length of string, spring, or elastic, long enough that manual switch flips won’t turn the horn at all when the servo is in the center position; which it will normally remain in. To flip the switch via servo, it will have to turn further in either direction from center, then return to center. If the linkage is stretchy, it might also reduce stress from hard mechanical stops should the servo continue pushing once the switch reaches its limit. Could literally be a $0.01 and 15 minute fix.

  15. Or you could forgo all this tinkering and just buy some off the shelf, not too expensive Insteon gear. For visual lightswtich “position” indication, the available Decora paddles have a series of LED lights in a vertical stripe that indicate on/off and/or brightness (depending if it’s a dimmer module). This works great when using two (or more) switches in a hallway or other scenario with multiple switches operating one load – instead of some being on, and some off, depending on which are set where, on is always on, off is always off.

    Want RF mesh instead of relying on bridging signals across phases? No problem, almost all their gear is “Dual Band” now (RF and powerline).

    Want a way to control from your PC / tablet / phone ? No problem, go buy one of several devices (I use a Universal Devices ISY994i myself, which in addition to providing controllability via IP, can do things like run scripts on a schedule or triggered by an event, integrated with various things including security systems, etc).

    Want the kitchen lights to come up dim whenever you walk in during the middle of the night? Slap a battery powered motion detector unit anywhere you want, and link it to the lightswitch to a specific on % setting. You can even be notified of low battery level in advance if paired with something like the ISY994i – it can send an email when the ‘low battery level’ event is triggered.

    I’ll grant you that if you are not working with 60hz/120V power, Insteon is basically nonexistant, like X10, though – your options are pretty much rolling your own like this or going with really expensive UPB hardware.

Leave a Reply to joshstarsickCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.