An issue with esp8266 and relay

Hi all
I connected a circuit with esp8266 01 , a relay , optcoupler and a driving transistor all with blynk and WORKS well ! The problem is when powering OFF this circuit and ON again I listen to the relay connection sound and esp8266 never connected to wifi and only disconnecting gpio port driving the relay and repowering the circuit again … thus reconnects the esp8266 … then I need to connect the gpio port to drive the relay again …
I need a solution that if power goes OFF and ON again the circuit works without any modification

Thanks in advance

Esp8266 pins have some specific behavior when cycling on/off… Have a look around you will find what pins is safe to use on those conditions

1 Like

The ESP-01 only has a few limited GPIO available, and it’s startup operation will be affected depending on GPIO state when booting (Google for all that… for example)… So, without knowing much more about your circuit and code, we can only guess as to your situation.

1 Like

I added my circuit … It works fine until power is OFF … then I must disconnect the point marked (1) at diagram … then powering circuit and reconnect the point (1) after esp01 is wifi conncted again …
GIPO 0 and GIPO 2 works well with leds
The code is the blynk sktech without any modification

If you take a look at this post, you’ll see that both GPIO0 and GPIO2 must be HIGH during the boot sequence:

I’m assuming that your circuit is pulling the pin that it’s connected to LOW, so your ESP isn’t booting.

Maybe time to redesign your circuit?

Pete.

2 Likes

Wow :grinning: you are the man :blush:… Thanks a lot … I really did it … your post is really good solved my issue … I pulled up the two output gipo0 and gipo2 with 2k resistors and also the RST as well , and it works good with powering circuit ON/OFF …
I will just test the relay as well and sure it will work … Thanks again and here the circuit I worked according to it !

1 Like