Friday, 23 March 2018

Debugging the ESP8266 ESP-01S Relay Module

ESP8266 ESP-01S Relay Module Relay WIFI Smart Socket with ESP-01S

In a previous post I wrote about switching a 5V relay module using the ESP-12E over WiFi. Well just two days ago I spotted this delicious module for just RM26.90. It arrived today- hurrah for Internet commerce!

I powered on - and nothing happened. The red power light on the ESP-01S came on as usual, but there is none of the familiar blue flash on startup.

A little check with a multi-meter revealed that GPIO0 and CH_PD were not at the high (ie 3.3V) voltage level required for startup. A quick search on the Internet unearthed a schematic which confirmed this:

The relay module schematic has no provision for GIO0 and CH_PD tied high
Now it does not mean the module is faulty. It is possible to write a custom firmware for a working module without having to tie GPIO0 and CH_PD high. It is just a NodeMCU thing. Trouble is, the firmware in the attached ESP-01S came with NodeMCU firmware.

The modification is easy enough - I tied GPIO0 high (ie to 3.3V) using a 10K resistor as the schematic showed it was also used to control the relay. CH_PD I tied directly to 3.3V, but you are encouraged to use a 10K resistor as well.

Modifications to GPIO0 and CH_PD

And that was all it took- it powered on quite happily (I used a modified version of the Arduino IDE Blink sketch.

Working ESP-01S relay module
Here is a Youtube video of it clicking away ... Happy Trails.

1 comment: