I'm building a 8x8 LED matrix with 2 daisy chained 74HC595 shift registers to control the 8 rows and 8 columns, using the ´595s as source (rows) and sink (columns). Setting specific pins on HIGH determines which row/column LED to light up Only one LED is on at any given time: so no issues with the max current of the ´595s. The MCU is a MKR1010 with 3.3v logic.
NOOB QUESTION: when I move to a PCB (I tested it on a breadboard), I'll use LEDs that have a forward voltage of 3.3v (below is the link to the datasheet). I plan to use White that has 20mA forward current, 3.3 Vf (typ) 3.9Vf (max). So the math says I don't have to use resistors: source voltage = voltage drop. Does this make sense?
Sure, until the source voltage does not equal the forward voltage then, poof, there goes an LED or a digital output. In practice it is very difficult to control either voltage to the extent necessary to prevent, poof. Much easier to control the current with a resistor or constant current source.
LEDs are "current operated" and the forward operating voltage is different for different colors. There should be a resistor in series and some "extra voltage" for the resistor, or the current can be otherwise controlled.
High-power LEDs are normally driven from a special constant-current source so you don't need a high-power resistor and so no power is wasted (or heat generated) in the resistor.
If the voltage is "exactly right" it will work. If the voltage is slightly-high the LED's resistance goes down and you get excess current, stressing the driving device and stressing the LED. Typically the current is limited by the Arduino (or whatever chip is driving the LED) and nothing burns-up, at least not immediately. If you measure the voltage under these "stressed conditions" you'll find that the Arduino is putting-out around the LED's rated voltage but more than it's rated current. It's "bad practice" not to limit/control current even if it "works".
If the voltage is slightly-low the LED's resistance rises and the LED is dimmed and that's OK as long is it's bright-enough for the application.
The forward voltage will also slightly change with temperature. That's not usually a big deal (at least with low-power LEDs) but it's not a problem at all if you control the current.
Thank you all for your feedback! Clear now: even if the (rated) forward voltage of the LED (3.3v) is equal to the (rated) MCU's logic voltage (that is fed to the 595's gates and thus to the LEDs), I'll add a series resistor (small, say 110 ohm) just to keep things safe.
Best option would be to have 5v source voltage, but since it's a mobile application running on battery, that would mean adding something like a boost converter (like a MiniBoost 5V @ 1A - TPS61023) between the MKR1010 and the 74HC595?
No the forward voltage of an LED is not a voltage rating. It is the voltage that will develop over an avrage LED when (normally but see the data sheet) 20mA is flowing down it. However this changes from LED to LED and also changes with temperature and the age of the LED. So don't sail too close to the wind.
That will only be safe if the 3V3 pin driving it can cope with the current. Many 3V3 processors have very low current ratings on the pins. For example the analogue output of the Due can only supply 3mA before it fries. It is very easy to blow. I know I have blown one.
It depends on how much current you want to go through the LED. Remember that the eye perceives brightness as logarithmic so reducing the current by half is not going to make it look that much dimmer. The first thing you need to know is what current your pin from your 3V3 processor is. Then run any load at about a maximum of 80% of this.
The MKR1010 has a max of 7mA per pin and with 3v3 logic, even if the LED's voltage dropped to 0, a 47 Ohm resistor would do the job. Am I understanding this correctly?
Will only know until I send the PCB for manufacture: I don't have any of the SMD LEDs I´m planning to use, hence the need to rely on datasheets. The spec says 3.2v Vf (typical) and 3.9v Vf (max). If the LED indeed reaches 3.9v Vf, with 3V3 source voltage no current will flow?
Maybe just get out a few different LEDs, no matter what kind, and play with your power supply, current meter and some various resistors.
Here's a case where it is nice to have a power supply that shows the current being drawn, or a second meter.
If you only have one meter, this is the perfect excuse to get a better one, or a lesser one. Imma bet 75 % of at least the older timers here have more than one. Never mind precisely how many I have.
You won't "reach" or measure Vf at 3.9 volts if your power supply is only 3.3 volts…
Just make sure the resistor you try first is obvsly too big, have fun and maybe even burn a few out whilst doing.
This is the matrix I'm drawing. RED = VCC, Black = GND and using 3 pins for logic (exiting to the right of the schematic). The upper '595 opens a specific pin (HIGH) and the lower '595 drops a specific PIN (LOW) and the LED in that combination of row/column gets lit. Only one LED at a time
Are you planning that it will appear that there is more than one LED on at a time, which would be done by scanning, typically selecting an entire row and one column (or vice versa)?
Or literally one LED full on, for a relatively long time, then another, and so forth, like watching a PONG ball bounce around?
If the latter, proceed. If the former, you need to figure that you will not be getting good results until you are srsly driving the LEDs perhaps with a current that would be fatal if allowed to be continuously applied.
Check your data sheet for maximum current and power dissipation. If scanning, you will want te be out near those limits.
The latter. The matrix will provide typing feedback for a capacitive touch letterboard used in specific therapeutic applications where the subject types with one finger sloolwly. So only one LED lit at any time, for probably 800 millis, and then on to the next typed (i.e. touched) letter
That is not the way an LED matrix is normally driven, but there is nothing to stop you doing that.
But the current drive available is determined now by the shift registers not by your processor. If you power the shift registers with a higher voltage than your 3V3 you will have more voltage to play with.
If you use 5V then that is just outside the range where the signal of a 3V3 processor will work reliably. But if you use a 5V supply and pass it through a rectifier diode before connecting it to the Vcc of the shift registers then it should work OK as this will drop the 5V down to 4.3V.
Thanks. I did. Certainly MUCH easier and with more ready functions. But the cost considerations for my prototype required something lower: 2 x 74HC595 shift registers for $1.80 vs $12 for one MAX7219.