724 B
724 B
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.