Handwiring LED's?

lilspoon

25 Mar 2018, 05:29

I've handwired a TKL board together 2 years ago and am looking to do so again except with LED's this time. Could anyone recommend any guides/resources in how to do so?

Thanks!

User avatar
j0d1

25 Mar 2018, 06:02

Can you be more specific on what you want to do with the LEDs?
Do you want single color LEDs or RGB LEDs?
Do you want to be able to program the LEDs?
There is a huge difference in design between a strip of LEDs under the keyboard vs programmable RGB LEDs!

lilspoon

25 Mar 2018, 06:24

Aww shucks, i see, that goes to show how ignorant I am and how clueless I am about the topic!

I am interested in using a single color LED for each key, although I am open to the idea of LED strips as well. @jod1 are there any wiki's / guides you can direct me to ? appreciate the help.

Findecanor

25 Mar 2018, 10:59

Search the web for "LED matrix" for examples of LEDs controlled by Arduinos based on AVR microcontrollers.
If you don't want/need the LEDs to be individually addressable you could of course make it simpler, with a 1×n matrix.

Underglow is usually done with smart LEDs connected in series, controlled over a single line to the first in the series.
QMK firmware support for WS2811 and SK6812RGBW smart LEDs for underglow.

BTW. QMK supports backlighting but uses only a single PWM pin and I am not so sure that that is a good idea to drive them all at once.
Manual driving of a matrix would best be done with an interrupt-driven routine and adding that to a keyboard firmware is not straightforward. Could be fun for an experienced programmer, if you are and are so inclined, though.
I think there are also IC:s for driving LED matrices — which is what commercial keyboards with RGB backlighting have.

User avatar
j0d1

25 Mar 2018, 14:02

lilspoon wrote: I am interested in using a single color LED for each key
Ok and I assume you don't want to control each LED individually.

In that case, a matrix of single color LEDs is very similar to a matrix of switches.
You build a MxN matrix and then you scan that matrix at a certain frequency to give current to each LED.
This technique is called Pulse-Width Modulation (PWM).

* What is a LED
* What is Pulse-Width Modulation

A TKL has 87 keys, so the optimal matrix for the LEDs is 9x10, which means you need 19 pins on your micro-controller.
That's an extra 19 pins that you already need to control the switches, ouch.

Fortunately, you don't need to ask your micro-controller to do all the work.
You can buy a second micro-controller, often called a LED driver, that will do all the job for you.
All you need to do then is to wire that LED driver to your main micro-controller (via I2C in that case) and send commands to it, like dimming the LEDs for example. Here is a nice tutorial for that particular model.

Hope it helps!

lilspoon

25 Mar 2018, 19:20

Hmm okay, now I have a place to start! Thanks!

lilspoon

25 Mar 2018, 19:47

So from what I've seen online, I need a powersupply and resistors for the LED's correct?
The idea of smart LED's in series interests me more now that I've seen projects with underglow to them! I'm gonna start with hooking up an LED driver to my main microcontroller (Teensy 2.0).

Post Reply

Return to “Keyboards”