ULN2003 with ESP32

Hello,

I'm trying to activate several relays from an ESP32. I am using a ULN2003 driver to power the relays but I found out that the relays are always in ON mode. When I activate the output of the ESP32 i get a 3V3 voltage, but when I deactivate the output, the voltage is around 0,7V so the ULN continues powering the relay.

I used the same schema in the ATMEGA328P without any problem so it's strange to me the behaviour. Why it is different?

Shoould I use a pull down resistor? Any other better solution?

Thanks in advance

ULN2003A

Relays can be of 2 types. Some are active HIGH, some are active LOW. Please test your relay separately to verify if it is an active HIGH relay or active LOW relay.

I checked it. The relays are ok. The behave as expected.

You should connect 5 V to flyback diode on pin 9 (CD+).

1 Like

Without seeing your connection scheme, I would still suggest using separate ground wires, all leading to the power supply GND. Avoid ground loops.

Thanks. I connected it to 5V as you mentioned but I get same result.

What's the voltage on RELE1 when disconnected from ULN?

Remove the 24V connection from O2, connect 5V to pin 9 (CD+).
Without CD diodes connected, kickback from relay coils may have damaged output transistors. Try different channels.

most likely

may be an issue. Is the ESP32 supplying the power for the module? Is the ESP32's 3V3 signals being boosted to 5V?

Where is your code that shows how the ESP32's GPIO pins are being configured?

Table 3 on datasheet says 2.4 ~ 3V should be OK.
https://www.st.com/resource/en/datasheet/uln2001.pdf

Yup, should be.

Thanks all for your help.
I checked the circuit and realized that the ULN was not soldered in the correct position.
However, I will connect CD+ to 5V as you suggested and also change the power in O2.

Sorry for my silly mistake.

This is not a mistake; this is what you have done. It would be a mistake if you would carry out the works against a pre-made check list.

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