-
-
Notifications
You must be signed in to change notification settings - Fork 0
2. Basic Knowledge
Disclaimer, this will likely be a poor/entry-level explanation of aspects of EE (Electrical Engineering) and other information relevant to keyboard PCB design. I recommend using other sources (e.g. Googling/YouTube) if you want proper, comprehensive explanations.
However, many of the terms used throughout this guide will be explained in this section so I recommend you go over this section to get familiar with them (or check that you are). Feel free to come back to this section if there’s some sort of term or concept you don’t understand in the middle of the guide. I may also miss a few things, so this section is subject to change in the future.
(just google/watch a video)
(link a video/resource)
Better resource: What is a Diode? | Fluke Diodes basically allow current to only flow in one direction. As explained in hadi’s keyboard PCB design video (part 3), they’re essential to the functionality of switch matrices.
Better resource: Capacitors Explained - The basics how capacitors work working principle Capacitors (or ‘caps’ for short) are mainly used in keyboard PCBs to reduce noise (unwanted change of a signal/current due to electromagnetic interference, or EMI) in a circuit.
Capacitance is measured in Farads (F). More commonly in low voltage circuits however, you will see uF (microfarad), nF (nanofarad), and pF (picofarad). If you know basic things about the metric system, those smaller units should make sense to you. Just to make clear, 1,000,000 uF is equivalent to 1 F. Then, 1uF = 1,000 nF and 1nF = 1,000 pF.
Decoupling capacitors are used to help provide controllers (in this case the MCU) with a steady supply of power. Controllers generally need to be applied with a steady voltage to protect the sensitive circuitry inside of them, and noise from EMI throughout the PCB/circuit can cause noise and lead to an unsteady voltage. By placing decoupling capacitors close to the controller, they can effectively cancel out noise by supplying supplementary power when the voltage drops too low and absorbing power when voltage is too high. Note: “decoupling capacitor” is just a name given to certain capacitors with that specific role, they aren’t a special type of capacitor.
Placement and tracing of decoupling capacitors is important as to not make them redundant. There is a chance that a controller may just not function if it is done wrong (though admittedly the chances are low). There are many resources online regarding decoupling capacitor placement, but I’ll be going over how you should layout them (for the controller we will be using) in this guide later on.
If you’re living in the 21st century, you probably know what Light Emitting Diodes (LEDs) are. They take a voltage, and emit light. They can be pretty bright for how small they are, but can also be power hungry at full brightness if used in large quantities/arrays.
RGB (red, green, blue) LEDs will consume more power due to the fact that they (e.g. WS2812(b) LEDs) have 3 LEDs for red, green and blue, as well as a controller on board that requires power to interpret a data signal.
I won’t be covering how to add a per-key RGB LED switch matrix as it is out of the scope of this guide, but I may make a follow up tutorial in the future. Other resources exist online already if you want to learn how (or you can just ask people), but I wouldn’t recommend attempting it for a first PCB.
Watch these videos before I botch my explanation of PCBs (second video is pretty informative): How Do PCBs Work? What is a PCB?
Essentially, PCBs are made of core fiberglass material (most commonly FR4) with various layers of copper in which traces connect various components together. Vias act as pathways between layers, connecting traces and allowing them to hop from layer to layer. Complex PCBs such as PC motherboards can have upwards of 14 layers, however PCBs can get as simple as just 1 layer. For keyboards, 2 layers are generally used.
SMT/D and THT Component “form factors” Symbols Footprints
This is an optional (but interesting and informative) video on USB and how it applies to keyboards: How does a USB keyboard work?.
Modern keyboards generally operate at USB 2.0 speeds. USB (2.0) connections consist of the following four: power (+/5V/VCC), ground (-/GND) and a pair of data lines/pins. INCLUDE IMAGE. Micro USB connectors used to be common a few years back, but many keyboards nowadays opt to use a USB Type-C connector. Type-C connectors have quite a few extra pins, required for hitting USB 3+ speeds, that aren’t important for USB 2.0 connection. These are the only pins on a standard Type-C connector required for a USB 2.0 keyboard: INCLUDE IMAGE. [Pulldown 5.1k resistors.]
A side note: mid-mount type C connectors do exist, e.g.
TYPE-C-31-M-14.
MCUs Common types/options (will expand later) AVR vs ARM Crystal oscillators Decoupling capacitors Bootloader/DFU Flashing headers (e.g. ISP) Reset circuit Eeprom/Flash storage EMI reduction Data traces ESD (Poly)Fuse Ground fills (will be expanded upon later)
Design Considerations ->