LEDs and Resistors and Power and USB Ports and Stuff.

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
Posts: 6
Joined: Sun Jul 14, 2019 4:17 am

LEDs and Resistors and Power and USB Ports and Stuff.

Post by UNO_ONU » Tue Jul 16, 2019 5:05 am

LED's wonderful things aren't they, say Yes !

Some LED history, skip if you want.

In Australia, way back, when domestic LED's first became available for consumer use they were often
weird and wonderful shapes and designs. There were no 3mm or 5mm standard resin types as we now know
them to be, they were mostly based on the metal can, transistor technology as was commonly used then.

One of the first readily available sources was Radio Shack / Tandy in AU. LED's came in a blister pack
of single or twins, sometimes a mixed assortment and they were very expensive also. A single LED back
then was somewhere around 55c to a dollar (AU) or more each. They were usually some form of metal can,
Gold plated or polished Brass looking and a single wire on some, the can was the other electrode.
Tandy were known for selling factory seconds or overrun components because they were cheaper, so you
usually never saw the same types after that batch was all sold, that was rather annoying.
And Red was the only available colour for a long time, IR also I think as they were the first developed.
Dick Smith was still only learning to fly helicopters back then.
Later came the Yellow and Green colours. Blue and White LED's were still decades away at that stage.
By then the standard resin package 5mm and 3mm we see today was adopted and has not really changed.
Though some of those original Goldy cased types with ruby red lenses did look quite spectacular.
Now you can get a bag of a hundred, and ultra bright LED's, of any colour you want for just a few bucks.

Voltage ~

The first Red LED's available had a forward Voltage drop (like a Diode) of 1.7V, so for many years
they were not capable of being driven by a single Cell (1.5V), what a pain that was.
Green and Yellow LED's were closer to 2V forward drop, but in either case you couldn't just hook
them up to a 3V source or they'd just blow up. You need a Current Limiting Resistor, ALWAYS.
Even Red LED's today that will run off a 1.5V source you still must use a current limiting resistor.

LED's will run off any Voltage, 2V, 5V, 10V, 20V, 100V, 300v as long as the Current does not exceed
the usually 20ma rating, in the case of White and Blue LED's this may be 3V or 4V and 30ma or 40ma.
(Note: for High Voltage you need High Wattage resistors or you could end up with a fire)

But it's never wise to run LED's at their MAX rated current anyway, they will have a much shorter life
span if you do so. If an LED is rated for say 20ma, the best and longest performance would be at
somewhere between 15ma to 18ma, even 12ma will be quite bright in many cases. For an indicator or
panel LED you may even go as low as 1ma to 3ma as if it were brighter it could become annoying.
If you ran a 20ma rated LED at 22ma or 25ma it may last a day or so or just a few seconds, then fail.

Current ~

LED's will usually run on just about any Voltage as long as the current is limited to below the LED's
MAX rated operating current. For most cases a single resistor will do the job just fine.
So how do you find out the correct resistor to use for your particular application, well that's easy.

Ohms Law ! !, OMG he said the "O" word, run away ! !
Ohm's Law is very simple, it's multiplication and division mostly, and every PC has a built in Calculator.

For Current ~ I=E/R, that's it.

I, (intensité du courant) it's a French thing or Current or Amps.
E, (Electromotive force) AKA Voltage.
R, Resistance, we all know that one.

And sometimes also expressed as I=V/R.

So to work out the Current, simply take your "E" Voltage and divide it by the Resistance, bingo !, Current.

At 12V divided by say 330 Ohms you get, 12v/330R = 0.036A or 36ma, that's too high,
12v/680R = 0.017A, 17ma, much better. With 12V and 1K Ohms you get 0.012A or 12ma, still quite acceptable.

For 5V and 330R, 5/330 = 0.015A or 15ma, perfect. (R for Ohms, K for Kilohms, thousand Ohms)
As a panel LED on the front of your TV at 15ma, this would drive you nuts, you would maybe go as low
as 2ma or even 1ma. 5/3K3 Ohms, 10x the above, will give you 0.0015A or 1.5ma.

Ohms Law has other, simple and very useful parts also e.g., Power, P=IxE and others, E=IR, R=E/I.

ADDED: one thing I didn't mention when working out the correct Resistor to use for your LED/s
was the fact, you are supposed to subtract the LED forward voltage drop e.g., Red 1.5V, Blue 3.0V or thereabouts
from the Voltage as well. So a Red LED on a 12V supply would be 12 - 1.5 = 10.5V as a starting Voltage.
This is not so much of a problem with Red LED's but a White LED (3V-fwdr) on a 5V supply = 2V starting voltage.
It does become fairly important with many LED's in series though, 1.5V + 1.5V + 1.5V + 1.5V = subtract 6V.
But I don't know of any Panels or Matrix that use series LED's. Christmas Lights are/can be a different story.
Most online LED calculators will ask how many LED's and if in series or parallel, so that part is usually done for you.

