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!

Step 1 of 5

CREATE YOUR PROFILE *Required

OR
Step 2 of 5

WHAT BRINGS YOU TO DEVHEADS? *Choose 1 or more

Collaboration & Work 🤝
Learn & Grow 📚
Contribute Experience & Expertise 🔧
Step 3 of 5

WHAT'S YOUR INTEREST OR EXPERTISE? *Choose 1 or more

Hardware & Design 💡
Embedded Software 💻
Edge Networking
Step 4 of 5

Personalize your profile

Step 5 of 5

Read & agree to our COMMUNITY RULES

  1. We want this server to be a welcoming space! Treat everyone with respect. Absolutely no harassment, witch hunting, sexism, racism, or hate speech will be tolerated.
  2. If you see something against the rules or something that makes you feel unsafe, let staff know by messaging @admin in the "support-tickets" tab in the Live DevChat menu.
  3. No age-restricted, obscene or NSFW content. This includes text, images, or links featuring nudity, sex, hard violence, or other graphically disturbing content.
  4. No spam. This includes DMing fellow members.
  5. You must be over the age of 18 years old to participate in our community.
  6. Our community uses Answer Overflow to index content on the web. By posting in this channel your messages will be indexed on the worldwide web to help others find answers.
  7. You agree to our Terms of Service (https://www.devheads.io/terms-of-service/) and Privacy Policy (https://www.devheads.io/privacy-policy)
By clicking "Finish", you have read and agreed to the our Terms of Service and Privacy Policy.

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.”
file1.jpg

  1. heidi.tech#0
  2. JeremyCook#0000

    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.

  3. aymen ammari#0000

    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

Leaderboard

RANKED BY XP

All time
  • 1.
    Avatar
    @Nayel115
    1620 XP
  • 2.
    Avatar
    @UcGee
    650 XP
  • 3.
    Avatar
    @melta101
    600 XP
  • 4.
    Avatar
    @lifegochi
    250 XP
  • 5.
    Avatar
    @Youuce
    180 XP
  • 6.
    Avatar
    @hemalchevli
    170 XP