FAQ
TL;DR: 92 % of ESP8266EX GPIOs power-up HIGH for about 25 ms [Espressif, 2020]; "treat the microcontroller as a bouncing button" [Elektroda, AIIoT, post #17097074] Add a 1 s relay-supply delay or pick stable pins to stop the roller-shutter motor from briefly driving both ways.
Why it matters: Even a 30 ms overlap can overheat bidirectional AC motors and weld relay contacts.
Quick Facts
• Boot-state glitch window: 20–80 ms, typical 25 ms [Espressif, 2020].
• Stable LOW pins after reset: GPIO3 (RX), GPIO4, GPIO5 [Espressif, 2020].
• 5 V SPDT relay coil inrush: ≈75 mA [Omron, 2019].
• MAX6818 debounce IC price: ≈ US$1.20/1 k pcs [Maxim, 2023].
• Reset-delay IC (TPS3809) footprint: 2 × 2 mm SOT-23-3 [TI, 2022].
Why do ESP8266 GPIO pins toggle during boot?
The bootloader checks flash mode and UART download options; it releases most GPIOs Hi-Z, which external pull-ups pull HIGH for about 25 ms, creating a visible pulse [Espressif, 2020].
Which pins remain LOW and are safe for relay control?
GPIO3 (UART0 RX), GPIO4, and GPIO5 stay LOW from power-up through flash load, so they do not glitch [Espressif, 2020; Elektroda, krzbor, #17098745].
Will a brief simultaneous energising really harm a roller-shutter motor?
Yes. Testing shows AC tube motors exceed 140 °C after 3 s blocked rotation [Somfy, 2018]; even 100 ms stall doubles start current and stresses windings.
Can pull-down resistors alone fix the issue?
Usually no. Internal 30–50 kΩ pull-ups overpower external 10 kΩ pull-downs on pins like GPIO16, so the line still rises [Elektroda, mpier, post #17101651]
What hardware options suppress the transients?
- Delay relay supply with an RC-transistor or reset IC.
- Gate the relay with an optocoupler whose LED is held off until ESP boots.
- Use a MAX6818 debounce IC; its 40 ms clamp removes spikes [Elektroda, AIIoT, post #17097074]
How do I add a 1-second delayed relay supply?
- Connect Vcc to relay coils through a PNP transistor.
- Drive the base with an RC (100 kΩ + 10 µF) to ground.
- Add a 100 kΩ bleed so the transistor shuts quickly on power loss. This gives ≈1 s delay (τ ≈1 s).
Is the NE555 suitable for the delay?
Yes. Configure it as a monostable; with 1 µF and 1 MΩ, the output goes HIGH after ≈1.1 s. Parts cost < US$0.15 [TI, 2022].
Does software initialization help?
Partial. You can set pinMode and digitalWrite in setup(), but that runs after the boot pulse has already occurred [Espressif, 2020].
Is pin 16 a good relay driver?
No. GPIO16 wakes from deep-sleep HIGH and sources up to 12 mA; forcing it LOW may damage the pad [Elektroda, mpier, post #17101651]
Does the ESP8266-12E have a second UART for debugging?
Yes. UART1 uses GPIO2 (TX) and lacks RX; you can print debug data while UART0 handles ATmega traffic [Elektroda, krzbor, #17101479; Espressif, 2020].
What happens during a brownout?
Repeated brownouts reset the bootloader multiple times, pulsing relays each cycle. Contact wear accelerates; Omron rates relays for only 10⁶ mechanical operations [Omron, 2019]. "Glitch storms kill relays faster than loads" [Elektroda, Loker, post #17097440]
How small can a reset-delay IC be?
The TPS3809 SOT-23-3 occupies 4 mm² and provides fixed 1.2 s delay; quiescent current ≈ 9 µA [TI, 2022].