Hackaday Prize Entry: Theia IoT Light-switch

There are it seems no wireless-enabled light switches available in the standard form factor of a UK light switch. At least, that was the experience of [loldavid6], when he decided he needed one. Also, none of the switches he could find were open-source, or easy to integrate with. So he set out to design his own, and the Theia IoT light switch is the result.

In adapting a standard light switch, he was anxious that his device would not depend on the position of the switch for its operation. Therefore he had to ensure that the switch became merely an input to whichever board he designed, rather than controlling the mains power. He settled upon the ESP8266 wireless-enabled microcontroller as the brains of the unit, with a relay doing the mains switching. He first considered using an LNK304 off-line switching PSU chip to derive his low voltages, but later moved to an off-the-shelf switch-mode board.

So far two prototype designs have been completed, one for each power supply option. Boards have been ordered, and he’s now in the interminable waiting period for international postage. All the KiCad and other files are available for download o the project’s hackaday.io page, so you can have a look for yourselves if you are so inclined.

You might ask why another IoT light switch might be needed. But even though they are now available and inexpensive, there is still a gap for a board that is open, and more importantly does not rely on someone else’s cloud backend. Plus, of course, this board can be used for more than lighting.

Light bulb image: Осадчая Екатерина (Own work) [CC BY-SA 4.0], via Wikimedia Commons.

17 thoughts on “Hackaday Prize Entry: Theia IoT Light-switch

    1. depends on the house, old houses all the wiring runs back to a big old junction box under the floor. Now all connections have to be ‘accesible’. if its looped in at the fitting then no, but if its looped in at the switch he will have a neutral at that switch, but not necessarily at any other multi way switches.

      1. Sadly in my country 99% of the time we have only 2 wires for a regular 1 button light switch. Mostly those two wires are actually the phase/live split in two. So if i would try to install a smart switch here it would kill its own power supply when it would turn the lamp off and when i turn it on the power supply would be in series with the lightbulb which causes all kinds of weird flickers, loss of brightness and other stuff in the lightbulbs.

      2. Lutron (and perhaps others) had a nice trick with incandescents of completing a high resistance circuit at all times with the bulb to complete a circuit and thus be able to sap power from the mains to power their digital and wireless lighting switches.
        Unfortunately fluorescent bulb replacements and LED’s don’t work so well with that trick.

        So for those who don’t have neutral in the switch box it’s a royal PITA adding it, or breaking regs (meh) to insert other power methods to said DIY light switches.

        Or digging up floorboards and terminating at those big old junction boxes. Easier upstairs. Loft.

        Or adding a LI battery, the requisite parasitic charger for when the light is on and enough capacity to see you through the light being off. And maybe giving the ESP the ability to turn the light on to charge itself when the battery is running low. :)

    2. For very low power drains (e.g. lighted switches) the usual trick is to let a very small current flow through the switched load even in the ‘off’ state. This works very well for incandescent bulbs, but a CFL I have on a lighted switch gives an almost-imperceptible flash every handful of seconds (noticeable only if the room is very dark and you stare at the bulb). An ESP at full tilt draws much more than a typical LED/neon though, so it may not work as well with non-dumb loads.

      As a hobbyist you could probably send the maintenance current through the earthing pin; this might get you the stinkeye from Real Electricians and city inspectors though.

  1. There are reasons why many of the commercial available sets for smart plugs/ light switches have a main unit with WIFI and slave units with 433MHz.
    The most interesting facts about such plugs/switches are power consumption and latency. If you put the ESP8266 in sleep mode, latency is high. If you don’t, power consumption is. So, in the first place, far more interesting than the design files are estimates and measurements of the power consumption (including LDO, relay; everything). That is the challenge but there is probably a reason why those are never mentioned in these articles. Hopefully, the next author, whose turn is it to write an article about smart plugs, reads this. You can always leave the LED lights on.

    1. i doubt anyone installs these to use them because they are lazy, rather, they install them and then only use them to justify the installation. I don’t believe anyone can say with a straight face that connecting a lighbulb in your house to the internet has benefited them

  2. I’ve been looking into this problem space for a while and realised that the failure of the control unit needs to be more elegant, possibly using a second relay that when not energised causes the circuit to default using the conventional switch and has the circuit under remote control only once the controller bypasses the main switch. The other issue is the usual certification/insurance issues this sort of electrical work involves.

    Also if you are going to go to all that trouble it makes sense to also have a smart cap sense switching option where you can wave your hand near the unit to control the light, and while you are doing that add all the other obvious extras like an information display for time/weather etc. As much functionality as the ESP has computing power for. If you have a hand wave trigger an audio signal for your information feed you don’t even need a visual display and can keep the entire set-up looking like a “normal” switch.

  3. I am working on something similar. Fortunately my house has both live and neutral in the boxes. I have built a separate PCB for the high voltage components. It incorporates an isolated 3.3v power module. I am using a D1 mini on a separate isolated board for the ESP8266. The regular switch is now an isolation switch (should be always on) and there is a push button with a LED to turn the light (or other device) on and off locally. The button just controls a GPIO line. Power consumption is not an issue as the wifi is mainly listening and not transmitting and is not battery powered. I am using MQTT and TCP/IP but may change to CoAP over UDP for lower latency. When I have worked out the details, I will put the project on Hackaday.IO

  4. Because of the neutral supply problem it might be better to put the controller in the ceiling rose. Most UK systems have neutral present there. (I believe that it is called the ‘three plate system’). I once helped design a mains powered smoke alarm that used this strategy.

Leave a Reply to DainBramageCancel 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.