-->
Page 1 of 1

ESP-01 not booting up from a 5V supply when GPIO is connecte

PostPosted: Tue Feb 13, 2018 11:20 pm
by aledrus
Hello, I have a quick question, I think I know what the problem is but I don't know what is the normal standard in dealing with this issue.

My ESP-01 boots up fine when GPIO0, GPIO1, GPIO2, & GPIO3 are not connected to anything (floating) - they are all pulled up high internally.

However, I wish to control a relay with the ESP-01. The way I have done that is by connecting the GPIO pin to the base (via a 1k resistor) of a BJT NPN transistor, and the transistor drives the negative relay coil to ground.

But I think where the problem is is the fact that I connected the GPIO pin to the base of an NPN resistor, and this base is +0.7V from the collector (GND). Therefore, when booting up, the ESP-01 sees a "low" at the GPIO pin (transistor base) thus goes into one of the other modes instead of the operation mode.

How do other people handle this?

Re: ESP-01 not booting up from a 5V supply when GPIO is conn

PostPosted: Wed Feb 14, 2018 5:03 am
by btidey
Your analysis is correct. The GPIO only has a high value pull up to make it into the required '1' state at boot time, so a load like a 1K + bipolar junction will make it '0'.

I almost always use MOSFETs now which do not require any drive current so you can connect to the GPIO without pulling it down. You have to use MOSFETS with low gate threshold so they turn on with 3.3V logic.

With bjt you could consider using pnp instead, or even a pnp stage followed by an npn if the relay input wants that.

You should also consider how you want the relay to behave during this boot period as otherwise it can temporarily turn on until you set up the GPIO. You may want to make the logic such that you need an active low on the GPIO to turn the relay on.

Re: ESP-01 not booting up from a 5V supply when GPIO is conn

PostPosted: Wed Feb 14, 2018 11:19 pm
by aledrus
Thank you for your reply. I've not had any experience with MOSFET so I will try the BJT PNP option.
Yes I take note of your advise now I have to figure out how to drive a 5V relay from a 3.3V GPIO