Author Topic: Optimal Trace width for LED power  (Read 6172 times)

0 Members and 1 Guest are viewing this topic.

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Optimal Trace width for LED power
« on: Tue, 05 December 2017, 20:51:22 »
I am designing a custom fullsize keyboard (108key) and plan on using 132 SK6812 LEDs for both per switch RGB and under glow, and because of that I will need quite a bit of current to run these properly.

So the question is what is the best width for the traces in order to get power delivered efficiently and be able to handle the levels of current I will be needing? And along with that, What is the best way to route them on the PCB?

Another question, What do you think is the best way to power the LEDs? I was planning on using a 5v power brick that plugged into a barrel jack on the PCB and going from there. What amp rating would be optimal to run these? I know that the max current that these LEDs can draw, according to the datasheet, is 50 mA, which would mean in total I would have 6600 mA, which is quite a bit, would I truly need this much or is there a safe way to limit how much current is drawn that won't affect the brightness too much? And is there any failsafe that I should add in case something shorts out?

EDIT: Now that I look at it I may drop the LED count closer to 108, not seeing a feasible way to route the last 24 LEDs. So under glow may be out.
« Last Edit: Tue, 05 December 2017, 20:55:57 by BlindAssassin111 »

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #1 on: Tue, 05 December 2017, 23:26:01 »
i can't remember the specific track widths (I'll check) but I didn't use anything special above the standard traces used for the key matrix. In either case the resistors (I have one per LED, all arranged in parallel in LED/resistor pairs) would give you greater resistance than the traces. I also added a rheostat in series with the LED clump to control the power going in to be able to adjust the current in case the LEDs get too loud. Full size, 106 keys, bright white LEDs all around.

In terms of how best to run the traces - I kept all traces on one side of the plate as much as I could (switch matrix, 5V traces for LEDs), to be able to have a mostly uninterruped ground plate on the other - I then just wired all the LEDs with direct traces to the 5v, then just dump the other end into the ground plane. Saves running the LED traces back to the controller.

NB: I used a Teensy++ using one 5V output, and connected (2) GND connections to the ground plane. Works swimmingly for me. I designed for 100Ohm resistors + 200Ohm rheostat, I kept being sent 1kOhm resistor so used those in the prototype to see how they worked. Full brightness is fine but I'd like to get them a little brighter. I haven't tried the 100Ohm yet but I get the feeling max will be waay to loud. Hence the rheostat to tune - LEDs are apparently finicky and vary even within batch.

EDIT: re-reading your post I see you're using RGB - this obv. complicates the traces above what I did which is single colour static. Full RGB for this many sounds like a routing nightmare. If it were amateur me I'd put as much keyboard matrix on one side of the board, then all the LED RGB on the other, then weave back to ground on the KB matrix face. I don't think you could do a ground plane unless you go three layer which is above and beyond what I know about dealing with. Keeping the split distinct, neat, and tidy.

EDIT2: LEDs are rated for max brightness - you can run them at much lower current (at least one-colour) for comfortable keyboarding. Full is way too much anyway. I was figuring, iirc, at 2mA per LED, though I'd need to double check my notes to confirm.
« Last Edit: Tue, 05 December 2017, 23:39:51 by emenelopee »

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #2 on: Wed, 06 December 2017, 00:05:52 »
The reasons I wanted/need to use an external power supply are:
    1) The SK6812 LEDs require a cap on the power/gnd for each LED and from what I have been told there is a 10 μF limit over usb and with a recommended cap for each LED of 0.1 μF, even with just the key LEDs I am
        over the limit.
    2) The current required to drive at full brightness is way above what the USB would be able to do even if the caps weren't an issue.

Now do the LEDs need to be full brightness, probably not but I have never tested how bright the SK6812's get so I have no idea if I can run them lower and be happy. The goal is also to do a small GB to help fund this as it is quite expensive for just one person to jump into...

In regards to how you mentioned to run the traces, I am using a 4 layer board to simplify the routing as I don't want to use a couple thousand vias and spend the time to fit it on only 2 layers. It may not help cost, but at a quantity of only 10, I am happy with the cost and it is quite reasonable, may save money per board but it isn't enough for me to waste the days just trying to solve that, especially as the board is laid out minus the LED traces.

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #3 on: Wed, 06 December 2017, 00:11:55 »
Oof, 4-layer? I fold, this complication is outside my level of knowledge - I kept mine as dumbed down as possible. Good luck, and keep the updates up!

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #4 on: Wed, 06 December 2017, 00:27:05 »
4 layer isn't all that hard to do actually, this is my first time doing a pcb with that many layers as everything I have designed before was possible with 2 and some only needed 1. Just have to think of how you want to lay it out, and try and stick to only certain things on each layer and use vias only when necessary to reach things like SMD components on the other side of the board or if there is no other way to connect two pads. Only reason I am using vias on my board is due to the dumb pad layout of the SK6812 putting the power and ground diagonally on the chip which means you have to just multiple layers just to use those LEDs not matter how simple your pcb is...

