The physical build & isolation is not the best as it was a last minute job before I went on holiday, and had the intention to rebuild it when I got back home - but as per usual I never got around to it...
The Wemos D1 Mini has the following connections;
- A removable link between pins RST & D0. It must be removed when uploading a sketch, but replaced afterwards to ensure that the Wemos can wake up from deep sleep.
- Pins 5V & Ground connected to the relay module +Vcc & Grd.
- Pin D7 connected to relay module trigger.
- The Wemos sketch is configured for the above, and only needs the wifi ssid & password adding, before uploading.
The relay module is a typical Ebay/AliExpress opto-isolated 5V single channel module with 3 low voltage connections (as above), and note that on the module shown, 0V on the module trigger energises the relay whilst +3V de-energises!
The high voltage side has 3 connections; normally closed, common & normally open. I've used normally closed & common, so in it's normal state the relay is de-energised but the contacts are closed.
Please Note - Working with high voltages can be dangerous, and shouldn't be attempted unless you are fully aware of the associated risks.