Wifi Wall Switch – esp32

Why make a Light Switch

Wifi light switch or control switch. esp32I needed a Wifi connected light switch for the workshop, something a bit more robust than the usual indoor white plastic type.  It had to run Tasmota – none of that Tuya stuff.  So I built one based on some metal push buttons, supposedly waterproof, that I bought in from China.

Thinking that I could use a few of these I didn’t want to manually wire each button and LED to a esp-32 module.  A circuit board was designed.  Due to the physical layout requirements of the buttons and the esp-32 module pin headers it became 2 circuit boards.  This provided room for power supply regulator module and LED driver mosfets and a few header pins just in case we need a senor or two.

How Does it Work – a bit more technical

Wifi light switch or control switch. Circuit boardsIt fits into a standard NZ electrical Flush-Box.  All it requires is a 10-20V DC power supply.  You need to know a bit about Tasmota and what you want to d with it to get it working.  I have it connected to Home Assistant which is then controlling seven circuits of LED lighting, about 200 watts in total, via a couple of H801 wifi LED drivers.

The buttons have 12-24V LEDs fitted.  The power supply fed the LEDs directly and is regulated down to 5V for the esp32 module.  The power supplied could be 10-20V without exceeding any ratings.

The knob is connected to an analog input of the esp32.  The intention was to use it as a dimmer control but so far it hasn’t been used – it does register as a 0-1024 count which can be used for anything.

Header Pins

On the back are a few pins that could be used to connect sensors, maybe for temperature, humidity or light level.  With a bit more programming the switch could operate stand-alone and a controller.


Wifi light switch or control switch. Flush boxA sort of control operating system running on the esp32 module.  The buttons and LED indicators are connected as I/O.  Tasmota has some scripting ability or connects to something else like Home Assistant via wifi – it’s up to you.

There are probably other firmware options, like ESP Home, but I have only used Tasmota so far.

Be warned – there is a bit of a learning curve and setup required to make best use of the switch.

Would You Like One ?

Wifi light switch or control switch. PDL plateLet us know.  We have parts to build a few of these and will make them available.  I haven’t worked out a price yet but will do as time permits or inquiries demand.

It can be assembled with up to 6 buttons or with one potentiomenter, knob.  Probably 3 switches is a good minimum to securely support the circuit boards.

Leave a comment