Skip to the content
2 layers76.2 × 76.2 mmFourbyfour, the printed circuit board in 3D

Fourbyfour

nezumee/4x421

The 4x4 keyboard is a modular keyboard with per-key RGB lighting intended to be used as a base for prototyping MIDI controller with QMK firmware.

Size
76.2 × 76.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
64
Nets
55
Pads
456
Tracks, vias
1,501, 99
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
13 Nov 2022
Updated
13 Nov 2022

Overview

Fourbyfour is an open-source printed circuit board by nezumee, from the nezumee/4x4 repository on GitHub, published under the MIT licence. It is a 2-layer board of 76.2 × 76.2 mm with 64 parts on 55 nets, routed with 1,501 tracks and 99 vias.

Its parts include 32 diodes and 16 switches.

README

README.md

4x4 keyboard

The 4x4 keyboard is a modular keyboard with per-key RGB lighting intended to be used as a base for prototyping MIDI controller with QMK firmware.

4x4 variants

It consists of the following parts:

  • Head PCB with MCU and other connectors
  • 1 to 4 key PCB, each having 16 hotswap Cherry MX switches in 4x4 layout

PCB parts

These parts can be soldered together in different configurations, resulting in different layouts, such as 4x12 Planck layout or 8x8 layout similar to MIDI drumpads controllers.

The modular design allows to iterate on parts of it without remaking a large PCB. It also makes it cost-effective to order from PCB prototyping service - ordering the typical minimum of 3 to 5 pieces of key PCB makes a single full-sized keyboard with no excessive number of spares.

PCB pieces use castellated pads to route all the signals. These pads are soldered together placing the PCBs side by side, connecting them electrically and also holding them together physically.

Switch matrix

To allow for modularity and avoid using lots of wires to connect parts together, electrical layout of the key PCBs doesn't match their physical layout. Even though physically they are 4x4, electrically switches are laid out in 2 columns and 8 rows: physical vs electrical layout Each key module uses the same row wires but separate columns so the full electrical layout is 8x8 if there are 4 key modules.

The column lines are routed through the key PCBs such that columns are shifted in the next connected module: if a key module is directly connected to the head, it will connect to columns 1 and 2. Module attached to the right of it will use columns 3 and 4, and so on. Attaching a module to the bottom of another shifts columns by 4 instead. The end result is that in all supported configurations, simply soldering the key modules together in the desired layout gives each of them a unique pair of column wires connected to the MCU.

Row lines are not shifted, they are passed through across the key modules as is and connect to the same MCU pin in every module.

LED connections

WS6812 mini-e LEDs are used to provide per-key RGB. These LEDs require that they are connected in a chain to let the signal propagate from one LED to another. Within each key module, they are connected like this: LED order inside block

To connect them across key modules, jumpers need to be soldered on each module to specify the side that takes LED input from previous module in the chain, and the side connecting to the next module:

  • JP(L/R/T/B)I jumpers specify the left/right/top/bottom side as input
  • JP(L/R/T/B)O jumpers specify the output side

This builds a chain of key modules, connecting the last LED in the preceding module to the first LED in the next:

  • Input jumpers: input jumpers
  • Output jumpers: input jumpers

Bill of material

ItemQuantityCommentSource
Head PCB1KiCad sourcegerber
Key PCBs1-4KiCad sourcegerber
ProMicro MCU1
MCU socket12 strips of 12 pins eachhttps://www.digikey.com/en/products/detail/mill-max-manufacturing-corp/310-43-112-41-001000/1212186
Reset tactile button1
TRRS jack1To support split keyboard, optionalhttps://boardsource.xyz/store/5eca3b7d64caf04f83aa6488
Kailh MX hotswap sockets16-64https://boardsource.xyz/store/5eca066464caf04f83aa647f
N4148 SOD-123 diodes16-64https://www.digikey.com/en/products/detail/panjit-international-inc/1N4148W-R1-00001/14660400
SK6812 mini-e RGB LEDs16-64Optionalhttps://boardsource.xyz/store/5f6316e0a2c1b43e37ca04c3
Cherry MX compatible switches, keycaps16-64
Switch plate, caseOptionalSee some example designs here
M2 bolts and standoffs8-20

parts before build

Build

  1. Decide on the layout

    • Options: horizontal strip of 1-4, vertical strip of 2, 2x2 square
    • Head position: any side of the key block, facing up or left
  2. Prep the PCBs

    1. Clean up the castellated edges if needed. Make sure key PCBs sit flush to each other
    2. Make sure LEDs fit in the holes, file to enlarge them if necessary
  3. Solder together the PCBs pieces

    1. Use something to help hold PCBs together, like the 3d printed holder
      • Make sure both PCBs face the same way before soldering
      • Make sure PCBs sit flat and even as you solder, using a ruler to check they don't bend at the seam once every few soldered pads: are PCBs flat?
      • Tip: if using a 3D printed frame to hold PCBs, add washers before screwing the PCBs to it so plastic doesn't touch the hot contacts as you solder them holder with washers
    2. Turn over and clean up on the other side all soldered together
  4. Solder the jumpers for LED signal chaining

  5. Solder the MCU socket so that you can test the rest as you go

  6. Solder the per-key elements

    1. LEDs
    2. Diodes
    3. Switch hotswap sockets
  7. Solder the remaining head elements

    1. TRRS jack
    2. Reset tactile button

