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?
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.
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.
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.