1

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

SamGibson
  • 17,231
  • 5
  • 37
  • 58
Nifty 17
  • 29
  • 4
  • 1
    Your requirements are under-defined. – Andy aka Sep 25 '20 at 07:50
  • 1
    Under defined means... – Nifty 17 Sep 25 '20 at 08:00
  • 1
    Power supply voltages, relay types, typical relay drive schematic etc.. – Andy aka Sep 25 '20 at 08:05
  • 2
    We need more information. In principle your idea works, but there is so much information lacking we can't say that it will work with your set up. – Puffafish Sep 25 '20 at 08:05
  • @Nifty. Ah let me see. So you want many transistor switches to switch 5V relays. No problem at all. You ULN2003 choice is good, because it can handle max 105mA, and 5V Songlle relay switch takes max 70mA. I usually use ULN2803 which has 8 NPN BJTs open collector, ideal to sink Songle switches. Let me draft an answer. You can give me more requirements and I will try to entertain. Cheers. – tlfong01 Sep 25 '20 at 08:17
  • 1
    Welcome to the site. Please do not add information in comments otherwise readers have to piece the question together. Edit it into your question. Split your question into paragraphs instead of one big paragraph. Don't post big photos that need a scrollfest, reduce them to a sensible size first. Good presentation attracts better quality answers. Thanks and again, welcome. – TonyM Sep 25 '20 at 08:26

2 Answers2

3

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

tlfong01
  • 2,766
  • 1
  • 9
  • 17
  • 1
    Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/113416/discussion-on-answer-by-tlfong01-can-i-use-a-uln2003a-ic-as-many-transistor-swit). – Voltage Spike Sep 26 '20 at 04:05
  • 1
    @Voltage Spike. Many thanks for your help in opening the chat room. Cheers. – tlfong01 Sep 26 '20 at 04:16
  • 1
    I'd say the ULN2003A is an antique and not a good choice, nor is the ULN2803. There are much better solutions, though site part recommendation rules prevent me giving examples. But they're an internet search away. – TonyM Sep 26 '20 at 18:36
1

Yes, ULN2003A can be used to control any loads such as relay coils as long ask the connected loads won't exceed the total or per-channel voltage and current limits of the chip.

ULN2001 2 3 4 datasheet here - 7 channels.
500 mA per channel subject to package dissipation limits (varies with package)
50V abs max. Less recommended.

Often competitive or superior to using discrete transistors.

MOSFET version here

ULN2803 8 channel - similar - datasheet here

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386
Justme
  • 127,425
  • 3
  • 97
  • 261