2

I'm currently designing my own 60% per-key RGB mechanical keyboard. (60% means the keyboard only contains 60% of the keys of a regular keyboard.)

I've laid out the components, routed the switch scan matrix. I could theoretically finish the board with only two layers, but I know it's going to be a mess of vias and I've just started laying out the R, G, B traces.

The board is USB-C and designed around an ATMEGA32u4 and an IS31FL3733 led driver. The switches I'm using are cherry-MX styled, with RGB THT LEDs on each switch.

Do I really need to switch to four layers? The board is 287mm * 100mm and I can't make it bigger. It's not going to be a production board, just a hobbyist project (I say this for EMI).

And what do you think the best layer stackup would be? I've done plenty of two layers boards but never a four layers one.

Here's a picture of my PCB just to get an idea :

JYelton
  • 32,302
  • 33
  • 134
  • 249
  • 2
    For me, when working on low qtys of boards, its when the extra cost of 4 layers is smaller than the time/effort it would take to lay the board out in 2 layers. (which is basically always). For low volume, its so much easier to layout in 4 layers that except in the most basic cases I always use 4 layers. – Wesley Lee Aug 12 '21 at 12:32
  • but in this case, you layout seems to be pretty trivial – so no benefit to go to four layers, either. – Marcus Müller Aug 12 '21 at 12:33
  • 1
    Your USB d+ and d- follow a long and windy path with lots of vias, I'd try and optimise that a bit. – Colin Aug 12 '21 at 12:41
  • Okey thanks all of you guys for your feedback, I'm going to stick with 2 layers, and re-work those USB traces ;) – Whathefrench Aug 12 '21 at 12:57
  • 3
    The USB traces may be an issue. They need to be routed as a *differential pair* with a *characteristic impedance*. It may not be possible to achieve it with two layers if the distance to ground plane is too much which depends on PCB thickness. But you can move the MCU next to the connector so the impedance mismatch is not too long. – Justme Aug 12 '21 at 13:14
  • 2
    Also note that if a screw head contacts the PCB at any of those through-hole areas, a nylon washer (or screw) will be needed. Metal screws tend to scrape off solder mask and short/damage traces. – rdtsc Aug 12 '21 at 13:21
  • 1
    If possible, but the keyboard in usb1 low speed mode so that you don't need to worry about routing ~GHz frequency USB2 lines on a 2 layer board. – user1850479 Aug 12 '21 at 14:53
  • My comment is you should make your traces much thicker. Not because of excess current or resistance - It's because very thin traces are much more fragile and harder to etch (i.e. more likelyhood of an open trace on a new PCB). We use thin traces when we have to - you clearly don't - you have LOTS of empty board area. – Kyle B Aug 12 '21 at 17:01

2 Answers2

2

Do I really need to switch to four layers?

I don't see why you would have to. You don't seem to have a reason, either. So the answer is no.

The one thing I'd recommend is not making half the USB trace switch planes, but always keep the pair on the same layer.

Marcus Müller
  • 88,280
  • 5
  • 131
  • 237
2

Generally you switch to 4 layers or more for EMC reasons. Most importantly when you want a big ground plane rather than individual traces, which is almost always the case when it comes to non-trivial PCBs.

Some of the more layout-sensitive circuits like switch regulators might also require several layers in order to keep traces short etc.

Another reason is when cadding fine pitch components with lots of connections and you simply can't route all traces in a sensible manner. In your case you've got a QFP44, but don't use all pins. In case you do, you might find it needlessly complicated to draw all 44 traces with just 2 layers available.

Regarding stack-up, it's a bit subjective. See this: The best stack-up possible with a four-layer PCB?

Lundin
  • 17,577
  • 1
  • 24
  • 67