Home Automation

Home Automation

Tips and Tricks for Home Automation

25 Dec 2020

The Woes of Custom Hardware

Like many others, I find myself unhappy with some of the Home Automation Hardware (sensors, switches, etc) available and, in specific cases, wish to design my own. One example of this is a general Room Sensor and Button Box.

For just about every room in my home, I need sensors for Motion and Temperature. In addition to this, a few LEDs to indicate status, as well as a few buttons to trigger scenes and other functionality is desired. Ideally, this would be battery powered and hanging on the wall or AC powered, fit within a standard wall switch box, and meet all UL requirements. I decided to design something that takes DC power, and then modify it later to either be battery or AC powered.

With a breadboard, a handful of the needed sensors, buttons, and LEDs, an ESP32 ready to program, a bunch of hookup wire, and the power of ESPHome, I had a working prototype in no time. Of course, as a prototype it’s not very pretty, and takes up a lot more space than it needs to. But it works.

I thought the “hard” part was over. But, it turns out, “making it pretty” is a huge step that, on its own, requires a lot of trial, error, and effort.

Armed with a 3D printer, I designed a case that was small enough to be attractive, yet still large enough to fit all the components and wires I would need. Sadly, this still wasn’t enough. The buttons I was using, while they worked great on a breadboard, wouldn’t attach well to the case I printed. And the new buttons I ordered have pins that are much wider than the pins I’m used to working with.

Then there’s the issue of power. Each of these components needs to be powered by the single power providing pin on the ESP32. And each of them needs a ground connection while the ESP32 dev board only provides 2 pins for this. So, I still need to include some kind of power rail inside of the enclosure.

So that’s where I’m at now. My PIR sensor and temperature sensor have pins the same as the ESP32. The small strip of WS2812 LEDs I’m using will require some solder to earn them some usable pins. And each of the buttons will need two wires soldered on to each of them. On top of that, I’ll have to stick a power rail block to the back of the enclosure to get everything working.

There’s a lot more that goes into hardware design than I expected. Even when the look of the final result is not all that important.