Hi,
I'm working on a model of a crossing with traffic lights. The crossing is rather large, having 129 LEDs distributed in 15 traffic light posts, with their cathodes bundled together. For example, a post with 9 LEDs has 10 micro-cables going out - nine for each LEDs anode and one for all LEDs cathodes.
In order to control the traffic lights, I got an Arduino Mega 2560. I'm trying to avoid multiplexing since the programming and wiring of the whole thing is already quite complex, and I'm an electronics noob having a hard time understanding all of it. So the idea is to wire the LEDs anodes directly to the Arduino Mega 2560 with its >60 pin-outs. Not all the LEDs need to be controlled individually - most of the time two or three LEDs will always light up together - so I can easily wire them in parallel to the Arduino's output pins, of which 57 will suffice.
Well, in this Forum I've read about the maximum current allowed to be drawn out of each Arduino pin to be 40mA, and the maximum overall current to be about 800mA. [1] This won't work with each LED drawing 20mA. Even if there is never a time when all LEDs are lighting up at the same time, the current for 50 LEDs would be too much already.
As a solution, I tried using a Darlington Array of transistors driven by the Arduino. Since the LEDs are bundled in their cathodes, I would need a high-side drive array, and went for the UDN2981a and (since it is discontinued and I had only 3 pieces available) the Toshiba TD62783. This is the plan for one of these pieces (there are 7 of them in total):
[see image attachment 1]
To be more precise, the Arduino is powered either (a) via the same +9V power source as the LED via its 5.5mm power jack, or (b) via its USB interface (when programming), or (c) both.
I started wiring the LEDs and it worked as designed, I was happy. However, when I removed the 9V power input for the LEDs and the Arduino, and just used the USB interface as a power source for the Arduino, the LEDs are still lighting up (just not as bright as with 9V). From what I understand, this is due to the Arduino still supplying them with 5V via the transistor array's base pins. But also, from what I understand, the base pins should only allow a minimum current that shouldn’t light up the LEDs.
I tried to get my head around how that UDN2981a thing works in detail and looked into the schema for each of its 8 drivers [2], but all I got was a headache. Still, from what I understand, there should be no reason for INPUT current to flow through OUTPUT if GROUND is connected correctly:
[see image attachment 2, taken from [2]]
So my question is, in the above schema, is it okay for the LEDs to light up? And can they draw 20mA from the Arduino’s output pins through the transistor’s base inputs? Should I worry about supplying the Arduino with power via USB without the 9V? Or should I worry about the overall solution?
I looked up this issue using Google and the forum search, but every solution I found so far uses multiplexing [3] or points towards ULN2803A or UDN2981a and that it should work. Again, I would like to avoid multiplexing and more complex programming / wiring solutions. And I am rather new to this, so please bear with me. Also, I’m sorry for that block of text, but I hope to have described everything elaborate enough.
—
[1] Maximum Current Draw from Arduino Mega - Project Guidance - Arduino Forum
[2] UDN2982A pdf, UDN2982A Description, UDN2982A Datasheet, UDN2982A view ::: ALLDATASHEET :::
[3] How many 20mA LEDs can I hook up to Mega 2560 - LEDs and Multiplexing - Arduino Forum