Skip to the content
PCBKitNew board
2 layers77.6 × 44.2 mmMxlock, the printed circuit board in 3D

Replace locking key switches with momentary switches

Size
77.6 × 44.2 mm
Copper layers
2
Thickness
1.6 mm
Parts
26
Nets
34
Pads
99
Tracks, vias
361, 23
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
20 Nov 2023
Updated
16 Jul 2026

Overview

Mxlock is an open-source printed circuit board by mnaberez, from the mnaberez/mxlock repository on GitHub, published under the BSD-3-Clause licence. It is a 2-layer board of 77.6 × 44.2 mm with 26 parts on 34 nets, routed with 361 tracks and 23 vias.

It is built around the CD4066BM. Its parts include 6 resistors, 6 connectors, 4 diodes, 4 switches and 3 capacitors. It belongs with the keyboards and input boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

MXLock

Photo

MXLock is a two-chip circuit that allows up to four mechanically locking keys (push-on, push-off) to be simulated using regular momentary key switches.

Many older computer keyboards have mechanically locking keys. For example, the Commodore 128 has three locking keys: SHIFT LOCK, CAPS LOCK, and 40/80. The MXLock circuit can be included on the PCB of replacement keyboard projects, such as those using Cherry MX keys, so that the entire keyboard can be made from momentary key switches.

Features:

  • Simulates up to 4 locking keys using an ATtiny214/414/814 and a 4066
  • Shows the on/off state of each key with LEDs
  • Remembers the lock states between power cycles (useful for mode keys like 40/80)
  • Resets the computer by pulling /RESET low if the LOCK0 key is held down
  • Puts the ATtiny to sleep between keypresses to save power

Hardware

The hardware/ directory in this repository contains the schematic and a PCB layout for the demonstration board pictured above. It can be used to test the MXLock circuit.

The circuit is intended to be integrated directly onto the PCB of a keyboard. Steve Gray's C128SX keyboard is an example of a keyboard using the circuit.

Firmware

The firmware is written in AVR assembly language. It can be assembled and flashed using open source software and inexpensive hardware. See firmware/ for the source code and instructions.

Author

Mike Naberezny

Parts

26
QtyValueFootprintReferences
4330Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R2, R3, R4
4Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1, J2, J3, J4
4LEDLED_THT:LED_D5.0mmD1, D2, D3, D4
4SW_MXButton_Switch_Keyboard:SW_Cherry_MX_1.00u_PCBSW1, SW2, SW3, SW4
20.1uFCapacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mmC1, C2
21KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR5, R6
110uFCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC3
12N3904Package_TO_SOT_THT:TO-92_HandSolderQ1
1ATMEL-ICE-10mxlock:PinHeader_2x05_P1.27mm_Shrouded_Vertical_SMD_HandsolderJ6
1ATtiny214/414/814Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU1
1CD4066BMPackage_SO:SO-14_3.9x8.65mm_P1.27mmU2
1Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ5

Questions

How big is the Mxlock PCB?

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

What parts does the Mxlock use?

26 parts, built around the CD4066BM. 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 Mxlock KiCad files?

From the mnaberez/mxlock repository on GitHub, at the commit this page was made from: the board is hardware/kicad/mxlock/mxlock.kicad_pcb and its schematic hardware/kicad/mxlock/mxlock.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Mxlock design in my own project?

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

Similar boards

  • 2 layers404.4 × 137.6 mmC128SX mx, the printed circuit board in 3D

    C128SX mx

    sjgray/CBM-MX-Keyboards

    Replacement and enhanced keyboards for Commodore machines

    137 parts27
  • 4 layers236.8 × 240.9 mmDIY Video, the printed circuit board in 3D

    DIY Video

    jimbro1000/DIY-Video

    General purpose video system for 8-bit computers using 74LS logic

    315 parts1
  • 2 layers99.7 × 99.7 mmPikvm atxboard switch, the printed circuit board in 3D

    Pikvm atxboard switch

    L0czek/pikvm-atxboard-switch

    The need for this hardware arose when I bought a PIKVM v4 mini and wanted to control 2 PCs. I really wanted to be able to forward the POWER, RESET buttons and LEDs to the chosen computer for easy control of the target.

    66 parts
  • 2 layers322.5 × 148.8 mmMXKeys, the printed circuit board in 3D

    MXKeys

    velvia-fifty/AudioThings

    DIY audio-related projects of questionable quality and dubious utility; delivered in 30 minutes or less or the next one is free

    179 parts1
  • 2 layers52.8 × 69 mmMuntsorteerderESP, the printed circuit board in 3D

    MuntsorteerderESP

    TiebeDeclercq/Munt-sorteer--en-opslagsysteem

    A coin-counting, storing, and dispensing system. View the blog »

    53 parts
  • 2 layers57.3 × 19 mm11ua, the printed circuit board in 3D

    11ua

    rene-dev/stmbl

    AC Servo Driver for STM32F4

    26 parts990GPL-3.0
  • 2 layers98 × 59.5 mmMCP23017 PCB, the printed circuit board in 3D

    MCP23017 PCB

    hackclub/OnBoard

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

    26 parts915
  • 2 layers142.9 × 98.5 mmCantor MX, the printed circuit board in 3D

    Cantor MX

    diepala/cantor

    Cantor keyboard, a 42 key diodeless split keyboard.

    26 parts756GPL-3.0