US decora style wall switch

  • So I am trying to design a wall switch that will work similar to the older 4 (8) button X10 XPT switches that I have in some places in my house. For those that don't know what these switches are like, here is a pic.
    alt textalt text
    I have also seen other switches out there that have an LED next to to each button such as in the second pic. Much like the XPT switches, the buttons on these will just transmit back to the MySensors gateway or possibly directly to another relay or dimmer node.

    So here are my thoughts on how the design of the switch would be. The faceplate would be made from a decora style blank such as one of these:alt text
    The design would be something like this:
    alt text
    I am thinking that this could be laser engraved onto the decora blank. The switches would be laid out like this on the top pcb so as to have a switch under each engraved tab:
    alt text
    I tested a couple switches on a protoboard and when the board sits on the back of the blank plate, the caps of the buttons gently rest on the back of the wall plate. The laser engraved areas on the front should flex just enough to hit the buttons underneath. The LEDs next to each row will just be a simple on/off status LED.

    The wiring should fit for all of the components if my calculation is correct. Six data lines are needed for the switches (4 rows and 2 columns), and 4 lines for the status LEDs. After wiring the radio to the node there are data lines 3 through 8, and analog lines A0 through A3. The analog lines would be used for the LEDs as there are 4 of them. The 6 digital lines would be used for the push buttons. The wiring for the switch board would look something like this:
    alt text
    The LEDs would be 1.8mm LEDs like these:
    1.8mm LEDs

    Connecting the controller:
    What has been shown so far has just been the switch board. The idea is that the switch board would stack on to the controller board with one or two header connectors. The controller board would use a PCB the same size as the switch board. There is plenty of room on the second board to put the nano and the nRF radio along with the 3.3v regulator.

    My next hurdle in this is figuring out power. I am thinking of using another board stacked on to the assembly and using one of these AC/DC converter.

    Design advantages
    Here are some key advantages to this design.

    • The 3 board design makes it modular. You basically have your power supply board, your processor board, and your switch board. This makes switching parts that may fail easier.
    • With the front switch panel being a plug in module, other switch configurations can be created to change the functionality. This does not have to be only for switches, as you could build other sensors or indicators that could fit a standard decora style wall plate.
    • If status LEDs are not used that would open up 4 more lines for more switches or other sensors.

    So far these are all just ideas. I am open to comments and criticisms on any thoughts or ideas that I have noted. Any ideas on where I can get some of the parts done at like the laser cutting and possibly a good PCB manufacturer, that would all help too. I haven't looked yet, but I am assuming that there is a matrix switch assembly sketch out there somewhere that I could use as an example.

    I will post more as this project moves on.

  • Mod

    This looks great.

    I like the tactile feedback from switches but you could get an even cleaner look with the capacitive sensors presented in

  • @mfalkvidd I saw that project. That one is using 2 buttons, most likely on and off. My proposed design has 8 switches. I don't know how well that would work with capacitive touch sensors that close together. Not to mention he uses just the flat surface which even if you could get the capacitive sensors to work you would have a hard time distinguishing what button you were pressing. At least with the laser cut groves, it would give a little bit of tactile feel so you could tell a little bit what button you were pressing. Maybe not as much as the raised buttons on the XPT and other switches, but at least there would be some feel to it.

    Don't get me wrong, a 2 button capacitive touch sensor board could easily be fitted to this setup though as a different kind of switch shield. As I mentioned, this could be a modular type of design allowing for many types of switches and sensors to be fitted.

  • There are various captive touch sensors available on the market, so more and some less sensitive. Sensitivity is related to the capacitor value the touch contact is attached to.

    The commercial available touch sensors can all be configured to either work as toggle or as on/off switch. The more expensive ones also have time delay feature.

    You can get little touch sensor boards like this 4 way Touch Sensor. These sensors are very small, less than half the size as shown on the pictue. With these you must create toutch plates on the outside of the decora wall plate and solder these to the touch pads on the sensor. I've done this as one of my experimental designs and it works well. I ended up going for a completely slick look Dual Touch Sensor + Custom Node.

  • Hardware Contributor

    That looks fantastic! I looked at the capacitive solutions and while they're neat, I don't like them from a user interface perspective. I want tactile feedback in a switch - a rocker would be even better but this is a close second. It would be nice if you could take those of us who use RFM69's into account if that isn't too difficult.

    You might want to look at the SwitchMote for packaging and board ideas. Another thought: Just my opinion but I think it would look nicer if it was symmetrical. Could the LED's be moved into the center between the switches?

  • Hardware Contributor

    If getting the laser cut blank doesn't work out, another option you could consider is using pre-cut keystone plates. It's probably possible to modify a blank keystone jack by cutting the mounting tabs off and have it sit flush or a little proud of the plate and use that to press a switch on the pcb behind it.

    alt text

  • I like this one too. I am playing with a Low Power Labs Switchmote at the moment. This switch plate is a lot more elegant. Are the arrows for dimming?

  • @TD22057 I like the thought of having the LEDs in the center giving it a more symetrical look. I happened to be at the hardware store today and saw a switch made by leviton that had a series of LEDs on the side much like my design that were used to indicate brightness level. Like I mentioned, the possibilities for the switch/sensor board are limited by your imagination.

    You mention using the RFM69's for your radios, that would simply be a matter of designing a different processor board that you could switch on to the setup. I can look into designing the board to take either type of radio, but I will have to see if there is space enough and enough data lines. My setup uses all nRF24L01 modules, so I am not familiar with the wiring of the RFM69s.

    The keystone style faceplates like you showed are something that I use at work a lot, and originally thought of using those until I came up with the laser engraved faceplate idea.

  • @nagelc The arrows would be for dimming, bu they could easily be changed to on/off buttons like the others. The idea behind the design is to be modular and flexible. How it operates is all in the sketch that you write to handle the devices on the faceplate, be it switches, lights or sensors.

  • The switch design I have shown in the original post is based off of the 3 button on/off + dimming XPT switch from X10:
    XPT 3 buttom plus dimming
    I have a few of these in my house already. The dimming buttons operate dimming functions for the last on/off button pressed. So if you turn button 2 on and then use the dimming buttons, it will dim whatever device that corresponds to switch 2. You then turn on button 1. Dimming will then operate the device on button 1.

  • So I did some checking on getting the blank wall plates laser cut, but not having much luck. One local company said they couldn't do it, the other says that the plastic is polycarbonate and their equipment will not cut poly. One other thing I found when researching this is:
    "Polycarbonate sheet can be cut with industrial cutting lasers however, edges may become amber or brown when laser cut and a clean edge is difficult to obtain. In fact, some laser cutters are not able to cut it because it ruins the lens and requires frequent stopping and cleaning. Please contact your equipment’s manufacture to see if your laser is able to cut polycarbonate and for recommendations on the process."

    So I am now looking into having these possibly CNC cut. I'll post my findings on that.

  • @dbemowsk try searching for watercutting, you get very nice edges without burnt colouring, and cost wise its generally cheaper.

  • So I decided to work more on this old project I started a while back, and I finally have a prototype of the switch/LED board finished. It is far from pretty, but it is functional as far as I can tell with the tests I have done with my volt meter.

    This is a picture of the switch board assembly opened up:

    And here is 3 views of the switch board fully assembled:

    The idea I am working on is to layer the boards using the header connectors, making it modular. The next board would be the computer/MySensors board. It would be the same size as the switch board and stack with a set of female headers. This switch board would pretty much max out the pins on a pro mini. The switches would take 6 pins ( D3 - D8), and the LEDs would take 4 (A0 - A3). There would then be a third board stacked yet on top if these two which would be the power supply board. The power supply board would contain the HLK 5 volt power converter and a 3.3 volt regulator.

    My issue now is to see if I can get everything to fit in the small amount of space with header connectors to stack the boards. I may have to get creative with the arduino/radio board and mount one on each side of the board. Wiring it will also be a challenge. Then I will have to see if it will fit in a standard wall box or if I will need a deep box

    In the end, if I can get everything figured out, I could make a number of these and attach different switch boards for different configurations. I may even design a PCB for this, but if I do, that would be in the distant future.

  • So here is my latest update. I now have the controller board made that the switch board will stack on to. It currently uses all analog and digital pins of the pro mini except pins A4, A5, A6 and A7 which are not in the standard header rows. This is the board as it is right now.

    And this is the controller board stacked with the switch board.

    I wrote a simple sketch to test the keypad which is just a 2x4 matrix. One thing that I realized that I forgot which I will fix in the next couple days is the current limiting resistors for the 4 LEDs.

    For testing until I figure out the design of the power supply board, I am just powering this using the supply from my UNO as it has both the 3.3 and 5 volt outputs.

    My plan for now is to use each row as an OFF and an ON button with a corresponding status LED, but the possibilities for this are much greater. This could be used as a controller for 8 individual scenes, bright/dim controls, or whatever you can think of. This could be used to talk directly to other nodes for lighting control or any number of things. You could build other switch boards for this that would maybe contain more switches (eliminating the LEDs of course), or any number of combinations of switches and sensors.

    The final setup is going to be quite bulky and will need a deep US wall box to fit everything, and even that might be tight. For now this is a proof of concept design to test the feasibility of this as a controller. Eventually if things work out, I may seek help from the forum to create a dedicated PCB for this which could be stacked into a smaller package.

    I welcome any thoughts, comments and feedback on this design.

  • @dbemowsk

    I'm currently working on the following PCB design for US Decora Wall Plate.

    It's designed to have some components/ connections on the back, but most of the components on the front of the PCB.
    It has provisions for connecting:
    4 x Switch (A0, A1, A2, A3)
    4 x LED (A4, A5, A6, A7)
    4 x Relay/SSR (D5, D6, D7, D8 connected to NPN transistor)
    2 x sensor (pin D3 and D4)

    Designed for using an Arduino Pro Mini 5V with A4 to A7

    I can share the gerbers once completed

    alt text


    I'm also working on a Dual Decora style wall plate switch containing 4 x 8Amp SSR
    alt text

  • Hardware Contributor

    Very interesting designs @enterprised and @dbemowsk. I've also been working on my own version of decora switch and relay system. It's designed to use empty keystone switch plates with 1, 2, or 3 switches and uses keystone jack fillers as the switch covers so they look almost commercial. It's a 3 PCB system. The front PCB has the switches, LED's, reset button, CPU, and an RFM69 or NRF radio. The middle PCB has a MeanWell IRM-02 or HLK AC->DC converter (with fuse, thermal fuse, and varistor), a replaceable fused 10A AC relay with opto-coupler isolation, 5V and 3.3V rails and a 2 wire temperature probe to measure the temp of the PSU module. The back PCB is just a cover to insure no sharp solder points are in an electrical box. I decided that since this will be in my walls, I would only use name brand parts (from digikey and mouser) on the high voltage side which increases costs but should reduce the risk of fire (or at least make me feel better).

    I've designed the PCB and checked them over but we're in the middle of buying a house and moving so I haven't ordered any yet. Here's the 3D rendering of the PSU and CPU boards together and a one of the PSU board.


  • @enterprised For my design, I am hoping to use an HLK-PM01 power supply. Comparing to the one you have listed it has a few advantages:

    • Enclosed components vs exposed components on yours
    • Continuous output current of 600mA vs 200mA on yours
    • 50mV or less of ripple on the output vs 100mA on yours

    Having the components sealed will protect more against short circuits on the high voltage side. As for the current, I probably wouldn't need 600mA, but using a supply that is rated a bit higher I figure will be less stress on the components and cut down on heat. Plus I have to do 3.3 volt regulation for the radio, so I figure I am covered for that too. And last, the better the ripple on the output, the less filtering that will be needed for a more stable radio.

    The other thing that I like about my design is that it is modular. You would be able to have a number of different switches, sensors or LEDs as the faceplate while having one arduino/radio board and one power supply board. As mentioned in one of my previous posts, the current design is a bit bulky, but with a better PCB design, I think I can compress the layers quite a bit more. Looking at your pics, yours looks like a nice design too.

  • @TD22057 Excellent design. I like the fact that you used the Recom PSU. I have used the Recom ones and they are very well built, but they are slightly larger than the HLK-PM01s. The price is a bit higher too, but I figured for what mine would be doing, the HLK-PM01 will be sufficient. I plan to also use a thermal fuse with an MOV and fuse for good protection. Mine at this point is a bit bulky to fit relays in right now, but it would work well for a nice scene controller node or a direct control for another node.

  • @dbemowsk

    Oops, attached the wrong link.

    I'm using the 400ma version of this PSU. The design uses 200ma max with 4 switches/LED's/SSR's, so plenty of overhead. I actually stepped away from the HLK-PM01 due to the very poor reliability of these modules, too many that failed within a few months.

    I use an LE33 in TO92 package to create and regulate the 3.3v for the radio

    The ripple is a non issue as I have 7 module of the previous design installed and working around the house.

    I'm enclosing the entire module with a hot vacuum formed custom enclosure, so the entire circuit is fully protected. Amazing what you can do with a sheet of plastic, some wood, vacuum cleaner and a oven.

    My design is also using multiple PCB's. There is a second PCB sitting on top containing 2 SSR's and related components

    This was my previous design using relays not SSR but all other components are the same.
    alt text
    alt text

  • So for my latest update on this, I have finished the power supply board. One thing I learned in making this that I didn't even think of at first was that when I soldered on the thermal relay, the heat from the soldering was enough to blow the relay. Thus, my initial test did not work. I was finally able to get a fuse installed and working. I would have preferred it to be more centered on the side of the Hi-Link module, but I am thinking that it should still be effective.

    On the bottom side of the board you can see the LM1117 3.3v regulator. For the high voltage side, I have hot glue over all traces for safety in testing.

    I used a 22uf cap on the 5 volt output and a 10uf cap on the 3.3 volt output. I have also added hot glue to the incoming hot and neutral leads to provide some strain relief on the wire as it attaches to the board.

    The last thing I want to do is fabricate a plastic cover to put over everything that will fit into the wall box. I think I am going to need a deep wall box to house the connections and the module.

    I did connect this and have it paired with my Vera. Each row is OFF, ON and status LED to indicate the ON state. I have debated on having the LED on when the switch is off to give better visibility to the switch when it is dark. In Vera, I can tie the switches to devices using scenes.

    Overall, this proof of concept design is working well.

  • @dbemowsk
    I think that with a little effort the switch and middle PCB can become one in a custom designed PCB. You'll end up with switches and LED's on one side and the Arduino and radio etc on the other side. That's what I did. This will make your design a lot more compact.

    I used to design and manufacture my PCB's.

  • Hardware Contributor

    @dbemowsk - Nice work!
    Here is a discussion and more links about safety in designing a PCB with AC power that might come in handy:

    Also if you dont want to completley redesign a PCB you can take some of my designs and redesign them to your purpose.

  • So I have had my prototype version of this switch installed for a few weeks now and it seems to be performing well with my Vera setup. This week I added a new tool to my arsenal. I purchased an Anet A8 3D printer kit. I just got it put together yesterday. I ordered a roll of ABS which came yesterday. It was supposed to be white, but they sent transparent (Grrrr....). Trying to work with the ebay seller on this.

    Anyway, I wanted a project to try that would be useful, but not super difficult. I decided to build a better switch plate to improve my prototype of this switch. I knew that one of the big places to go for 3D stuff to print was I did a search on the site and someone had a 3d file for a decora blank wall plate. I decided to download the files and see what I could do. I had never done anything in any kind of CAD program, but thought, how bad can it be. I ended up finding OpenSCAD. Drawing objects in the software is done much like a structured programming language. Within a day of teaching myself some things in it, I came up with this:

    I have not printed this yet since I am still trying to resolve my filament issue with the ebay seller,. but as soon as I get that figured out, I will give this a test. Before printing I may still look at adding some reliefs in the 4 corner tabs to save at least a little bit of plastic, but overall I think it looks good. I'll post more here as I get it done.

  • Hardware Contributor

    Looking forward to pictures 🙂 Keep up the good work!

  • I think this 3D printer is going to help a lot with my HA hobby. Now I will be able to make custom enclosures and things and not have to search the web to say, "ehh, that will kinda fit". I just have to get used to using OpenSCAD.

  • Here is the updated part.

  • So even though I only have transparent ABS to work with at the moment, I decided to do a test print of this (I actually did 2 test prints). The results were in my eyes only fair. Though the outside didn't look bad, the inside is a bit messy. I think I could clean it up and make it usable, but I think it could be better. I printed it with the ears down and the face up. The print may come out better if I print it with the face down. The ears may be a little stringy, but that is a little less of an issue because the ears are hidden by the faceplate. I had to increase the hole size in the face where the buttons come through for the buttons to fit (this was the reason for the second test print). With the first print, the buttons were a little snug in the holes.

    Without further ado, here are the pics:
    0_1487645138378_upload-e913e68a-e229-471a-b637-dbb822b4c276 0_1487645152819_upload-f3219ab8-315b-4a82-bccd-ca9f000e9b03

    These two pics show how it fits in the faceplate.
    0_1487645183984_upload-8b62d489-5fef-4657-b00c-f070b0aee885 0_1487645196357_upload-1cecec11-4324-4547-8350-d1a68462c067

  • If anyone is interested, I posted the 3D design files for this switch plate out on Included is the OpenSCAD file and .stl files for making modifications if you'd like.


  • Admin

    @dbemowsk said in US decora style wall switch:

    I think this 3D printer is going to help a lot with my HA hobby. Now I will be able to make custom enclosures and things and not have to search the web to say, "ehh, that will kinda fit". I just have to get used to using OpenSCAD.

    You should give FreeCAD a shot. Open source and runs on Windows, macOS and Windows and you can download the releases from GitHub

  • @blacey Though I do own a windows laptop, my main desktop is a linux machine. Don't have time now, but I'll see if they have it ported to linux. Thanks for the tip.

  • Admin

    @dbemowsk Linux is the primary platform used by the FreeCAD devs so Linux is very well-supported.

    There is a PPA for stable and a PPA for daily developer builds.

    For example, to install the latest stable:

    sudo add-apt-repository ppa:freecad-maintainers/freecad-stable 
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install freecad freecad-doc 

    More details here -

  • @blacey Thanks for the tip. Just installed it on my Fedora 23 box.

    sudo dnf install freecad

    It did not find a package called freecad-doc, but that's what the online docs and youtube is for.

  • Admin

    @dbemowsk said in US decora style wall switch:

    @blacey Thanks for the tip. Just installed it on my Fedora 23 box.

    Excellent! Also, there is a pretty vibrant community behind FreeCAD so feel free to introduce yourself and ask questions on the FreeCAD forums - everyone is very helpful.

  • Just an update on this. I gave the wall switch another spin on the design. I made a version of this with nice rocker switches. I think this design looks a bit more professional.
    Because of having the rocker switches I have added one more piece to the design which is a rocker support for the switches to prevent both the on and off buttons for a switch to be activated simultaneously.
    Here is a view of the prototype with the rocker support in place.

    The LEDs that I currently have installed are 3mm white LEDs. I went with 10k resistors on them so as not to make them too bright since at full brightness these can be a bit blinding. I chose those because they are what I had available in my parts bin. Red or green LEDs might be a better fit for this. Choose a resistor value that gives whatever LEDs you choose suitable brightness as this can vary between LEDs.

    For anyone interested I posted the 3D design files on thingiverse. Everything you need to make this switch board is posted there.

  • So, I have added yet one more variation of this to my line of switches. This is a dual rocker switch with customizable text for each on/off switch. You can have just the plain ON / OFF button style or you can choose to add 6 to 7 characters of text above the ON / OFF text. In the images below you can see that I have created one of these for use with a light/ceiling fan combo.
    0_1491021454166_decora_dual_rocker_switch_assembled_top_view_fan_light.jpg 0_1491021458990_decora_dual_rocker_switch_assembled_top_view_on_off.jpg

    The OpenSCAD and .stl files for this switch variation can be found on thingiverse.

  • So I was playing a bit with the online schematic and PCB tool that @enterprised mentioned called EasyEDA to create boards for my in-wall switches. For now I stuck with the design that I have a few prototypes of, which consists of 3 boards, a switch board with LED indicators, a main board with arduino and radio and a power supply board. This is what I have so far.

    The power supply board is pretty simple and straight forward. Based on an HLK-PM01 with both a standard fuse and a thermal fuse for safety. J7 and J8 are the 110V AC inputs. The output is filtered with 10uf electrolytic and 0.01uf creamic capacitors:

    The main board too is pretty simple. It will use a 3.3v pro mini with an nRF24L01+ radio and 2 header connectors for attaching the switch board:

    I went a bit complex on the switch board design for flexibility. The design looks a bit busy, but once you understand the idea behind it it makes perfect sense. The board will be able to handle configurations for my original 8 button design (4 on/off switches), my 4 button design (2 on/off switches) and also a standard decora paddle type design. All designs would have LED indicators for each row of buttons. For the 8 button / 4 on/off switch design, you would populate SW-1 through SW-8 and use LED1 through LED4 with R1 through R4. For the 4 button / 2 on/off switch design, SW-9 through SW-12 would be populated and use LED5 and LED6 with R1 and R2. Lastly for the standard paddle design, SW-13 and SW-14 are used with LED7 and R1. This eliminates the need for 3 separate switch board designs. I can have some boards in the parts bin and depending on the type of switch I need, I populate what I need. I went with SMD LEDs and resistors because I thought the through hole ones seemed a bit bulky. I can then print clear lenses for the LEDs to shine through.

    One thing that I don't have in the design shown that I will probably add before sending it off for printing is a 3.3V and possibly even 5V positive power connections to one of the header connectors going to the switch board. Having that would allow me to build other sensor boards that could plug on top of the main board for even more flexibility. I currently have a ground, 6 digital IO and 4 analog IO lines being passed to the switch board which would allow for a lot of additional design possibilities.

    I am open to comments and suggestions on the design so far.

  • So, one of my big days is here. My first ever fabricated PCBs that I designed are here. A slight change in the switch board from what's shown above, I did a design of one that used through hole components instead of the SMT components shown above. Really the only thing that I did as SMT in the above design were the LEDs and resistors, the switches were still through hole. Anyways, are some pics of the top and bottom sides of the finished product.
    I designed them and ordered them through the EasyEDA website. I got 5 each of the boards, so 15 total, for $24.63 plus $18.41 for DHL shipping to the US which comes out to $2.87 per board. For a small test run, I thought that wasn't too bad.

    Tonight I plan to assemble one of the switches to see about how long it takes. I also received my new batch of thermal fuses needed for the new boards, so I should have everything I need. Once done, I will do another post showing a finished and assembled switch.

  • Banned

    So, how is the Anet A8 doing? Was thinking of purchasing it, but not sure if it's better or worse than the Anet A6 or Creality Ender 3.

    Any thoughts will be highly appreciated.

  • Banned

    This post is deleted!

  • @alex_the_techy I have had an A8 for just over 2 1/2 years now and it has been a relatively good entry level printer. Most of these entry level printers have some quirks about them, but they give you a good start into 3D printing. It does have an acrylic frame which is not quite as sturdy or durable as the aluminum extrusion frame that something like the Ender 3's or the Creality printers have. You can pick up an Ender 3 now for less than $200 US at aliexpress which is right around the same price as an A8. I would go with that over an A8 if I were to buy one these days. Many people that buy the A8 printers end up doing an AM8 frame conversion on them which basically gives you a frame similar to the Ender 3. I am not sure what the cost of the AM8 extrusion parts cost, but whatever the price is, it's too much when you can start out with the Ender 3 for around the same price as buying an A8 and you don't have to go through the hassle of the conversion, which by the way requires some 3D printed parts.

Log in to reply

Suggested Topics

  • 8
  • 1
  • 90
  • 2
  • 44
  • 3