Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
Code_for_moisture_sensor_2.txt
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.
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!
CONTRIBUTE TO THIS THREAD