Electronic – 5×7 LED Matrix on a µC without additional parts

atmegaavrled

I want to use a small 5×7 LED Matrix on a ATmega.

I havn't that much space, so I don't want to use a dedicated driver chip.

My thought would be to switch the columns via a transistor and use a resistor on the rows to limit the current.

After a little bit research I found some products wchich use the a LED Matrix without a current limiting resistor and even transistors:

https://wiki.raumzeitlabor.de/wiki/Hacklace/en
http://www.adafruit.com/products/950

How does this work?
In my understanding, the current of all colums (or rows, depending on the multiplexing) adds up on the row (column) pin and exceeds the current limit of the µC pin.
And also the lack of current limiting resistors seems a little bit strange.

The only way I could think of this would reliably work is that the current is limited via the multiplexing timings. Is this the case? And is there a way to calculate such things?

Best Answer

At least three factors contribute to the use of an LED matrix without current limiting and without drive transistors:

  1. High internal resistance of power source: Small batteries such as CR2032 are routinely used for throw-away LED toys, mini flashlights, throwies and the like, with no resistor attached. Because of the battery being incapable of delivering high currents over a sustained period, at worst there is a brief instant during which current over the LED's rating, or that of the microcontroller's GPIO, might flow. Thus, neither a limiting resistor nor a drive transistor is used. A good article around this is "Some thoughts on throwies". However, see also third point.
  2. Multiplexing: By switching LEDs in a multiplexed pattern, the effective current through any given LED, and through the GPIO pin, is kept low. This is however determined by both the effective duty cycle seen by each LED, and by the multiplexing frequency.
    • For example: 8 rows of LEDs multiplexed on one pin would make the effective duty cycle per row ~12.5%. Thus effective current seen by each row of LEDs would be around that much of the maximum... Not exactly, though, as switching time reduces the actual on-time per cycle. Raise the frequency of muxing high enough, and the effective current drops significantly - but make it too high and at one point the LEDs just won't light up visibly.
    • The other impact of multiplexing frequency is that too slow is unhealthy: Even at a 5% duty cycle (say 20 LEDs) for instance, if the time for each cycle is too long, LEDs will be destroyed before one cycle's on-time is over, so duty cycle becomes irrelevant. Manufacturers of cheap LED toys can easily determine a workable frequency by destructive testing, since individual nameless LED batches might have different duration of tolerance for over-current.
  3. LED forward voltage: The driving energy for the current to flow through the LED is related to the voltage difference between (a) what the battery supplies, and (b) the total of LED forward voltage, voltage drop across any switching BJTs or MOSFETs, and anything else in the series path. Of these, the LED Vf is a big chunk: Some LED colors, such as infrared, red, and certain types of yellow, green and amber, represent a low forward voltage, between 1 and 2 volts, roughly. On the other hand, colors such as blue, white, UV, some types of yellow and green, represent a higher forward voltage, for example 2.5 Volts and up. Thus, in the high voltage colors, the available headroom to the CR2032 cell's nominal 3 Volt supply is smaller, and hence the current available after overcoming battery internal resistance is lower.
    • In short, the high Vf LED colors are typically safer to use with a 3 Volt coin cell. For LEDs rated below 1.5 Volts, similarly, a 1.5 Volt coin cell e.g. LR44, can be used.
    • LEDs requiring more than the actual voltage the battery can supply under load, will simply not light up. This includes some types of white LED which require voltages close to or greater than the CR2032 battery nominal.

Summary: Keeping the above in mind, try it and see if it works for you. At worst, you would lose a microcontroller or two, or a few LEDs, but you will know how much cost you can cut in production.