Esp32 v4 cant turn off relay

Hi im currently working on my project for my IOT course im working on a simple project that uses the esp32 v4, 5v relay, 12v battery, and a solenoid lock. i've tested the solenoid and battery and it works fine, now here are my problems and some troubleshoots that i did

  1. if i connect the vcc pin from relay to the 3.3v pin on the esp32 the relay works fine as it turn on and off whenever i put low and high in my code, but after i connect the solenoid lock the relay still turn on and off but it looks like the solenoid doesn't get any power even when the relay is on.

  2. if i connect the vcc pin from relay to the 5v pin on the esp32 the relay cant turn off even if i put low in my code, but because of this the solenoid lock does powered up. but still its always powered up because the relay cant seem to turn off.

do any of you guys know whats the problem here, because i already followed steps from youtube building this and everybody else worked fine. before i got the esp32 v4 i had the v1 and i thought that i can solve this problem if i use the v4 because it has a 5v pin and the v1 max voltage is just 3.3.

which relay are you using?

Whatever that is, it is more than likely not an Arduino Nano ESP32. Hence topic moved.

A 5V relay won't work on 3.3V. You should not connect a 5V relay to a controller that has 3.3V I/O like the ESP
If you have a datasheet for the relay, post it here. If not, then post a link to the webpage for the relay you are actually using, no videos please.

im using a single channel 5v relay here is what it look like from the store i bought https://tokopedia.link/Hqc7YN5qfOb

unfortunately i dont have the datasheet but i could give you to the link i bought this relay from, here is the link https://tokopedia.link/Hqc7YN5qfOb

Connect like this:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.