ESP32 and PCB type Relay

I was wondering if someone could help me figure out why my PCB style relay does not work in the configuration shown in the below photo. I am making a little project to water my plan. Yes, I have way over engineered it (uses Wifi and Bluetooth and can automatically water). Please ignore everything else going on. It all works. I am using a USB powered power supply with 2 separate power supplies. One side (the top in the photo) will power the ESP32, LEDs, and relay, and the second (bottom) power supply will power the pump motor only via the relay.

What does not work is the PCB relay. What am I doing wrong? I started using a 5V coil relay and that didn't work. So, I bought some 3V coil relays because the ESP32 is a 3.3V device and it still doesn't work.

I was using the "boarded" relay shown as a photo by itself (2nd photo) and it works just fine. I switched to the PCB mounted relay to save space as I am soldering these components to a PCB project board and the PCB mounted relays don't work. They will trigger if I connect the input to the 3.3V from the ESP or the 5V, but it will not trigger from pin. I've tried several pins as I know on the ESP32 some pins are input only. I believe pin 25 that I am using should work fine.

HELP!

Sorry. Working on first photo was confusing. Hope this is better..

I don't seem to see buffering between the ESP32 and the relay in your breafboard setup. Usually (and preferred) an optocoupler for galvanic isolation or a transistor. I also don't see a flyback diode.

You should never connect a relay directly to any microcontroller; chances are that you have damaged your ESP32.

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

Thank you for the fast response! I am not much of an electronic person so what you have said is mainly Greek to me.

From optocoupler I am guessing the PCB style replays I bought are not optocoupler like the "board" relay in my photo below. THAT may be why it works and PBC mount relay I have does not. I could not find a 5V optocoupler replay that is for PCB board mounting. Is there such a thing?

I am familiar with a Schottky diode. Is this a flyback diode? Areyou saying I need one between the ESP32 and the relay input?

Posting a Schematic, not a frizzy picture would help. Posting a link to the "Technical" information on the hardware items helps. I cannot follow your pictures but I do not see a driver for the relay, using one without a driver is great for the ESP manufacturers, it fries them and they sell more.

A ver si esto te ayuda a soluccionar tu problema.
Observa que tu relé tiene unos pins para seleccionar entrada Alto o bajo.
Puedes buscar en la Web más información del relé SRD-5VDC-SL-C

@ANTONIO_DUARTE, please post in English when replying in the English section of the forum.

Thank you, and Gracias, to everyone who has responded. I am clearly over my head with the ESP32 and the PCB type relay. Based on what folks have said, I found the below diagram of how to build your own Relay Drive Module. I "think" this also explains why the optocoupler relay in my 2nd photo works.. it has a build in relay driver module.

To the folks who know, is this correct? I am thinking I should just go with the optocoupler relay rather than trying to make my own.

Puede traducir con Google, es múy fácil.
Lo importante es la aportación de ideas e información.
Gracias

Yes.

This web page is an example of the use with optocouplers. Second diagram is the better one as it uses a separate power supply for the relay itself so any 'pollution' when the relay switches will not affect the power of the processor board.

Optocoupler Relay Driver | Circuit Diagram. There are many more diagrams on the web, some better than others when it comes to component selection.

Can you post a link to the relays you are using please?

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