Switch a relay with mqtt via wifi.
Go to file
2020-12-05 23:59:23 +01:00
cicurit Added source code and schematic. 2020-12-05 23:44:43 +01:00
src Added source code and schematic. 2020-12-05 23:44:43 +01:00
README.md Added source code and schematic. 2020-12-05 23:59:23 +01:00

3D-Image

Wifi-Relay

This schematic and code can be used to build up a relay, which can be switched over wifi by sending on/off commands to a MQTT channel.

Cicurit / Board

The cicurit is build upon a ESP-01 (ESP8266) module which GPIO2 pin switches the relay. To program the ESP-01 one may solder a pin socket on the board and put the ESP-01 in, instead of soldering it directly onto the board ;-)

Source

The code is quite simple. It connects to a MQTT broker and subscribes to a channel /<Hostname>/relay to recieve the on/off command. The current state of the relay is then published to the channel /<Hostname>/relay/state.

Enjoy.