Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By seaspac
#70021 When ESP8266 is powered up and determining boot mode 60ms according to the datasheet, what is the state of GPIO pins, other than GPIO0, GPIO15 and GPIO2. If I drive a relay would be turned ON momentarily and then initialized to OFF, I need to avoid startup jitter on the relays. essentialy I need to know before initiliazing the GPIOs they are at logic LOW, HIGH or floating.

Thanks and Best Regards
User avatar
By rudy
#70081
I need to know before initiliazing the GPIOs they are at logic LOW, HIGH or floating.


GPIO4 and GPIO5 are floating and safe to use. All the rest are not. I will sometimes use GPIO15 to drive a relay (with a transistor) as it is low on start up. GPIO 12, 13, 14 all have weak pullups enabled on start. GPIO16 has a strong high.

GPIO12, 13, 14, and 16 can be used if you needed to but it is more of a pain. One way would be for the pin to drive a pnp transistor that would require a low to turn on, that would in turn the relay on. But since we are dealing with a 3 volt level then a npn transistor could then be used to drive a higher voltage relay. Yeah, all a pain in the ass. It just depends on what your needs are.

GPIO12, 13, 14 have a weak high and that can be negated with a low enough value resistor to ground and then you may be able to use a mosfet with a gate turn on voltage that is higher than a bipolar transistor's turn on voltage. Might be flaky unless you get the right components.

More complete details on the port pins can be found at https://www.mjt.me.uk/posts/esp8266-gpi ... and-reset/
User avatar
By trackerj
#70099 If you need to drive more that 2 relays for which you can use GPIO4 and 5 (if free) I think is better to use a GPIO Port expander like the PCF8574 or similar. You have a way better control on it.

You can find a lot of related information's in the ESP8266 Analog extension board AN-1 series HERE and HERE. Also used it for my MPRSx8 Home automation board, more details HERE in the related article.

If you need even more, you can use 2 of them with different I2C address or the bigger brother PCF8575 - 16 GPIO lines, details HERE.

Happy breadboarding,
TJ.