AdamMiltonBarker wrote:Well not able to admit defeat I spent some time over my lunch break and found out that in the case of the barebones version it was the pullup resistor, if I removed the resistor and connected the middle leg to 3.3v directly it worked.
Following this I reset up the ESP into the circuit and I now have strange issues, I cannot upload without GPIO2 connected directly to 3.3 without resistor and then the relay will not turn on without the 3.3 being removed, then after that I cannot reset without it connected.
It also keeps crashing serial monitor when the light is connected to the relay and I have to restart the computer.
Hi, you need an opto-coupler if you going to switch mains or you'll just run into a whole world of pain. It will also cure most of the boot and reset issues as well, the only down side is random switching at boot and that can be fixed.
[youtube]https://www.youtube.com/embed/APoJoaRtRZw[/youtube]