The use of the ESP8266 in the world of IoT

User avatar
By vaiojasard
#88069 Hi folks!

I'm using an ESP01 to drive a relay. I'm using GPIO2 (the only one free to use). I noticed that it goes high on power on/start and then down after a short delay. How could I avoid the relay being powered up while the ESP start up process?

Thanks in advance!

Best regards!
User avatar
By pangolin
#88070 GPIO2 NEEDS to be pulled up at boot time for the ESP-01 to run. You must either rewire your relay to take this into account, or reprogram your code - or both i.e make it "active low" rather than the more common "active high".

Second option is to us GPIO1 or 3 and compile with NO_GLOBAL_SERIAL but of course you will then not be able to use TX/RX (Serial) while running. You can still upload with FTDI etc as long as you isolate the relay first.

Third option: spend $2 on a wemos D1 mini which is FAR easier to use, FAR more capable and has none of these problems.