This is an Esp12-e WiFi MQTT "client" module

intended to add WiFi cotrol to an existing lightswitch (250 watts MAX!),

-and fit inside the existing electrical wall box. (Retrofit).

The circuit uses a 250 watt Songle (125vac@2amp) SPDT Form "C" relay,

everything is powered from 100Vac<240Vac

using a Hi-Link HLK-PM03 3.3Vdc supply.

Step 1: Get the Parts!

You can get a kit of parts from Digi-Key by clicking HERE

The Hi-Link HL03 power supply was purchased on eBay HERE

The Esp12-e was purchased on eBay HERE

You can download the PC board CAD file by clicking HERE

The .pcb file uses ExpressPCB Cad, downloaded by clicking HERE

Step 2: Solder It!

video to follow...

Step 3: Program It!


Here's a generic program to run the WiFi 3Way as an MQTT client-


-download and run in ArduinoIDE. It will create it's own folder (required by Arduino).

Be sure you have the libraries installed and updated-

ESP8266WiFi.h ,

PubSubClient.h ,



Select "Generic ESP8266" under tools/board select.

In the ArduinoIDE MQTT3Way script, be sure to set YOUR SSID, Password, and MQTT server IP address.

Properly connect a FT232RL to the WiFi 3-Way device to your computer and ensure all drivers load correctly.

Insure that the proper port adapter appears in device manager and Arduino addresses the COM port that your FT232RL is connected to. Select 115200 baud in the ArduinoIDE menu..

Place a shorting block between GPIO 0 and Gnd. Leave it for initial powerup to set the Esp12-e into FLASH burn mode.

Connect the FTDI cable Gnd to 3-Way (-)

Connect the FTDI TX to the 3-Way (RX)

Connect the FTDI RX to the 3-Way (TX)

Connect the FTDI 3v3 to the 3-Way (+)

-select "Sketch/Upload" on the ArduinoIDE.

AFTER the progress dots(...............) appear, remove the shorting block on GPIO o and ground.

After the progress bar reaches 100%, remove the FT232 and everything. You are set to go!

-Now, add the device to your MQTT dashboard!

<p>This works like a champ!</p>
<p>This is an instruction for what?</p>
<p>PC board,<br>MQTT Client WiFi 3-way RETROFIT for 120V Lighting/Switching</p>
<p>PC board updated 3/28/17 ;) Added HV clearance, removed un-needed #14ga througholes.</p>

About This Instructable




Bio: C10 Electrical (General) Contractor Lic.#766331 HighTech Electric (Retired) I built custom estates, specializing in high tech, IoT, access controls, security and communications. Now I ... More »
More by WilliamB211:MQTT Client WiFi 3-way RETROFIT for 120V Lighting/Switching WiFi SolarPV Disconnect With Voltage Monitoring 4 WiFi IoT Boards Every IoT Pro Needs- 
Add instructable to: