Running esp8266 esp-01s 5V 1 channel relay(STC chip)
Posted:
Thu Aug 02, 2018 11:16 pm
by rituj_b
I have been trying to run this relay board (
https://www.banggood.com/DC-5V-One-Chan ... 03052.html) with the GPIO pins but I later found out that this does not use GPIO at all. So I tried looking at various commands to write with the Serial.write() function but none have been successful.
I have contacted the Seller but he is not replying to my questions as to what commands should I send to the STC chip via Serial to turn the relay on and off.
http://files.banggood.com/2018/06/SKU728995.zip This is the source code provided by hiim but being new to ESP domain I haven't been able to figure out how should I do it.
Any help would be appreciated.
Re: Running esp8266 esp-01s 5V 1 channel relay(STC chip)
Posted:
Sat Aug 04, 2018 4:09 am
by PtrO
This relayboard IS using GPIO0 (zero) for (only) controlling the Relay via GPIO0... which is also the problem in itself. This GPIO0 on the esp01S relay board is pulled down to ground which during power-up simply prevents that the inserted ESP-E01 will read/boot from flash. A special branded esp8266 bootloader may/can change this behavior.
For us, we have to remove a small (SMD) resistor (10kOhm marked 103E). Not difficult but it require some tiny-(de)solder activities.
Furthermore, the ESP8266-E01 has CHipPowerDown PIN that, left unconnected, instructs that ESP8266 to go in low-power mode after initialisation. This great "feature" prevent your void/main() flashed program image will run. One can CHPD mode if and when you code/program your image accordingly. When programming for low-power, you program the ESP such that it will actually do all the work during the device SetUp() stage.
What I did, as I want the use the ESP8266 in the normal continuous Main()_loop mode, I simply wire the CHPD pin to VCC (3.3v) by whch it will never go into low-power mode.
Re: Running esp8266 esp-01s 5V 1 channel relay(STC chip)
Posted:
Sun Aug 05, 2018 2:51 pm
by PtrO
The board IS using GPIO0 which control the relay, however a 10k resistor pulls the (base) GPIO0 to ground which effectively set the esp01 into UART boot mode. One have to remove (desolder) this SMD mounted resistor. In addition, you need to pullup/wire the CHipPowerDown pin to VCC (3.3v) in order to execute esp01 mainloop.