The use of the ESP8266 in the world of IoT

User avatar
By Chris_Hopper
#95566 I’m using an ESP 8266 to control a pair of relays. The relays are switched by transistors, with 4k7 base resistors to the ESP outputs and with the transistor emitters connected to 0V. For convenience I’ve prototyped this using a D1-mini board (using an ESP8266MOD) and it works nicely. Now I’ve connected the ESP-01 (using an ESP8266EX) that I want to use because is plugs onto the relay board, and things are different!

Firstly the transistors pull GPIO0 and GPIO2 low, so the ESP-01 doesn’t boot. I’ve overcome that by fitting 3k3 pullups from the GPIO pins to 3.3V. Like this I can communicate with the ESP-01 over WiFi, so it’s definitely running. However, the GPIOs fail to drive. They sit at 2.2V, no matter whether I drive them high or low. I’ve removed the ESP-01 and shorted each GPIO connection on the relay PCB to 0V through an ammeter, and 1mA flows as expected. If I short from 3.3V to the GPIO connection 0.51mA flows, which also seems reasonable, so I know the circuit is connected properly. And anyway, it works with the D1-mini board like this.

The data says the GPIOs can drive 12mA. It’s not clear from the data whether it can sink as much current as it can source but there are plenty of example circuits around using 3k3 pullups so I’d have thought it could sink a reasonable current.

I have two ESP-01 boards and two ESP-01S boards, and they all behave the same. I’m not aware of having done anything that would have damaged the outputs, and when I disconnect the relay board I can measure 0V and 3.3V on the GPIO pins as I exercise them, so the devices don’t seem to be broken. Obviously I've configured the GPIOs as outputs for this to work.

Has anyone else run into a problem like this? Are the outputs on the ESP8266EX different to the ESP8266MOD? Is there any different configuration required for the differnet parts - if they are different?