This is more of an experience-driven question than a datasheet/technically detailed one.
I'm designing a circuit, using ESP01s, for activating electrical lock of external house gate.
Apart from all the aspects of cyber security (that of course I'm dealing with as much as possible), is there any "hardware" precaution, moving from your experience, that I have to manage to avoid any unintentional raise in output pin?
The architecture is very simple: a network message (encrypted and with pass keys) is sent to esp-01 to let it raise the output pin (say PIN0); it will activate a relay for a certain amount of time.
Should I prefer a particular pin (PIN0..3) to serve the purpose (and why)?
Is there any precaution I have to put in place so as to avoid, especially during reset/reboot/setup (NO for firmware loading, it's not meant to take place over the air or attached to the main circuitry so far), that that pin goes high?
I have to make sure that any unintentional event will cause this condition.
Thank you for the reply.
Yes, it will surely be under pull-down resistor. I was thinking of some initial condition (during initialisation after reset, for instance) where the ESP could internally put the output pin high. Is there any PIN on ESP01 that might behave like that?
As far as the relay is concerned, it's driven through a mosfet, already tested.
Try that with 4k7 pullup.
If it's not behaving well, try gpio0 with same setup.
I can't guarantee, Esp8266 pins are quite restless at boot. Only Gpio4 and 5 are rock solid. Which you don't have exposed.
Thanks to all your contributes, I've complicated the solution a bit to allow for the issues you raised. Below the scheme: note that I've used only components that I have already available; that could explain some "weird" or "tangled" choice.
The logic follows: I've read that TX pin (GPIO1) always sends something out when the device (re)boots (usually ets Jan [...]). So, I'm expecting that during normal ops, the PIN is high (I'm using a pull-up resistor just to be sure). I'm going to use this PIN for flagging reboot (including software).
When a (re)boot happens, the TX pin changes state and it triggers an NE555 (monostable configuration), whose output is used as an ENABLE signal (active low): by doing this, for 1 second after TX pin has gone low, the trigger is inhibited.
Only when TX pin is stable high, the GPIO2 can be used to trigger the RELAY (active low again).
NOTE: I'm going to use HCF4023B (supports 12V Vcc) instead of SN74HC10; in Spice I've used this latter just because I found the model online.
Do you see any weakness?
The alternative is to use an ATmega328P to raise the trigger with a I2C communication with ESP01.