End result:

  • Top top
  • Bottom bottom

Firmware

This keyboard is using QMK. Example layout making the keyboard work as a combination of planck keyboard and a MIDI controller is available here. Note that you need the MIDI input fix for the MIDI feedback to work.

Using 4x4 as a MIDI controller

QMK has MIDI support that allows using the keyboard as a MIDI controller. Per-key RGB also makes it possible to have MIDI feedback, such that each key lights up depending on the status in the DAW. For example, you can set it up that keyboard keys trigger clips or scenes, and have those keys light up in the right color when there's an active clip or when a track is armed for recording.

planck layout with MIDI clips

This support requires some integration in the DAW. Remote MIDI script for Ableton Live working with the Planck-like layout is here.

Known problems

  • Head v1
    • There are OLED and encoder footprints, but they cannot be used since the same pins are reused for switch rows
  • Brightness must be restricted when using many LEDs (48+), voltage regulator in ProMicro cannot handle them otherwise
  • Split keyboard is not tested, is challenging due to LED power consumption

License

This project is using the MIT license.

Parts

64
QtyValueFootprintReferences
16Dkbd:D3_SMD_v2D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16
16SW_PUSHfourbyfour:CherryMX_HotswapSW1, SW2, SW3, SW4, SW5, SW6, SW7, SW8, SW9, SW10, SW11, SW12, SW13, SW14, SW15, SW16
16YS-SK6812MINI-Efourbyfour:YS-SK6812MINI-ELED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8, LED9, LED10, LED11, LED12, LED13, LED14, LED15, LED16
8SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mmJPBI1, JPBO1, JPLI1, JPLO1, JPRI1, JPRO1, JPTI1, JPTO1
2Conn_01x19fourbyfour:PinHeader_1x19_P2.54mm_CastellatedRJB1, JL1
2Conn_01x19fourbyfour:PinHeader_1x19_P2.54mm_CastellatedLJR1, JT1

The 60 most common of 64 parts.

More from nezumee/4x4

1
  • 2 layers30.5 × 76.2 mmHeadfour, the printed circuit board in 3D

    Headfour

    nezumee/4x4

    The 4x4 keyboard is a modular keyboard with per-key RGB lighting intended to be used as a base for prototyping MIDI controller with QMK firmware.

    15 parts21MIT

Similar boards

  • 2 layers76.5 × 120 mmNumpad project, the printed circuit board in 3D

    Numpad project

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    64 parts915
  • 2 layers160 × 99.1 mmFlat hierarchy, the printed circuit board in 3D

    Flat hierarchy

    drandyhaas/KiCadRoutingTools

    A set of Python/Rust tools to aid routing in KiCad

    64 parts744MIT
  • 2 layers49 × 53.2 mmDB25 External, the printed circuit board in 3D

    DB25 External

    BlueSCSI/BlueSCSI-v2

    BlueSCSI v2/Ultra - an open source, open hardware, SCSI emulator using the Pi Pico PR2040 and Pico 2 RP2350

    64 parts459GPL-3.0
  • 2 layers90 × 71 mmTd hv, the printed circuit board in 3D

    Td hv

    tdaede/td-crt

    tubes

    64 parts373
  • 2 layers28 × 30 mmOtterIron Devkit, the printed circuit board in 3D

    OtterIron Devkit

    Jana-Marie/Otter-Iron-PRO

    USB-PD soldering station for JBC C245 handles.

    64 parts321
  • 2 layers192.9 × 59.5 mmAlpha pro micro, the printed circuit board in 3D

    Alpha pro micro

    PyrooL/Alpha

    A 28-key semi-ortholinear mechanical keyboard designed by PyroL

    64 parts298MIT
  • 2 layers128 × 88 mmFireball revD, the printed circuit board in 3D

    Fireball revD

    ugcs/ddc

    Drone Show Software is software designed for drone shows, allowing flight path planning as well as control of dozens of drones simultaneously in a synchronized manner.

    64 parts223
  • 2 layers78 × 81 mmEncoder, the printed circuit board in 3D

    Encoder

    eddyem/stm32samples

    Code samples and ready projects based on bare-metal STM32

    64 parts208

Questions

How big is the Fourbyfour PCB?

It measures 76.2 × 76.2 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Fourbyfour use?

64 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Fourbyfour KiCad files?

From the nezumee/4x4 repository on GitHub, at the commit this page was made from: the board is pcb/fourbyfour/fourbyfour.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Fourbyfour design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).