Hopefully once I figure out the issues listed in the OP, I will be able to start an interest check and get this rolling sooner rather than later. Sadly need a higher post count though, despite having created my account in 2013...

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: Optimal Trace width for LED power
« Reply #5 on: Wed, 06 December 2017, 05:29:24 »
I usually use 20 mil for power traces and had no problems with either the MCU or the discrete LEDs but perhaps this calculator can help.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #6 on: Wed, 06 December 2017, 11:13:54 »
I usually use 20 mil for power traces and had no problems with either the MCU or the discrete LEDs but perhaps this calculator can help.

I found that calculator as well but when I put the max current in, the trace width for an inner 1 oz layer was 273 mil...which is massive. So not sure exactly where to go from here knowing that.
« Last Edit: Wed, 06 December 2017, 11:51:31 by BlindAssassin111 »

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #7 on: Wed, 06 December 2017, 13:31:23 »
I hadn't actually seen this calculator before. Thanks to some serendipity it works out to 10 mil trace for the 420mA I'm drawing which is what I used, at least before I get to the ground plane. Phew, lesson learned. It makes me realise how little I know!

Having said that, I'd suggest investigating how bright you actually need your LEDs to be - full capacity is huge and I'm finding even 2mA is pretty much bright enough, at least for under-keylighting, and that would knock your 6600mA down by an order of magnitude.

Take this with a grain of salt - I'm no expert.

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #8 on: Wed, 06 December 2017, 13:49:27 »
Having said that, I'd suggest investigating how bright you actually need your LEDs to be - full capacity is huge and I'm finding even 2mA is pretty much bright enough, at least for under-keylighting, and that would knock your 6600mA down by an order of magnitude.

Yeah I am thinking full bright may not be needed but I also don't know of a way to safely limit the current draw of the SK6812 LEDs, seeing as they have built in controllers and need a specific voltage to run properly. If I was able to drop the current needed down to even 3000mA that would only need a 36 mil trace on external layers (realized I have power on the back so should have looked at the external trace limit before, which was still massive at 105 mil).

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #9 on: Wed, 06 December 2017, 21:40:17 »
Also if anyone knows the dimension in between cherry stabs, dimesnion "A", for a 6.25 spacebar I would appreciate it. Found the cherry specs but wasn't sure if the spacing is the same for the 6.25 as the 7 as that is the smallest space bar they spec out...

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: Optimal Trace width for LED power
« Reply #10 on: Thu, 07 December 2017, 04:53:46 »
Also if anyone knows the dimension in between cherry stabs, dimesnion "A", for a 6.25 spacebar
From center to center 3.96'' or 100.58 mm

wasn't sure if the spacing is the same for the 6.25 as the 7
7u is wider. 6.25u also works for 6u and 6.5u.

What software are you using?

My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #11 on: Thu, 07 December 2017, 12:43:22 »
I kinda figured that the stabs would be closer for the 6.25 but after hours of searching I couldn't find a footprint or anything accept for the older cherry pdf going over dimensions and 7 was the smallest they listed besides the 2's.

I am using KiCad.

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #13 on: Thu, 07 December 2017, 15:49:12 »

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #14 on: Sun, 10 December 2017, 13:00:35 »
Anyone have any ideas on what I should make the trace width? I am still designing the pcb and it would really help to know what the best route is. I currently have the traces set to 1mm(39.37 mil) and would like to know the best way to limit the power needed to run the now 120 leds, no longer be doing a full underglow just the bottom half of the board in order to do a glow ring around the front half for accent.

With that said, I would only be able to run them at half the max current, but don't know of a way to safely limit them.

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #15 on: Sun, 10 December 2017, 17:41:48 »
Looks like it's time for some mockups? I'm not sure if your two uncertain variables - min driving current and preferred brightness of LEDs - can be easily answered by the hive mind...

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #16 on: Sun, 10 December 2017, 18:33:17 »
Looks like it's time for some mockups? I'm not sure if your two uncertain variables - min driving current and preferred brightness of LEDs - can be easily answered by the hive mind...

