Yet another LED array (7x2) but with some unusual requirements.

Hello there everyone!

I'm looking for some guidance regarding a project I'm working on. I'm developing a kind of visual thingy that will include 16 LEDs that are supposed to be programmed with some patterns. Two weeks ago I hadn't soldered anything in my life much less heard about Arduino, and so far it's been a breeze, been doing experiments with individually controlled LED arrays and rebooting my dusty C++ knowledge, but now I'm a bit confused and looking for some explanations. Lets get to it, right?

The basic idea is to have led arrays arranged as such:

col 1 — 0 0
col 2 — 0 0
col 3 — 0 0
col 4 — 0 0
col 5 — 0 0
col 6 — 0 0
col 7 — 0 0

So 14 LEDs in total, but I wanted to use PWM, so the solution would be to use the row / column system, instead of individual mapping, and output the seven PWM outputs on my Arduino Micro board to one column each. Nice and easy.

However, then I realized that "shit, this system wont work if I would for example want to turn on all LEDs but one". Then I turned to the internet and found out that you could light each led, or column, or row, one by one and do it really quickly and yes! that would work. But no, then I realized, "that won't work because this is going to be filmed by a high speed camera at ?1500 fps. And that camera would probably pick up that nifty trick.."

So. I'm rambling. However. That's one problem, but one I can live with, the most important thing is that I have complete control of each column. But then I'm confused about the whole resistor / amperage situation.

Each led should run at about 10mA, so turning them all on at once shouldn't be a problem for the board itself, but considering that I would be routing around 70mA per row, that would probably blow that rows pin up, right? So my first thought was to divide the rows up, so each row would have 3 or 4 LEDs, and that should work. I'm losing 2 more outputs from my board, but it doesn't really matter because it's not going to be used to do anything else. Is there another way to sink current (not sure if I use the lingo right, remember, very untrained in any kind of electrical skills).

And also, the resistor situation, is it easiest to use one resistor per led, which means two per column?

I hope you made it through, and if you have any tips or ideas I would be most grateful, just remember as far as the electrical practicalities, imagine you're explaining it to a retarded kid. That's me.

Thanks for your time S ^_^

I think you are confusing PWM - controlling brightness - with multiplexing - activating rows alternately to save on drivers.

Both involve switching LEDs on and off rapidly. If a high speed camera is going to discern flicker, then either it is not going to work, or you do the multiplexing at a speed of ten times the camera shutter speed. There is no particular reason that you cannot multiplex at one megahertz, except that this will take most of your processing power to do so, that is, you will not be able to do a great deal else at the same time.

As for the current, and if you wish to run LEDs at 10 mA, you could simply drive them in pairs, so that one pair would require a safe 20 mA, and you drive each of seven pairs in turn. This would admittedly give less brightness, as they would be driven one seventh of the time instead of one half.

Actually, it is easier to just use emitter follower transistors to drive the LEDs in two columns. An emitter follower will follow at 1 MHz with no problems where a common emitter circuit will not.

You drive the anode groups alternately high with an NPN emitter follower, and drive the cathodes you wish to light, low through the current setting resistors - seven of them.

Just to emphasize what Paul__B wrote: the PWM frequency is relatively low - much lower than 1500 Hz - so that's not going to work with LEDs.

How about replacing the LEDs with grain-of-wheat incandescent bulbs? It will probably require a transistor per output pin to supply the required current since I don't think you'll get a bulb working down to 20mA. Then the thermal inertia of the bulb would (hopefully) reduce flicker to acceptable levels. I don't know how much flicker would be acceptable, but you could raise the PWM frequency if necessary - or just do the PWM in software however fast you want.

Since you don't have enough PWM pins to control them all independently you may find it's best to do the PWM in software using a separate digital pin per LED anyway.

Paul__B: I think you are confusing PWM - controlling brightness - with multiplexing - activating rows alternately to save on drivers.

Both involve switching LEDs on and off rapidly. If a high speed camera is going to discern flicker, then either it is not going to work, or you do the multiplexing at a speed of ten times the camera shutter speed. There is no particular reason that you cannot multiplex at one megahertz, except that this will take most of your processing power to do so, that is, you will not be able to do a great deal else at the same time.

Yes, of course, didn't think of the actual process of the PWM, but your right, that won't work for the high speed bit. But if I'm not able to use PWM I might as well run each led individually, and save myself the headache, for this time. Multiplexing and the row-column arrays are a bit over my head, and I rather learn about it when I'm a bit less stressed.

Paul__B: Actually, it is easier to just use emitter follower transistors to drive the LEDs in two columns. An emitter follower will follow at 1 MHz with no problems where a common emitter circuit will not.

You drive the anode groups alternately high with an NPN emitter follower, and drive the cathodes you wish to light, low through the current setting resistors - seven of them.

This sound intriguing, have no idea what an emitter follower is or what it does, but I'll look it up!

PeterH: Just to emphasize what Paul__B wrote: the PWM frequency is relatively low - much lower than 1500 Hz - so that's not going to work with LEDs.

How about replacing the LEDs with grain-of-wheat incandescent bulbs? It will probably require a transistor per output pin to supply the required current since I don't think you'll get a bulb working down to 20mA. Then the thermal inertia of the bulb would (hopefully) reduce flicker to acceptable levels. I don't know how much flicker would be acceptable, but you could raise the PWM frequency if necessary - or just do the PWM in software however fast you want.

Since you don't have enough PWM pins to control them all independently you may find it's best to do the PWM in software using a separate digital pin per LED anyway.

I can't replace the LEDs unfortunately, they are kind of special. I'm wondering about what you mean with "do the PWM in software" how would that work? Oh, right I got it. By turning the led on/off with some nifty code, probably using a millis-type-of-trick?

So fine, lets say I'll control each led individually for this project, that's alright, and something I feel comfortable with both soldering- and code-wise. Routing every single led to the same GND-pin wouldn't cause any problem, even if they are turned on at the same time (about 140mA)?

I got some more questions, but I'll post them as I go further though the project, might even solve some of them on my own.. :)

Thanks again for answers! / S