And if all else fails, there are thousands of Calculators on the Web that will do it all for you.
Now that the Horrid stuff is over, you are not off the hook, just yet.

Common Sense ~

Your PC USB Port is not a workhorse ! !. You will blow it up if being silly, and a blown USB Port sucks !
The specification for a USB Port is 5V, 500ma output MAX. That's not to say you should ever use it at 500ma.
And as you know, should know, if you push things to their limit, they will usually fail.
If you regularly draw more than 350ma to 400ma from your PC USB port, then it's probably time to stop.
Get a dedicated 9V or 12V Power Supply to run your Arduino projects through. Use the Power Jack for this.

If connecting 5V directly to the back end of your Arduino e.g., not through the power Jack, make sure
it is well regulated and actually 5V and no higher.
When you plug in external power through the Jack and it is above around 6.6V the USB 5V is disconnected.
But if you put 5V in after the Jack (regulator) directly into the back end, the USB 5V may still be active.
There is a difference.

An Arduino UNO for instance will happily run with USB and an external Supply simultaneously.
They are designed to do that. The USB 5V supply cuts out (is isolated) when an external supply is connected.
But only if going in through the Jack provided and is above 6.6V input.

LED's and Panels and Matrix's ~
As from above an LED running at near full brightness will be 15ma to 18ma, that's not much at all.
But if you start adding a lot together, it could soon become a run-away train.
I had a project once that used 16 simple indicator LED's (10ma), the same outputs then drove 16 SSR's,
(Solid State Relays), LED inputs (15ma) and the SSR's had ON LED's also (10ma), not much you are saying.
But that's 560ma, over half an Amp for just indicator LED's.

With a DMD Panel and the LED's running at half brightness, 10ma x 512 = 5.12A
Though the LED's in an DMD panel are pulsed at a much lower duty cycle than Full ON, but you get the picture.
The same goes for the MAX2719 8x8 Dot Matrix displays, 64 x 10ma = 640ma, similar lower duty output.
But the peak pulse could be near full current draw and for a single 8x8 that's well over 1A.
Then if you add another or 6 or 8 in a row then we are talking serious power needs.
The MAX2719 chips also have a brightness feature which is great if supported in the library you are using.
This can save a lot of power and take away the blinding brightness of a display in a dimly lit indoor situation.
The DMD on the other hand can only be dimmed by PWM-ing the display enable input, but it's do-able.

So don't think, oh it's just a few LED's, my PC can easily handle that, or you may be in for a rude shock.
Then if you start getting into RGB Stuff the power requirement can even double or more in some cases.

I'm not trying to put anybody off here, but there are things you should be aware of to keep everything
running smoothly and to avoid accidents. An UNO is cheap to replace, but a PC USB port, is usually a new PC.

Also Motors and particularly Servos can potentially draw a lot of current.
A normal servo may draw 200ma at Idle, but if you lock it up or stall it then it could be as high as 750ma.

Have fun,
keep the Smoke inside the component where the manufacturer intended it to be.

Posts: 165
Joined: Fri Sep 20, 2013 7:25 am

Re: LEDs and Resistors and Power and USB Ports and Stuff.

Post by Brissieboy » Tue Jul 16, 2019 9:26 am

Most USB ports do have current limiting so loading them up too much will usually not cause failure in the PC, but will result in the available voltage dropping considerably; leaving very uncertain results from whatever you have plugged in.
The reasons for powering the DMDs separately is partially related to this but more so just how the power gets to the DMD.
Have a look at this thread.

Posts: 6
Joined: Sun Jul 14, 2019 4:17 am

Re: LEDs and Resistors and Power and USB Ports and Stuff.

Post by UNO_ONU » Tue Jul 16, 2019 9:59 am

I have seen instances where people have blown their USB Port, not using Arduino but other things.
And know a guy who's WIN 10 laptop just shuts down the port completely and growls at him with onscreen prompts.
If you are running a Laptop with a flat battery (charging) watching a video etc, and then try to suck out an extra 500mA
on the USB with some project your Laptop and Laptop Supply will not be very happy at all.
Yes I have noticed a DMD panel will try to steal power from wherever it can get it if the Main DC feed drops out.
Not good for the Arduino or DMD panel or PC, as you said most of these pins and lines are only rated for 20mA.

I was working on an 8x8 MAX2719 array (6 segments) last night, thought I had a 3A supply connected but it was only a
1A, it ran fine for 30 sec then the right end > display just stopped working completely, the rest were still going fine,
I wiggled all of the connectors trying to see why it wasn't working, then I checked the supply and saw 1A.
I have 12V, 1A, 2A and 3A supplies that all look fairly similar. My Breadboard regulator was running very hot also, so I
ditched the 12V and went for a 5.3V 10A supply and everything cooled down and ran fine from there on.
You can't beat a good solid supply when playing with lots of LED's. ;)

Post Reply