I want to make home automation using ardruino. Instead of relay modules I prepare own relay module using relays and transistor switches in between ardruino and relays. I want to make many transistor switches. Instead I planned to use IC like ULN2003A which has 7 darlington arrays which 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 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 relay which is activated by a PNP transistor switch whose base current us provided by output of ardruino and collector-emitter has a seperate powersource to activate relays. If I want to operate many appliances many such transistor switches are needed hence I searched 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 powerlosses and other factors?arduinotransistorsswitchesrelayintegrated-circuitshareedit follow flagedited 1 hour agoasked 1 hour agoNifty 17111 bronze badge New contributor
- 1Your requirements are under-defined. – Andy aka 1 hour ago
- 1Under defined means… – Nifty 17 1 hour ago
- 1Power supply voltages, relay types, typical relay drive schematic etc.. – Andy aka 1 hour ago
- 1We 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 1 hour ago
- 1I need to turn on/off 220V loads using 5V DC relay which is activated by a PNP transistor switch whose base current us provided by output of ardruino and collector-emitter has a seperate powersource to activate relays. If I want to operate many appliances many such transistor switches are needed hence I searched 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 powerlosses and other factors? – Nifty 17 1 hour ago
- @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 drain, ideal to sink Songle switches. Let me draft an answer. You can give me more requirements and I will try to entertain. Cheers. – tlfong01 1 hour ago
- 1Welcome 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 1 hour ago
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.shareedit follow flag answered 1 hour agoJustme32.4k22 gold badges2727 silver badges6363 bronze badges
- Thank you so much – Nifty 17 1 hour ago
- Is it efficient than normal transistor switches? – Nifty 17 1 hour ago
- That would depend on what you think as normal transistor, so only you can do the comparison. – Justme 1 hour ago
Can I use ULN2003 to switch 5V relays which in turn switch 220VAC loads?
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
- 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.
- For prototyping or feasibility studies, you can buy cheap ULN2803 and MCP23017 modules which save soldering effort/time and space.
Appendix A – ULN2003/2803 Wiring Diagrams
- 1I’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 a search away. – TonyM 1 hour ago
- @TonyM, Many thanks your for your advice. Would you kindly suggest some words for searching? Much appreciated for updating our old school/outdated knowledge and skills. Cheers. – tlfong01 1 hour ago
- 1@tlfong01: Your statement about the ULN2803 is somewhat mixed up. ” ULN2803 which has 8 open drain, power NPN BJTs” BJTs have collectors, not drains. – JRE 1 hour ago
- 1You can mail me those examples at firstname.lastname@example.org Thanks for your info – Nifty 17 1 hour ago
- @JRE, Ah, thank you for pointing out my careless mistake. Errata: “Open Drain” should read “Open Collector”. My apologies to all confused readers. – tlfong01 1 hour ago
- 1The question and comments don’t mention Songle brand relays. – JRE 55 mins ago
- @JRE, Ah, you are right. I didn’t think about that. I did hesitate a second when I use the brand name Songle. I guess Songle is the most popular compared to TongLing which is second. I know even Element14 (Farnell) sells Songle, so it is a good example to use and would not mislead the newbies. On second thought, perhaps I should say for example, “say the Songle relay switch, for example. Thanks again for you help. Cheeers. – tlfong01 45 mins ago
- 1You sound hurt, sorry if you are. Who’s the ‘our’ you mention? – TonyM 21 mins ago
- My apologies for hurting. When I said “our”, I mean me and the OP who I think also is a newbie. Perhaps I should say “*me the newbie and perhaps also the OP“. My apologies for hurting anyone. I did hesitate to say “me”, but then perhaps the OP also wants to update his knowledge. My apologies for hurting any one. Yours sincerely. – tlfong01 3 mins ago Edit