Electronic – use a ULN2003A IC as many transistor switches

integrated-circuitrelayswitchestransistorsuln2003

I want to make home automation using Arduino. Instead of relay modules, I prepare my own relay module using relays and transistor switches, in between the Arduino and relays.

I want to make many transistor switches. Instead I planned to use IC like ULN2003A which has 7 darlington arrays that I can use as switches. They also have flyback diodes to protect from sudden spikes. (Also cheaper compared to 7 transistor switches and diodes.)

Is it a good idea to use it? Or is there a better way to solve my problem?

Additional info:

I need to turn on/off 220V loads using 5V DC relays which are activated by a PNP transistor switch, whose base current is provided by the output of an Arduino and collector-emitter has a separate power source to activate the relays. If I want to operate many appliances, many such transistor switches are needed. Hence I searched for a simple solution and found an IC which can act as multiple transistor switches (ULN2003A).

Is it ideal to use that in my circuit, considering power losses and other factors?

enter image description here

Best Answer

Question

Can I use ULN2003 to switch 5V relays which in turn switch 220VAC loads?


Answer

No problem at all.

Your ULN2003 choice is good, because it can handle max 150mA, and the most popular, typical 5V relay switch, Songle relay switch, takes only max 70mA.

I usually prefer ULN2803 which has 8 open collector, power NPN BJTs, ideal to sink 5V Songle switches.


Discussion, Conclusion, and Recommendation

  1. You may like to also consider I2C 16 channel MCP23017 GPIO expander. Using 2 I2C wires/signals you can control 8 MCP23017 for 8 x 16 relays. Another good thing aboue MCP23017 is that you can set input or output, interrupt control, and the output pins are sort of latched, ie, once setup, no need to take care afterwards.

  2. For prototyping or feasibility studies, you can buy cheap ULN2803 and MCP23017 modules which save soldering effort/time and space.

References

(1) MCP23017 I2C 16 Bit Bidirectional I/O Expansion Module - US$0.75 ~ 1.28

(2) What is an open collector?


Appendices

Appendix A - ULN2003/2803 Wiring Diagrams


uln2003/2803