Chat freely about anything...

User avatar
By martinayotte
#21796
Cosmic Mac wrote:Oh, and even if I'm not always comfortable with English, that does not prevent me to appreciate what you write. ;)
Keep posting, keep sharing, for people like me, for all those who do not have your expertise.

Thanks, it is appreciated !
(BTW, me too, english is not my native language ;) )
In summary, for all those threads, I've never said that floating pins wouldn't work, but it is not a good practice. On the other side, I've never seen or heard about a case where the pullup would prevent ESP to work properly.
Ciao !
User avatar
By Stoney
#21798
kenn wrote:
pete_l wrote:My plan is to use an ESP-01 (the one with two GPIO pins exposed) in a simple application where one pin is used as an input and is connected to a PIR and the other GPIO is an output that activates a floodlight.
This is a pretty simple security light type of device with the obvious advantage of being web-connected.

The problem that kills this application stone dead is the ESP8266 bootloader. When power is applied, both GPIO pins are set as inputs and their state (logic 0 or 1) determines whether the ESP-01 will run user code (when both are at logic 1) or whether it enters a state for loading firmware. However, it appears that the only state that allows user code will be executed after a power-up is for both GPIO0 and GPIO2 to be at a "1". With a PIR connected to one of these input pins it's obvious that this situation cannot be guaranteed.


1) use GPIO2 as the PIR input

2) use GPIO0 as the output that controls the floodlight, but negative logic: 0 on GPIO0 = light on. Use a 5k pullup or similar on GPIO0 if your floodlight driver circuit doesn't already provide pull-up to GPIO0.

This should work fine using an ESP-01 with stock bootloader.


but what if the PIR pulls GPIO2 low at boot time, you are stuck in a no boot mode.
both GPIO0 and 2 need to be high or she no go good ..
User avatar
By kenn
#21815
Stoney wrote:
but what if the PIR pulls GPIO2 low at boot time, you are stuck in a no boot mode.
both GPIO0 and 2 need to be high or she no go good ..


As I mentioned in the other GPIO0/2 thread, it's not stated in any of the docs I've found that it won't boot to flash correctly if GPIO2 is low at startup. I found in the official hardware guide that it's OK if GPIO2 floats at boot.

I'm gonna try pulling GPIO2 low at boot later to see.