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

User avatar
By rudy
#63748 That is perfectly acceptable as well. The point is to have two inverter stages. So that a high state (reset state) is also the off state for the relay.

I tend to use transistors because they were the cheapest switches for ages.

Image

R3 is optional as long as the internal pull up resistor is enabled at reset.
User avatar
By btidey
#63753 Original post says that external pull down didn't work. That sounds strange to me.

I find that pull ups are around 36K as measured on an ESP-12. An external pull down of 3.3K gives a default voltage of 0.27V before the sense of the pin is defined which is well below threshold turn on of any relay driver.

This is borne out by check measurements I took. I also checked with a scope and there were no unexpected transients.
User avatar
By sean_intez
#63757
martinayotte wrote:Why not relying on the fact that PullUp can secure the OFF state instead and bringing GPIO to LOW to turn ON the relay ?

in that case when esp8266 is off, gpio is low and relay will be on.
I don't want the state of the relay to change when esp8266 restarts. I need default state of the relay to be off. unless my esp8266 board is connected to power and esp8266 is operating properly and running my code.
User avatar
By sean_intez
#63758
rudy wrote:That is perfectly acceptable as well. The point is to have two inverter stages. So that a high state (reset state) is also the off state for the relay.

I tend to use transistors because they were the cheapest switches for ages.

Image

R3 is optional as long as the internal pull up resistor is enabled at reset.

I will give this a try using a npn and pnp transistors. Thank you.
Do you have any suggestions on resistors value? my relay is also 3v3

edit:
in your suggestion, the relay state changes if the whole circuit loses power, right?