I posted this in the hardware section as well, but im impatient. Sorry.
So i have 18 LEDs being controlled with shift registers, but for simplicity sake just think that they`re controlled individually with digital output pins. Now they're all share the same ground so I can use one 100 ohm resistor for example to compensate for every LED can i not?
What I'm saying is that if i have each led with anode at a digital pin and the cathodes all connected together and then a resistor from the cathodes to ground.
My resistors are 1/4 W if that matters. I just dont want to use 18 resistors if i dont have to.
short answer is yes you can if the resistor can handle the wattage
I have to say in these politically correct times that you are differently correct.
The LEDs will not share current and the voltage drop across the resistor will be dependent on how much current is flowing. Each LED needs its own resistor. http://www.thebox.myzen.co.uk/Tutorial/LEDs.html
No one can be told what the matrix is...you must see it for yourself.
What I mean is, you don't understand how they work. They're set up so that only one LED is being powered through its own resistor at a time...say you have 8 columns, each with a resistor. Now you switch in one of the eight rows, and turn the columns on and off as needed. Current is flowing from each LED through one resistor.
The original poster could get away with just one LED...IF they made sure that only one LED could be on at any time.
The original poster could get away with just one LED...IF they made sure that only one LED could be on at any time.
It will also work equally well (or equally poorly) IF they made sure that the same number of essentially identical LEDs were on at the same time. It's just not a good idea.
IF they made sure that the same number of essentially identical LEDs were on at the same time. It's just not a good idea.
I don't think so. Even it perfectly matched, each LED would only get a share of the current fixed by the resistor, so they would be dimmer and dimmer as you turned on more LEDs.
It's amazing how many typed characters have been expended over the last couple of years here on people wishing to eliminate or reduce the number of resistors driving LEDs.
ah! but dimmer is not the question, its how to reduce component count and still be safe!
ive got 16 right now running off of 4 resistors in a matrix, and the visible difference is negligible, its also running tru a 74164, that for testing that was set with 8 bits of data (1 nibble anode control, 1 nibble cathode) and never clocked or fiddled with again so all 16 are on at once with no cycling, voltages are fine and total current per row is as expected, individual currents on the led's haven't been measured but i am stubborn and will do it if need be
If you had a matrix and you combined all the anodes or cathodes into one resistor, you could make it work under the following optimum requirements:
The number of LEDs that are 'on' at any given time per resistor remains the same - whether it's one LED or 4, 5, 10, 40 or whatever. You have to switch them correctly in order to do this and it probably would be very complicated. Also, slight timing differences in your switching could lead to extreme transient spikes between switching times, which could damage LEDs and would get worse with more LEDs.
All LEDs connected to one resistor must have the same voltage drop rating. (Even then the brightness of each will vary due to manufacturing differences)
While this is all doable, it's really not very practical on a large scale. The risks of something going wrong are pretty high, especially with large groups of LEDs. If you're doing small groups and can live with differences in brightness, it can be done outside of optimum practices.
ive got 16 right now running off of 4 resistors in a matrix, and the visible difference is negligible
Can you post a schematic of you physics defying circuit?
This actually doesn't surprise me. As long as there is never a condition where the current in one LED or resistor is beyond spec, you're OK. For example, at 5V you can run 1-4 LEDs off of the same 220 ohm, 1/4w resistor. But as each LED turns on, the others dim slightly - maybe not enough to be a concern. In this case, when one LED is on, it's running at about 22mA, two LEDs -> 11mA each, three -> 7.3mA, and 4 -> 5.5mA each. Depending on the LEDs, the brightness may not vary enough to bother the designer.