Fullsize PCB with per-key RGB, is it possible?

I wonder if it is possible to make a fullsize PCB with per-key RGB, using WS2812B 3528 led ?

from what I found online, each led would consume up to 30mA (at maximum brightness), fullsize PCB would have over 100 led that mean 30 * 100 = 3000mA. the USB port can only provide about 500 ~ 900 mA (am I right?) => so there is not enough power.

let say I reduce the brightness of each led to half, meaning I still need 1500mA, still far from what USB port can provide.

is there anyways to make this work?
I’m no electrical engineer so I may have misunderstand something… pardon me :sweat:

Kono Kira and a few other 96 key boards have per key RGB, so at least 96 RGBs plus the Kira has underglow too, as well as some prebuilt keyboards. It can be done. No idea how.

I don’t know how they do it but my guess is PWM.

it’s probably something along the lines of alternating which ones are on at a time fast enough that you can’t tell, not sure if that specific LED gives you enough granularity to do that

There are several ways.

First of all, you don’t want to shine those LEDs at full power, they are designed for room lighting, not for signals, and it really doesn’t make sense. That reduces the power needs.

If it’s a bluetooth keyboard, it will have its own battery, so you don’t have to worry about currents, except it may be a bit annoying if your keyboard charges slower than discharged.

If you go for USB C plug, you can use USB PD to negotiate much more power from the host. There are ready chips that will do that for you.

And by the way, you probably want to use RGB LEDs with a data and clock line, such as APA102, instead of the WS2812B, because then you can drive much more of them even with a slow microcontroller without worrying about timings.

1 Like

this will only work if you use a C to C cable and plug into a host capable of giving that much power.

I have only worked with ATMega32u4.
I plan to make a wired keyboard that use USB C plug but I’m not sure about USB PD, would it fry other components? (if I’m not careful?)

does APA102 have a “3528” version? I mean the small version that would work for keyboard backlightning
below is the 3528 version of the WS2812


true… I guess putting them at 30% ~ 40% brightness is enough :thinking:

The idea is that you have a separate circuit that is responsible to negotiating the best voltage and current, and then converting that to whatever you use internally. It’s independent from your microcontroller then.

There is a 2020 SMD version, should me small enough? I have used them with the choc switches: Dorsch 40k Keyboard | Hackaday.io

All of what I’m about to say is based on my understanding of things and IANA electrician/hardware designer, but: as best I understand this does not technically require a USB-C connector and is not necessarily true for all USB-C connectors (it depends on if the cable is USB 2, 3, or 3.1, and if it’s 2/3 it has to additionally conform to the USB-PD 1 spec whereas that should be baked into USB 3.1 spec conformity). USB-PD predates the USB-C/USB 3.1 specs, but USB-PD 2 is part of the USB 3.1 spec (and only describes support for the USB-C connector). I mention this specifically due to the number of aftermarket keyboard-hobby custom USB-C cables that are USB 2 cables wired up with a USB-C connector.

With USB-PD 1 support, you could technically request up to 5000mA from a compliant host regardless of connector, buuuuut that’d depend on every single part of the chain conforming to the spec: the ports on the host computer, the cable, and the keyboard itself.

If… any of that is wrong please correct me.

You are correct as far as I can tell.