I could do a small mockup but I am not sure of the best way to limit the current draw from the LEDs as I will be using QMK. Should I somehow just limit the max brightness via the firmware or is there a better way. That is truely the main issue, from there then I will be able to do a test as I already have a small sweet16 from 1upkeyboards that I can wire a single SK6812 to and find out how it looks.

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #17 on: Wed, 20 December 2017, 12:32:25 »
Okay, so quick update. I figured out how to get a lot more current to each LED but I am still limited to only 5 amps as I can't find a barrel jack that can take more current. I need 6.3 amps for full power but at 5 amps that is ~80% of there potential (assuming current to brightness is linear).

Now the only other issue I am having is my drill file does not make the holes in the correct location, all of them are bunched into the top left corner near the origin and none are in the correct spots. I am using KiCAD and have read many forum posts and blogs about how to export it but it never works out...

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #18 on: Wed, 20 December 2017, 23:23:58 »
So the drilling issues only show up on the Seeedstudio gerber viewer and when I go to OSHPark everything is fine and they are read properly. Not 100% sure why that is but it seems to be fine atm. Will be designing the plate soon hopefully and may open an IC to see if even a few are willing to jump in as I can't afford to just buy a small batch for myself atm only 1 or 2 boards depending on price point.

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #19 on: Thu, 21 December 2017, 00:36:55 »
It took me a while to find a decent second source gerber viewer: try GerberLogix - it's simple 8-bit Win 3.1 but nice and robust.

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #20 on: Thu, 21 December 2017, 00:58:10 »
It took me a while to find a decent second source gerber viewer: try GerberLogix - it's simple 8-bit Win 3.1 but nice and robust.

Wow thank you for that!!! I used it and everything seems to be fine with the files, only odd thing is some of the holes show up as pink and some show as white. Not sure why that is, maybe pink is for NPTH and white is for PTH? Or maybe it is because the holes didn't export properly and they don't show as going through the whole board.

Offline emenelopee

  • Posts: 398
  • *klomp klomp klomp* I step on your house 🦖
Re: Optimal Trace width for LED power
« Reply #21 on: Thu, 21 December 2017, 01:06:10 »
Holes do show funny, I recall slots didn't show at all, otherwise the colour coding is on the left - overlaying colours will combine so it's best to look at layers independently or only a few at a time. Mess around with the tick-boxes on the left. WARNING: colours will change depending on the order you turn the layers on. It's weird but that's where the 8-bit charm comes in.

Offline BlindAssassin111

  • Thread Starter
  • Posts: 1106
  • Location: Behind you
  • I design keyboards and stuff.
    • Viktus
Re: Optimal Trace width for LED power
« Reply #22 on: Thu, 21 December 2017, 21:48:05 »
Okay so I am mostly done with the plate but I am running into an area I know nothing about, stabs. The pcb is both alps and cherry compatible but I can't figure out what stabs work with alps caps in case someone wants to use a specific set I don't want to prevent that. I know matias sells alps style stabs but I have had no luck figuring out what the distance between the small cutouts is, I have only found the cutout size. As well I have no idea what stabs can work with alps caps, like costar or if I should just use cherry and the standard alps stabs and skip costar entirely. I also need the plate to be able to work with plate mounted stabs as I had no room for holes for pcb stabs, so keep that in mind for help.

I downloaded a plate from builder.swillkb.com in order to look at the dimensions better and I can get closeish but I would like to have more exact dimensions. And no I can't use the plate generated there as I used a non-traditional spacing between parts of the keyboard and will not be changing it just because of that builder.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: Optimal Trace width for LED power
« Reply #23 on: Fri, 22 December 2017, 04:01:37 »
I have had no luck figuring out what the distance between the small cutouts is, I have only found the cutout size.
Try asking here.

As well I have no idea what stabs can work with alps caps, like costar or if I should just use cherry and the standard alps stabs and skip costar entirely.
Alps never made a 7u stabilizer so you have to go with either Cherry or Costar for that one. Other keys would require a specific cutout for ALPS and, as I far as I know, no one ever made a Cherry + Costar + ALPS combined cutout. In other words, you'll have to design different plates accordingly with the chosen stabilizer.

I also need the plate to be able to work with plate mounted stabs as I had no room for holes for pcb stabs, so keep that in mind for help.
The Cherry + Costar cutout will work with Cherry plate mounted stabilizers.

My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff