Author Topic: ws2812 leds on pcb  (Read 3247 times)

0 Members and 1 Guest are viewing this topic.

Offline sup_beaches

  • Thread Starter
  • Posts: 2
ws2812 leds on pcb
« on: Mon, 14 October 2019, 00:21:16 »
Hello guys,
I started making my pcb and I have a few questions regarding ws2812 leds. 
I've seen some boards that have a cutout for the leds, and they are mounted on the bottom shining through the cutout.
Are there any ws2812 footprints for Kicad, that have the cutout?
Also I'm considering using the smaller ws2812, the 3535 variant, or sk6812 as I've seen they're called. I was thinking mounting them on the top side of the pcb. Also since I'm limited to the 500mA of the usb 2.0 spec, I will need to limit the overall brightness anyway so if I can get away with the smaller 3535 ones it would be great. Since they draw less current, I'll use a higher software cap for brightness, which in turn gives me more dynamic range for brightness. I think qmk is limited to 256 steps total.
I'll use Hako Royal Clear which have the bottom case cutout for leds.
I'm not that big on rgb spill, I pretty much prefer only the legends to be lit up. So theoretically top side mount of the led should fit further into the switch (switches that have the cutout) and reduce side spill? 
I've studied photos of some of the latest boards and I haven't seen any ws2812 ones, although the ones used look very similar. I say that because I've seen these boards use IS31FL3731, which I don't think is able to drive ws2812 leds. I think this driver is used to drive leds that have anode + 3 cathodes (r/g/b), so basically 3 control wires to each led. I'm not sure why they went this route, because it seems more complicated to integrate. Maybe ws2812 leds are more expensive than the "simple" ones?
Can 68 x ws2812 leds be driven from the usual suspects microprocessors? Or should I add a buffer halfway? 
Can't seem to find much info on ws2812 leds integration for keyboards.
Any info is welcomed. Thank you!

Offline Findecanor

  • Posts: 5040
  • Location: Koriko
Re: ws2812 leds on pcb
« Reply #1 on: Mon, 14 October 2019, 01:19:20 »
Each WS2812 and SK6812 "LED" has its own driver circuit, and they are connected in series controlled with a serial protocol from the microcontroller, not by a LED driver. I think they are only available as SMD and can't be mounted upside-down.
The WS2812 is often used for sideglow/underglow out the sides of the keyboard/onto the desk, and there are usually not more than 16 or so of them on a PCB.

I think what you are looking for are simpler "dumb" RGB LEDs driven by a LED driver designed to drive RGB LEDs.
The IS31FL3731 is made to drive 144 single-colour LEDs, but uses not a regular matrix but a trick called "charlieplexing" to reduce its pin count.  However, something to avoid when designing a RGB board is colour artefacts from red, green and blue not being driven at the same time, and I think that would be difficult to avoid on a charlieplexed RGB board.

The IS31FL3733 supports 192 LEDs (64 RGB) in a regular matrix. You can check out the schematics for the Input Club K-Type which uses two of these (I think both for keys and sideglow). You can find support for the K-Type in QMK's main source tree but you might have to copy and paste some source code.
ISSI has other chips that seem to be similar, but with a higher pin count for driving more LEDs from a single driver and you might have to write code for those in QMK yourself.
« Last Edit: Mon, 14 October 2019, 01:32:30 by Findecanor »
🍉

Offline sup_beaches

  • Thread Starter
  • Posts: 2
Re: ws2812 leds on pcb
« Reply #2 on: Mon, 14 October 2019, 02:17:05 »
I was just reading about each ws2812 led regenerating the signal and passing it on. So no need for a buffer. Theoretically I can drive as many as I need as long as I have the current for them.
Why is this led used for side glow, but not for each switch? I don't understand why would you add the charlieplexing chip and increase number of traces/bom etc?
I'll check if the 3535 version fits under the switch on the topside.
One important factor seems to be the fact that these chips have a 1mA idle current draw. I guess the internal controller eats that. So for 68 leds thats 68mA for basically nothing. This would be important for battery applications as you'd need to design an on/off switch for the 5V feeding them.
« Last Edit: Mon, 14 October 2019, 03:01:24 by sup_beaches »