ESP32 always activating relay

Good day everyone! :slight_smile: I'm trying to use an ESP32 with a JQC3F-05VDC-C relay to activate an electrovalve. However, the relay always activates, no matter if the ESP32 pin in (25), to which the IN pin in the relay is connected to, is HIGH or LOW. I've seen in different videos that everyone uses the SRD-05VDC-SL-A relay. I'm willing to get it shipped, but I just want to double check if you have any experience working with any of these two models. Thank you! I add an image of how I've connected my circuit, the only thing that changes is the pin. :slight_smile:

If a Schematic, not a frizzy thing, were included it would make finding your problem much easier. It may be operating as specified, not as you wanted. VIN is an input on the ESP, not a 5V out. Use your meter and see if you have 5 volts on the relay. If not your power supply is not connected properly. Be sure the grounds are all connected. Check the ESP with your volt meter and see if the port pin goes high and low when expected and measure the voltage, If it goes from about 0 to about 3.5 volts the ESP is OK. If not try some simple software just to cycle that pin, if it does not work the ESP is fried. Disconnect the relay input from the ESP and try connecting the relay input to +5 then ground, and see if it works. If it is 3.5V maybe on a day when the moon comes up on the correct side of the sun it may work. Looking at the data for the relay it shows 3.75 as the minimum pickup voltage. Remember read the data sheet, all of your questions are answered on it. you can find it here: Datasheet SRD Songle Relay - Preview and Download

  • The datasheet shows the 5vdc coil with a resistance of 70R. At 5v that's drawing 71 mA (operating) and maybe double that in activation. The limit on the IO pins is 40mA. The relay may have already damaged the IO port.
  • The relay has no inbuilt back-EMF protection. If your circuit does not include a shunt (usually a diode) to protect the IO pin from back-EMF, then it's likely the pin has failed. Have you metered the pin or are you assuming that if you set it, it is outputting the expected value?
  • Note all the points in gilshultz note above.

I have the same issue. If I replace the relay signal pine (IN1) with an LED (and then to ground), the LED flashes. I moved output pins, but makes to difference to IN1. IN1 is always high.

Further to above, Adrunio digital pin works relay fine, esp32 does not. Voltage check of pin on esp32 measured going from 0V (low) to 4V (high), yet relay will not operate.