Re: Trouble with ESP-01 + 1Ch 5V relay from LC Technology
Posted: Tue Dec 19, 2017 7:01 pm
I tried all of the above suggestions, but was never able to get the relay to work. I'm done lurking here, so I'm offering a way to get these modules to work. I ordered a bunch of them and couldn't afford to just junk them.
The main issue with this board is the ESP-01 doesn't directly control, the STC15F104-SOP8 microcontroller does. This also means you can't directly retrieve the state of the relay.
Through brute force and a soldering iron, I got the relay module to work doing this:
1. Soldering a jumper on the ESP-01 from VCC to GPIO0.
2. Soldering a 10K pullup resistor from VCC to GPIO2.
3. Desoldering and removing the STC15F104-SOP8 micro controller, being careful not to damage the pin 7 pad.
4. Desoldering and removing R4, the 4.7K resistor connected to the base and emitter of Q1. It only took away base current.
5. Soldered a very fine wire from GPIO2 to the now vacant pin 7 pad where the micro controller used to be.
I then loaded https://github.com/KmanOz/KmanSonoff/tr ... ff_v1.00sc onto the ESP-01. With very few modifications, the code runs on the ESP-01, adds OTA, adds MQTT, allows you to retrieve the relay state, optionally retains relay state when reset and gives you the ability to remotely reset the ESP-01. If you take out or move references to the Sonoff LED, temp/humidity sensor and button, you are left with the relay control code and are good to go.
The serial Rx and Tx connectors on the relay board are still usable for debugging purposes.
The main issue with this board is the ESP-01 doesn't directly control, the STC15F104-SOP8 microcontroller does. This also means you can't directly retrieve the state of the relay.
Through brute force and a soldering iron, I got the relay module to work doing this:
1. Soldering a jumper on the ESP-01 from VCC to GPIO0.
2. Soldering a 10K pullup resistor from VCC to GPIO2.
3. Desoldering and removing the STC15F104-SOP8 micro controller, being careful not to damage the pin 7 pad.
4. Desoldering and removing R4, the 4.7K resistor connected to the base and emitter of Q1. It only took away base current.
5. Soldered a very fine wire from GPIO2 to the now vacant pin 7 pad where the micro controller used to be.
I then loaded https://github.com/KmanOz/KmanSonoff/tr ... ff_v1.00sc onto the ESP-01. With very few modifications, the code runs on the ESP-01, adds OTA, adds MQTT, allows you to retrieve the relay state, optionally retains relay state when reset and gives you the ability to remotely reset the ESP-01. If you take out or move references to the Sonoff LED, temp/humidity sensor and button, you are left with the relay control code and are good to go.
The serial Rx and Tx connectors on the relay board are still usable for debugging purposes.