Author Topic: Keyboards with backlighting and current draw  (Read 1715 times)

0 Members and 1 Guest are viewing this topic.

Offline engicoder

  • Thread Starter
  • Posts: 721
  • Location: North Carolina
Keyboards with backlighting and current draw
« on: Fri, 20 June 2014, 21:33:28 »
The news of the Corsair RGB keyboard got me thinking about backlighting and current draw and I was a bit puzzled at how they are able to feed all the LEDs on just USB current. I'm going to throw a stream of thought out there and am interested in any feedback....just an engineer trying to understand.

Alright...

Most visible light LEDs have a forward current of about 20ma. Therefore a 104 key keyboard with RGB backlighting would have a theoretical max possible current draw of 104 x 3 x 20 mA or 6240 mA for full power, white. The LEDs are PWM driven so the average power they draw is reduced by the inverse of the duty cycle, but to get down to 500 mA would require the current be reduced by a factor of 13. My first question was, at the level would the LEDs be bright enough?  I suppose if you consider the non-linear nature of the human eye (gamma), we are good a differentiating changes in brightness at the dark end of the scale, so I guess its ok if we loose a large chunk of the top end, as small changes in the bottom end with still be detectable.

Am I correct in assuming that all the backlit keyboards are using low duty cycles to drive the LEDs or am I missing something?
   

Offline Grendel

  • Posts: 462
  • Location: OR, USA
    • Firmware for Costar Replacement Controllers
Re: Keyboards with backlighting and current draw
« Reply #1 on: Sat, 21 June 2014, 00:10:43 »
The 20mA is the current the LED will operate safely at the specified values. Take a look at this LED -- 8.4cd at 20mA is actually dangerous to your eyes ;) I'm using it w/ less than 1mA and still had to dim it via PWM. If you can find similar performing crystals for R & B, all you need is 3mA per switch. You also could drive only one color at any given time, rotating through them, or use non-overlapping PWM patterns (I believe the G710+ actually does that.)
Currently using: RK-9000WH/GR, CMS QFXT w/ Ghost Squid
- I'm game !

Offline Darwin

  • Posts: 20
Re: Keyboards with backlighting and current draw
« Reply #2 on: Sat, 21 June 2014, 05:54:55 »
Maybe this is related to those people who are saying they see their LEDs flicker in the dark?... A major reason to consider not buying a illuminated keyboard.

Offline engicoder

  • Thread Starter
  • Posts: 721
  • Location: North Carolina
Re: Keyboards with backlighting and current draw
« Reply #3 on: Sat, 21 June 2014, 07:42:58 »
The 20mA is the current the LED will operate safely at the specified values. Take a look at this LED -- 8.4cd at 20mA is actually dangerous to your eyes ;) I'm using it w/ less than 1mA and still had to dim it via PWM. If you can find similar performing crystals for R & B, all you need is 3mA per switch. You also could drive only one color at any given time, rotating through them, or use non-overlapping PWM patterns (I believe the G710+ actually does that.)

Are you saying you are using a resistor to restrict the LED current to 1mA and also using PWM? I was wondering also about using larger value current limiting resistors to keep all LEDs a lower current and then the full PWM range would be preserved.
   

Offline Findecanor

  • Posts: 5042
  • Location: Koriko
Re: Keyboards with backlighting and current draw
« Reply #4 on: Sat, 21 June 2014, 08:24:08 »
AFAIK, the Deck Legend does not use PWM. Every two LEDs are in series with one shared resistor, which is supposed to have less current draw than if there was one resistor per LED (source).
🍉

Offline engicoder

  • Thread Starter
  • Posts: 721
  • Location: North Carolina
Re: Keyboards with backlighting and current draw
« Reply #5 on: Sat, 21 June 2014, 13:55:10 »
AFAIK, the Deck Legend does not use PWM. Every two LEDs are in series with one shared resistor, which is supposed to have less current draw than if there was one resistor per LED (source).

Yes...Voltage drops about 1.7-1.9 volts across an LED.  The formula for current draw is I = V / R. Therefore, with two in series, you will get twice the voltage drop. The voltage (V) using to calculate current will be the base voltage (Vcc) minus twice the voltage drop. Since V will be lower than a single LED, the current will be lower given the same resistor. Of course, they could have used a higher value resistor, but using one per two LEDs, saves on component count. The down side to this is that if the voltage drop (aka forward voltage) of the two LEDs is not identical, they will POTENTIALLY vary in brightness SLIGHTLY.
   

Offline False_Dmitry_II

  • Posts: 1107
Re: Keyboards with backlighting and current draw
« Reply #6 on: Sat, 21 June 2014, 16:59:43 »
AFAIK, the Deck Legend does not use PWM. Every two LEDs are in series with one shared resistor, which is supposed to have less current draw than if there was one resistor per LED (source).

Yes...Voltage drops about 1.7-1.9 volts across an LED.  The formula for current draw is I = V / R. Therefore, with two in series, you will get twice the voltage drop. The voltage (V) using to calculate current will be the base voltage (Vcc) minus twice the voltage drop. Since V will be lower than a single LED, the current will be lower given the same resistor. Of course, they could have used a higher value resistor, but using one per two LEDs, saves on component count. The down side to this is that if the voltage drop (aka forward voltage) of the two LEDs is not identical, they will POTENTIALLY vary in brightness SLIGHTLY.

