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

User avatar
By roccomuso
#23826 Hi guys, here i am, again, asking for help.

I'm using a ESP8266-01 directly connected to a Solid state Relay on GPIO-02. Everything is powered through a LM2596 3.3V. If i power the esp8266 being already connected to the relay, the GPIO results HIGH (and so the relay is ON) on the startup, moreover the web server doesn't start.. On the contrary if i power the esp8266 and THEN i connect the relay to the GPIO-02 everything works great... Why? what should i do? :?:

Image
User avatar
By martinayotte
#23831 Are you driving your relay with GPIO2 on the anode side and the cathode to GND ?
In such case, it is acting as a PullDown which prevent to boot in EXEC mode (it is then in UPLOAD mode).
You can switch your relay connections to so that GPIO2 is driving the cathode and having the anode to VCC, this means that in your software placing the GPIO to LOW will turn ON the relay while HIGH will turn it off.
User avatar
By roccomuso
#23839 Yes, I'm connecting the Catode to GND and Anode to the GPIO2.

So are you suggesting me to switch the cable right?

There isn't a way to make it works in the logical manner? high -> relay ON ||| low -> relay OFF

Thanks
User avatar
By martinayotte
#23841 Yes, switching the connection will make it works.
Of course, if you wish to keep the logical manner, it can be done some transistors, but still you will needs to have a PullUp to boot in EXEC mode at power up, and that means your relay will be ON at power up, I presume you don't want that.
Other solution also exists, like adding a I2C GPIOs Expander such as MCP23017.