I'm making a WiFi power strip with a Wemos D1 mini v3 (ESP8266) microcontroller and a 4 mechanical relay board. 220v mains is converted to 5v 600mA using a HLK-PM01 which powers both the relay board and the ESP8266. Now I'm using 4 standard AC rated switches as a digital input each of which are wired to a 10k pull up resistor. The whole setup worked for some time (while I tested everything) and then I take it for a demo just then the ESP stops booting up (have tried with MongooseOS and Tasmota firmware) when plugged in the circuit made on the protoboard. Here are the schematics, sorry for the mess.. I'm new to Fritzing.


The microcontroller works just fine once it's disconnected from this circuit. I can't seem to understand what's wrong. Appreciate the help!

  • \$\begingroup\$ You don't need AC rated switch for digital input ! \$\endgroup\$
    – Long Pham
    Apr 18, 2018 at 17:27
  • \$\begingroup\$ @LongPham Yeah you are right. The idea is the replace existing light switches in the house with minimal changes while also having the options to go back to dumb switches if need be. \$\endgroup\$
    – Birla
    Apr 18, 2018 at 17:34
  • \$\begingroup\$ I think it will be difficult to find a solution for this problem remotely from what you've described. I would assume there is a bridge on your protoboard that is causing problems. \$\endgroup\$
    – loudnoises
    Apr 18, 2018 at 17:46
  • \$\begingroup\$ @loudnoises Thanks for the feedback. I thought so too so checked and rechecked the protoboard visually and using a multimeter with no faults founds. Btw could pulling the GPIOs high via the pull up be causing the esp to go in some other mode? \$\endgroup\$
    – Birla
    Apr 19, 2018 at 4:19
  • \$\begingroup\$ Also, if I power the board before plugging it into the circuit everything works as expected. This makes me suspect the GPIO connections to VCC or GND even more. \$\endgroup\$
    – Birla
    Apr 19, 2018 at 4:29

1 Answer 1


The root of the problem is using home electrical switches instead of momentary switches. These switches are SPST, not two-way (or three-way) switches, and they are connected to 4 GPIO pins including D8/GPIO15 which is used for flashing the ESP8266 (on Wemos D1 mini v3). Now the switches give a digital input to the ESP and trigger a toggle to the relay whenever the state changes meaning that it's possible for the switch connected to GPIO15 to be in a closed state (pulled down) at boot which causes the ESP to not boot the OS.

TLDR; I fixed it by using D1/GPIO5 as the input for the switch and configured TX as output for the relay which was initially connected to one of the relays (output). Instead of TX, I could have connected the relay to GPIO15 but since the wires were already in place I chose not to do so.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.