If the solution of lighting only some at a time via PWM is only noticed by some, I think a slight variation in constant brightness would be less noticable than some LED's turning off entirely based on its timing.
"Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety." - Ben Franklin (11 Nov. 1755)

Offline Melchior

  • Posts: 37
Re: Keyboards with backlighting and current draw
« Reply #7 on: Mon, 23 June 2014, 21:25:21 »
PWM LED drivers are turning the LED off/on with a square wave at a certain frequency.

Anywhere from 100hz to 50Khz, that makes all the difference.

Its the 'Duty' cycle - the amount the wave is ON vs. OFF that is in effect the "brightness".

Basically if they can not botch the electronics (e.g. drive at 300-400 Hz) it is usually enough.
Ducky ONE    |   CM Recon

Offline Justintoxicated

  • Posts: 160
Re: Keyboards with backlighting and current draw
« Reply #8 on: Tue, 24 June 2014, 17:12:43 »
You don't add current for each LED together like that, that's why it works.  If they are in series the total maximum current for every LED together would still be 20ma...  You can only add current when the diods are in parallel.  milliamps is a measurement of current, which you can think of as flow.  The real thing you need to worry about is total power draw, and yes USB has plenty of power for the LEDs in a keyboard.

Offline Grendel

  • Posts: 462
  • Location: OR, USA
    • Firmware for Costar Replacement Controllers
Re: Keyboards with backlighting and current draw
« Reply #9 on: Tue, 24 June 2014, 17:33:22 »
The 20mA is the current the LED will operate safely at the specified values. Take a look at this LED -- 8.4cd at 20mA is actually dangerous to your eyes ;) I'm using it w/ less than 1mA and still had to dim it via PWM. If you can find similar performing crystals for R & B, all you need is 3mA per switch. You also could drive only one color at any given time, rotating through them, or use non-overlapping PWM patterns (I believe the G710+ actually does that.)

Are you saying you are using a resistor to restrict the LED current to 1mA and also using PWM? I was wondering also about using larger value current limiting resistors to keep all LEDs a lower current and then the full PWM range would be preserved.

Yes, the LED's are given 1mA current and are then driven via PWM for brightness control.
Currently using: RK-9000WH/GR, CMS QFXT w/ Ghost Squid
- I'm game !

Offline Justintoxicated

  • Posts: 160
Re: Keyboards with backlighting and current draw
« Reply #10 on: Tue, 24 June 2014, 18:31:26 »
The 20mA is the current the LED will operate safely at the specified values. Take a look at this LED -- 8.4cd at 20mA is actually dangerous to your eyes ;) I'm using it w/ less than 1mA and still had to dim it via PWM. If you can find similar performing crystals for R & B, all you need is 3mA per switch. You also could drive only one color at any given time, rotating through them, or use non-overlapping PWM patterns (I believe the G710+ actually does that.)

Are you saying you are using a resistor to restrict the LED current to 1mA and also using PWM? I was wondering also about using larger value current limiting resistors to keep all LEDs a lower current and then the full PWM range would be preserved.

Yes, the LED's are given 1mA current and are then driven via PWM for brightness control.

Surely you mean 1 amp of current then PWM? 

From wikipedia on PWM:  "The average value of voltage (and current) fed to the load is controlled by turning the switch between supply and load on and off at a fast pace. The longer the switch is on compared to the off periods, the higher the power supplied to the load."

@.1 amps I don't think the LED's would light up very bright ;)

Offline Grendel

  • Posts: 462
  • Location: OR, USA
    • Firmware for Costar Replacement Controllers
Re: Keyboards with backlighting and current draw
« Reply #11 on: Tue, 24 June 2014, 18:39:55 »
Each LED is allowed 1mA max, they are then turned on/off via a PWM signal.
Currently using: RK-9000WH/GR, CMS QFXT w/ Ghost Squid
- I'm game !

Offline dorkvader

  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Keyboards with backlighting and current draw
« Reply #12 on: Tue, 24 June 2014, 21:05:28 »
You also have to account for the power loss through the resistors.

This isn't usually significantly, but will make a difference in your accounting.

I think grendel is right: 1 mA per LED is plenty bright, so it makes a lot of sense to set that as the "max" and then use PWM to make it dimmer from there. That's how I'd do it, were I them.

Then again, large LED drivers are getting cheaper, so it's possible to control a full keyboard in three colours with current limiting.

Offline Justintoxicated

  • Posts: 160
Re: Keyboards with backlighting and current draw
« Reply #13 on: Wed, 25 June 2014, 14:12:13 »
You also have to account for the power loss through the resistors.

This isn't usually significantly, but will make a difference in your accounting.

I think grendel is right: 1 mA per LED is plenty bright, so it makes a lot of sense to set that as the "max" and then use PWM to make it dimmer from there. That's how I'd do it, were I them.

Then again, large LED drivers are getting cheaper, so it's possible to control a full keyboard in three colours with current limiting.

well it would depend on the LED and the forward voltage but I can see 1ma being fine.