Chat freely about anything...

User avatar
By Tirinete
#45263 I'm trying to use the GPIO00 and 02 as an output, but, on start up, they're linked in a circuit with a transistor that triggers a 5v relay.

The problem is, when the esp8266 is starting, the GPIO's are linked in base pin of the transistor, and so, doesn't run the firmware, doesn't start the logic inside him.

I googled, i searched here in this forum, but, nothing that i read, helped me to resolve this question.

I know that i can use the I2C to expand the IO's, but, i don't want.

What can i do about this?

Sorry about my poor english.

Regards.

J Moura.
User avatar
By martinayotte
#45277 Your searches were not thoroughly done, because there are plenty of questions/answers about this subject.

First, lets explain GPIO behaviour when used as output :

viewtopic.php?f=13&t=7741&p=39319&hilit=source+sink#p39319
viewtopic.php?f=6&t=7412&p=37706&hilit=source+sink#p37696

Now, since you are using a transistor to drive the relay :

viewtopic.php?f=13&t=9441&p=45219&hilit=MPSA13#p45219

In conclusion, the GPIO idle state should always be the same level as the require Boot state.
Since both GPIO2/GPIO0 need to be HIGH for proper boot, your relay circuit need to be HIGH when relay is OFF, so as explain in the last link, you need 2 NPN transistors, the first one to invert the GPIO level, and the second to drive the current to the relay. Those NPN can also be replaced by MOSFETs.
User avatar
By mike005
#66632 thanks martin for useful information...I'm facing the same problem with GPIO 0, 15, 10 & 16 i mean realys trun on for almost 1 second while reset. how can i solve this problem for GPIO10 & 16. by the way i'm using ULN2003 to trigger 12v relays.

thanks in advance,