geekhack

geekhack Projects => Making Stuff Together! => Topic started by: epicepee on Sat, 08 November 2014, 16:14:00

Title: Hand-wiring a backlit keyboard
Post by: epicepee on Sat, 08 November 2014, 16:14:00
I'm building what amounts to a hand-wired Poker II.  I want backlighting.  What are my options?

I could wire all of the LEDs together, so they only take one pin to adjust.  I'd need a transistor for that, right?  I kinda doubt one Teensy pin could push that much power.

I could also do row/column scanning, like the switches.  Could I use some of the same wiring as the switches themselves, to avoid a rat's-nest nightmare?  Would I need transistors?

Also, what about resistors?  Do I need one on every LED?  Is there a way to use fewer?  How would y'all recommend soldering them?

Thanks!
Title: Re: Hand-wiring a backlit keyboard
Post by: neverused on Sat, 08 November 2014, 19:40:47
Look up the build log for the minimal animal keyboard, he addressed how he did it there. If I find a link I'll post it later.
Title: Re: Hand-wiring a backlit keyboard
Post by: dorkvader on Sat, 08 November 2014, 23:41:50
I'm building what amounts to a hand-wired Poker II.  I want backlighting.  What are my options?

I could wire all of the LEDs together, so they only take one pin to adjust.  I'd need a transistor for that, right?  I kinda doubt one Teensy pin could push that much power.

I could also do row/column scanning, like the switches.  Could I use some of the same wiring as the switches themselves, to avoid a rat's-nest nightmare?  Would I need transistors?

Also, what about resistors?  Do I need one on every LED?  Is there a way to use fewer?  How would y'all recommend soldering them?

Thanks!
few quick answers:

