Electrical – How do computers power so many lights on a keyboard

batteriescircuit-designledlow-power

Beginner here. I am working on building my own keyboard PCB, and I wanted to add a backlight for my keys. However, I've been reading methods of powering teensy little 3mm LEDs and it seems like an impossible task to get 77 powered by anything less than a billion volt power supply with them in series or somehow get a billion amps pumped out to run them in parallel. (I know I'm exaggerating, but still…)

I'm looking at using white 3mm LEDs with a max current of 20 mA and a forward voltage of 3-3.4v. If I put all of the LEDs in series, I'd need 77*3.4V = 261V power supply, and if I put all of the LEDs in parallel I'd need to supply 77*20mA = 1540 mA of current. The teensy microcontroller that will process the keyboard inputs and that I plug into my computer is what I would like to power my LEDs, but its pins can only supply 3.3V at 250mA. (and I've only got 2 to use).

How do everyday computers power so many little key backlights without running out of battery immediately?

The only way I could think of getting this to work would be to have a separate power supply of a million AA batteries taped to the bottom of the keyboard separately powering just the LEDs.

Is there a better solution out there?

Thank you for your time.

Best Answer

If keyboard components aren't rated for LED light through them, don't buy them. They are likely to be opaque, which means you could put a searchlight down there and not get any light through. Anyway you would be unable to power it off USB, and you'll need to get under 2.5W for that, and will want to get under 500mw if possible.

How to size

Let's take this Cree C512A-WNS/WNN LED. It's rated up to 25ma but the specs assume 20ma test current. Forward voltage is 3.2-4.0 depending on how hard you want to overdrive it.

After the initial specs, the next thing you see on the data sheet is about binning. When they manufacture these, they get variances. They sort these into "bins" by luminous intensity at current, operating voltage, color temperature (that's the CIE chromaticity chart), etc. You select the bin code that you want for your lights, and the pricing is decided by supply/demand, e.g. how well that bin is produced vs selling.

Then you get into the performance charts. Now, if these were illumination LEDs, Cree would produce full-page charts with more detail. But this is sold as an indicator LED, so they sorta hustle by these points.

Current vs voltage

enter image description here

Note that this curve is actually much, much steeper than it appears. The current scale starts at 0 but the voltage scale starts at 2.8. This makes it difficult to drive it at constant-voltage mode, e.g. you have to hit 3.0V pretty precisely if you want 15ma.

Further, this chart varies by temperature, which is not shown. As the LED warms, current increases for a particular voltage, and it increases fast, because this is a very steep curve. If you drove it with 3.00V, it would draw 15ma until it warms, then 20ma, which would hasten warming, 25ma, warming faster still, 35ma, 50ma, 100ma, pop.

That's called thermal runaway.

The preferred way to drive LEDs is constant-current mode. Then, behavior will be fairly consistent. Drive voltage will drop slightly because now you're looking at the curve sideways: the curve is pretty flat from this view.

Voltage at current also gives you power (watts).

Luminous intensity at current

enter image description here

The lower scale is the milliamps of current. The side scale is the luminous intensity, and it's expressed as a factor of the spec (back on page 2-3). 1.0 is exact spec. 2.0 is double the spec.

Note that 100% of spec happens at 20.0ma, and 200% of spec happens at 53ma - that's not very efficient at higher power, is it? It's worse than that.

  • 100% of spec 20.0ma happens (according to the other chart) at 3.2 volts (giving 64 milliwatts), but
  • 200% of spec (53ma) happens at 3.75V (giving 198mw) -- in other words twice the light takes 3x the power. Efficiency really falls off at higher power, eh?

Blinded by the light!

However, 198mw x 77 keys means 15.3 watts of searing LED light. Assuming typical poor 85 lm/w from a Cree LED overdriven that hard, that's 1300 lumens - the brightness of a fluorescent tube. That's orders of magnitude more than you want in a keyboard.

Even the more docile 100% power, 64mw x 77 keys is 4.9 watts, too much for USB, and at the typically good efficiency of Cree LEDs in spec of 120 lm/w, that's 600 lumens of light. Somewhat more than a 40W incandescent bulb. Not a thing you'd want to be looking at.

If we calm that down to something like 1/10 of that, 0.49 watts (which puts us inside the allowable limit for low-power USB ports)... that's 6.4mw per LED, that happening at 2.0 ma per LED (10% of spec).

The efficiency curve continues to be curved, and so at 10% of power, I would expect ~15% of light. That's 90 lumens of light. Even that, you will want a "dim" option on.

The best way to dim LEDs is reduce their current in the driver. The second-best way is PWM.

Series vs parallel

You propose all-series (stupendous voltage) or all-parallel (high current, poor inter-LED regulation).

You'd want to drive these actively "constant current" (though you might vary current to select brightness, the point is, the driver would seek to a target current, not a target voltage.

Series is simplest, but then, you have a keyboard that can kill you. (6.4ma would definitely get your attention; whether this is dangerous is a health-and-safety question, but US style GFCI protection devices trip on 5ma, so I would say it's of concern.)

So I recommend something in the middle. Have multiple series strings wired in parallel. Since your 77 number is the factor of two prime numbers, 7 and 11, either make them strings of 7 (@22.4V), or strings of 11 (at 35.2V). The LEDs will vary somewhat, so to even out these, I'd add one dropping resistor on each string. The linear resistor plus the very non-linear LEDs will dampen out these differences.

Drive that with a boosting constant-current supply, at 7x or 11x target current (adjusted for brightness if you do that).

Related Topic