ESP8266 Relay Stays On – Why Won’t It Turn Off?

Hi, I bought a kit on Amazon that I'm trying to control with an ESP8266. I’ve successfully uploaded the code to the ESP8266 and can monitor the readings from a capacitive moisture sensor through the serial port. I’ve also calibrated the software to trigger a relay that turns ON with LOW level to control a pump. While the serial monitor and relay indicator lights show the pump is turning on and off as expected, the relay itself stays on. The only way to turn it off is by disconnecting the 'In' pin or the VCC. I'm powering the relay through the 'Vin' pin, which measures 4.6V. I’ve also tried using the 3.3V pin from the ESP8266, but the issue remains the same."
attachment 0
attachment 1
3 Replies
JeremyCook
JeremyCook2w ago
If I was trying to troubleshoot this, maybe look at the relay separately from everything else. Hook up the input VCC and Gnd to an independent power supply, then toggle the input pin to high and to low and see what the response is. If it's clicking/changing where the COM connects or if it's not that tells you something. You might even hook up the motor in such a manual setup too to see if it controls things. The other thing you might consider is whether the motor is drawing too much current for the power supply it is hooked up to. Seems like I ran into a situation long ago where I was attemting to run a motor with a much-too-small relay and it would get stuck on. Not quite the same situation, but something to consider. Finally, what type of relay to you have? This sort of operation might be normal depending, but the docs and/or the fist test should give you some indication.
aymen ammari
aymen ammari2w ago
Thanks for the suggestions JEREMY ! I tried the first one with a separate power supply, and it worked fine. The relay toggled properly when I switched the input pin between high and low. Regarding your second point, I think you're right—it could be related to the motor drawing too much current for the power supply. I had a similar thought, and I'll check if that's the issue. As for the relay, it's a [ srd 05vdc sl c] with Chinese module , I'll review the documentation again to see if this behavior is normal. Appreciate the advice!
Want results from more Discord servers?
Add your server