1. awesome, you can go with any MX or alps switch and any LED colour. Lots of options for DIY :p MX has the most support for stabilizers and keycaps.
2. you could do that but you would absolutely need a transistor. You wire the gate to the LED control pin and hit it with PWM out from the microcontroller to adjust brightness. Keep PWM frequency under 100 MHz because many transistors cant switch faster. 1khz is probably fine.
3. if you want to do row/colum scanning for the LEDs (that is to say have the microcontroller individually address every LED) you can't just wire them all together. you have to wire the LED-resistor pair (see below on that) in a matrix to the microcontroller. You can't wire them through the switches or it'll interfere with the KB trying to scan the switch matrix to see what's being pressed or not. Also MX switches are not rated for much current. Another option is to run them trough dedicated LED controller ships (corsair RGB uses one kind of LED matrix controller chip) or some other way to address that many individual units.
4. You usually need resistors. There are a few cases where you don't really require them but its much much easier to just get some resistors and be happy. 1k is a decent value and cheap, but if you let us know what LED colour and some further details about what you're thinking on  how to power this, I can further narrow it down for you (and show you how the calculation work (and why). Basically they limit the current (brightness and power consumptions) of the LED because the LED is constant voltage and tries to always drop the same voltage. you need them to keep under the 500mA maximum limit for USB and to keep the LEDs from burning themselves out with too much power (and blinding people)

Hope this helps
Look up the build log for the minimal animal keyboard, he addressed how he did it there. If I find a link I'll post it later.

http://deskthority.net/workshop-f7/minimal-animal-complete-build-log-t7779.html

Title: Re: Hand-wiring a backlit keyboard
Post by: neverused on Sat, 08 November 2014, 23:51:22
This may help:

https://www.adafruit.com/products/1427
Title: Re: Hand-wiring a backlit keyboard
Post by: epicepee on Sun, 09 November 2014, 16:25:16
This may help:

https://www.adafruit.com/products/1427

That looks awesome, except it can't do individual PWM.  I bet I could pull off PWM over the whole thing but it would be ugly -- powering an IC with PWM doesn't sound like a good idea.

EDIT:  So apparently it *can* do dimming, 16 levels at least.  Thank you for the suggestion!
Title: Re: Hand-wiring a backlit keyboard
Post by: dashing_girlboy on Sun, 16 November 2014, 02:25:59
I think you can do row/col if your teensy still have sufficient pins remaining. that way, you can just have a resistor every row/col provided that you are going to have just a uniform lighting with the same color LED. You will have to remember that different LED have different optimal working voltage.
Title: Re: Hand-wiring a backlit keyboard
Post by: DrHubblePhD on Sun, 16 November 2014, 09:58:54
Definitely want to know how you work this out!
Title: Re: Hand-wiring a backlit keyboard
Post by: Puddsy on Sun, 16 November 2014, 12:55:03
I've seen a few people do it, so I can assure you that it IS something possible. I think that they don't get PWM on every individual key, so you can only have all on or all off AFAIK.

I could be totally wrong though, this isn't something I've done deep research into.
Title: Re: Hand-wiring a backlit keyboard
Post by: dorkvader on Sun, 16 November 2014, 17:06:24
I've seen a few people do it, so I can assure you that it IS something possible. I think that they don't get PWM on every individual key, so you can only have all on or all off AFAIK.

I could be totally wrong though, this isn't something I've done deep research into.

you can get individual control on every key (via PWM or current limiting) with some dedicated LED control chips like what the corsair KB and the backlit QFR thing use.

won't make wiring any easier though.
Title: Re: Hand-wiring a backlit keyboard
Post by: epicepee on Sun, 16 November 2014, 22:10:07
Do you know of any PCBs that allow for individual-key backlight control?
Title: Re: Hand-wiring a backlit keyboard
Post by: Nightlane on Mon, 17 November 2014, 08:59:25
I am looking for a somewhat similar project, but I am looking to use a PCB and not really a poker2 clone. Looking too at backlit... https://geekhack.org/index.php?topic=64663.0

3. if you want to do row/colum scanning for the LEDs (that is to say have the microcontroller individually address every LED) you can't just wire them all together. you have to wire the LED-resistor pair (see below on that) in a matrix to the microcontroller. You can't wire them through the switches or it'll interfere with the KB trying to scan the switch matrix to see what's being pressed or not. Also MX switches are not rated for much current. Another option is to run them trough dedicated LED controller ships (corsair RGB uses one kind of LED matrix controller chip) or some other way to address that many individual units.
But, can we get our hands over that chip? I guess not :p. Something similar?

About K70 RGB: http://www.reddit.com/r/MechanicalKeyboards/comments/2jhe9h/corsair_rgb_keyboards_only_capable_of_512_colours/

As I was saying in my thread, I (we) could design a circuit to do backlit... the problem is that it is better to be condensed in the same chip (or some chips, but few) so it does not cost much money nor space...
Title: Re: Hand-wiring a backlit keyboard
Post by: dorkvader on Mon, 17 November 2014, 14:05:24
yeah you can just look it up. It's listed in the rgbgate topic here on GH and on the corsair forums. You can just buy it form mouser or digi-key.

Or just look up similar chips that might be cheaper, easier to solder, or easier to use.

I think bpiphany uses "4-10 Decoder Logic IC"s to expand the matrix. You might be able to do the same to control a large number of switches and LEDs.
Some info here:
http://deskthority.net/wiki/Costar_replacement_controllers

Look up the datasheet of the 74hc42 chip for more info.
Title: Re: Hand-wiring a backlit keyboard
Post by: Euf0ria on Tue, 18 November 2014, 02:04:26
I will subscribe to this thread=) Im in the making of my own hand wired keyboard and aim for individually controlled LED backlight for all switches as soon as i get the basic keyboard up and running. I will give you more info about my build soon and maybe if we share the same goal we could share some idéas back and forth too.

There seems to be a whole lot of choices for controlling a LED matrix today and many big panels use these to control hundreds of leds! Please check out this video talking about the Texas TLC5940
Two of these in a keyboard would be enough (i think) to make real magic!