My connections:
GND (Relay) → GND (ESP32)
VCC (Relay) → 5V (ESP32)
IN (Relay) → GPIO13 (ESP32)
COM (Relay) → Positive terminal of Solenoid (+)
NO (Relay) → Positive terminal of 12V Power Supply (+)
Negative terminal of Solenoid (-) → Negative terminal of 12V Power Supply (-)
Relay Details:
The relay I’m using is low-triggered, where 0 opens the solenoid and 1 closes it.
Problem:
When I connect the ESP32 to my laptop and turn on the 12V power supply, the solenoid opens as expected but remains open indefinitely. However, my code is designed to alternate the solenoid’s state (open/close) every 5 seconds.
To troubleshoot, I tried using a more advanced relay module with additional ports for JD-VCC and JD-GND, which I connected to the 12V power supply. The relay also had three pins labeled with H and L, seemingly to configure high-trigger or low-trigger modes. Assuming this, I placed a jumper between the H pin and the middle pin to make the relay high-triggered.
Unfortunately, with this setup, I believe I damaged my ESP32. After connecting the ESP32 to my laptop and powering the 12V supply, the ESP32’s communication port became unresponsive, and it is no longer connecting to my system.
Could anyone please help me identify the issue and provide guidance to resolve it?
My connections with advanced relay:
GND (Relay) → GND (ESP32)
VCC (Relay) → 5V (ESP32)
IN (Relay) → GPIO13 (ESP32)
COM (Relay) → Positive terminal of Solenoid (+)
NO (Relay) → Positive terminal of 12V Power Supply (+)
Negative terminal of Solenoid (-) → Negative terminal of 12V Power Supply (-)
Just after taking this picture i noticed that, in the image of advanced relay we have JD+, DC+ and JD -, DC- they had jumper in them, i forced a male pin in that jumper and connected it to 12v source, instead of removing that jumper and connecting JD+,JD- to 12v source, i know its a dumb move from my side, probably it would have caused damage to esp32. Normally connecting the JD-,JD+to 12v source should work right?
You definitely want to make sure that the relay isn’t configured in a way that puts more than 5V on an ESP32 GPIO. Really it shouldn’t be more than 3.3V but they may be tolerant of 5V. More than that can destroy the ESP32, though. You can probe that with the voltmeter before hooking it up to the ESP32.
I connected components based on the above mentioned connections, in that i did not connect IN pin in relay to gpio, then i placed the red probe in my multimeter to that IN port and black port to a grnd and i got 0voltage as reading. Is this what you wanted me to test or something else?
Pictures with your text would make it easier to follow.
But yes, as long as you did that with JD_Vcc supplied to the relay board and had the grounds connected, that’s what I meant.
I don’t have one of these modules to play with myself, so I’m just going by what I read on that page I linked to and hoping it is right. Assuming that…
If you connected Vcc to either 5V or 3V3 on the ESP32 and also connected the JD_Vcc jumper, you were putting 12V onto the 5V or 3V3 of the ESP32, which would definitely “let out the magic smoke” — destroy it.
In the page I linked to above, you’ll find this image:
This is similar to the setup i followed. The only difference is
My connection:
COM (Relay) → Positive terminal of Solenoid (+)
NO (Relay) → Positive terminal of 12V Power Supply (+)
Connection you suggest:
COM to +12V on your power supply
NO or NC to positive terminal of your solenoid
I will be working on this project only next week, when i do i’ll make sure to follow the link you provided. Thanks once again !