First PCB draft

So, I finally have a first draft of the PCB for the keyboard I want to make. I’ve put it on GitHub: GitHub - joelproko/keyboard_layout_jopr

A few questions:

  • I’ve never done this before, so I expect there to be mistakes, but don’t hesitate to point them out. Like maybe it’s a bad idea to have the USB data lines so close to the edge?
  • The USB Multex has connections labeled 2 and 6, which aren’t connected. 2 because it was like that in the guide, 6 because it didn’t exist in the version of the footprint the guide maker used. What are they for and what do I do with them?
  • When I run Kicad’s design rules check, it complains something about an incorrect courtyard for the USB Multex, and about holes drilled too close to eachother for every single key footprint. Can I ignore these warnings? If not, how do I fix it?
  • There’s no pins left for the lock status LEDs (there’s one left, but it’s labeled AREF in the schematic, so I guess it’s special). Which controller would you recommend instead?
  • The data lines are not even that close to the edges, I you shouldn’t have problems here.
  • Pin 2 is the ID pin, used only in USB Host devices. Keyboards are not one of them, so the pin must be unconnected. The pins marked as 6 are for added mechanical stability of the connector, and they should be grounded.
  • Your design rules may be too strict, that’s why it gives you a lot of warnings. Double check each one of them and see if it is a reasonable warning or just a paranoid android strict rules that may be ignored.
  • You can rearrange your switch matrix to something more square-like. That’s because the closer to a square the matrix is, more switches the matrix can handle. This will make programming a little bit trickier, but should release more microcontroller’s pins for the LEDs.

As a final note, I recommend making a ground pour plane on your entire board, that will make your life easier.

I don’t see any ESD protection, that’s definitely something you want on a USB connector.

Also a schematic PDF to go with the gerbers makes it easier for folks who don’t use kicad (I’m assuming that’s in the kicad files somewhere), although if you don’t want to share it that’s fine too.

Thanks.

I’ve replaced the footprints from MX_Hybrid ones to MX_Only ones (same footprint library), since I’m going to just use Cherry MX switches anyway. That got rid of the drill holes warning. Now only the open court warning for the USB remains.

@VinnyCordeiro
Hm, I was hoping I could avoid f*cking with the matrix more than I have, as I might want to add wireless capability down the line and probably again wouldn’t have enough pins left, requiring me to switch microcontrollers anyway; making the matrix as square-like as possible would yield just 4 free pins, 3 of which would be taken by the LEDs…

Doesn’t a larger ground plane mean more pain in the butt when soldering?

@dwarflemur
Hm, I don’t see anything I left out from the guide; what could be done for ESD protection there?

I’ve “printed” the schematic and the PCB into PDFs, as requested.

Okay, I’ve read up a bit on ESD protection. Does it go before, after, or instead of the polyfuse?

There are some tricks that you can use with logical gates ICs that could make you save a lot of pins, but I don’t know if you are willing to add more 2 or 3 ICs in order to save your money when buying a bigger microcontroller. Let me know if you are interested, I can describe the technique.

Anyway, if you really want a beefier mcu in place of the ATmega32U4, the AT90USB1286 is the one to go, as it is code-compatible with the 32U4 and has much more I/Os than you will ever need.

Ground planes can be a pain when desoldering, yes, but that’s why you use thermals on ground pads to avoid that.

ESD would go as close to the usb connector as possible, before anything else. This app note looks like it gives some overview of what you want. Something like PUSB2X4YH from Nexperia would probably work well.

Do you happen to have the relevant Kicab files (library and footprint) or know where/how to get them?

Edit: Found a footprint in the datasheet for the PUSB2X4YH, though I’d still have to recreate it in Kicad. Still looking for a suitable library entry; the PUSB2X4YH seems to have 4 non-GND pins, and the library entries for USB 2.0 I found all have only 3 pins, including the GND pin.

I don’t personally use kicad, so I’m not sure on that. I’ve used snapeda to find parts in the past.

Looking at the datasheet it looks like it has a ground pin, a no connect pin, and 4 protection pins. You would only need to use 3 of these for usb and could leave the last one unconnected.

Ok, I thought the ESD would have both an in and an out pin for each line. Thanks for the clarification.

Ah, no. They’re diodes that will essentially conduct when the voltage is too high. The important thing is that on the board it’s the first thing lines go to from the usb connector before anything else.

Updated accordingly. Anything else I should fix?

Matrix squared, rotated crystal and moved it a bit further from the neighboring traces, extended GND zone to the entire PCB.

What can/should I do about this?:

I don’t use KiCad, can’t help you here. Sorry.

Do you see anything else I should fix?
Should I extend the PCB downwards a bit so the drill holes for the space bar aren’t as close to the edge?

That depends on the case you are going to use. If you are going to make your own case, it’s probably a good idea.

If not, there’s a trick used on almost all 60% PCBs meant to be fitted on a Poker-style case that you can use: rotate the space bar stabilizer by 180°, that’s enough to separate the holes from the PCB’s edge.