Skip to the content
PCBKitNew board
2 layers55 × 55 mmUsb button interface, the printed circuit board in 3D

Interface module that maps 6 button inputs to keyboard keys

Size
55 × 55 mm
Copper layers
2
Thickness
1.6 mm
Parts
73
Nets
40
Pads
212
Tracks, vias
357, 22
Pours
5
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
9 Jul 2026
Updated
23 Aug 2026

Overview

Usb button interface is an open-source printed circuit board by SteveLRojas, from the SteveLRojas/usb_button_interface repository on GitHub, published under the CERN-OHL-P-2.0 licence. It is a 2-layer board of 55 × 55 mm with 73 parts on 40 nets, routed with 357 tracks and 22 vias.

It is built around the CH552G, 74LVC1G17Z and MT9700. Its parts include 30 resistors, 20 capacitors, 10 ICs, 6 connectors and 1 diode. It belongs with the interfaces and adapters boards and the 8051 (CH55x, STC, AT89) boards of this library.

Main components

3

README

README.md

usb_button_interface

Interface module that maps 6 button inputs to keyboard keys.

What is in this repo?

Here you will find the design files for a small custom PCB that lets you connect buttons or switches to a PC via USB and map them to keyboard buttons.
The hardware is designed in KiCad, the design files are in the HW folder.
The firmware is written in C and meant to be compiled with Keil uVison C51 and linked with LX51. The project makes extensive use of pointers and requires a linker script for correct memory overlay.
The entire uVision project is in the FW folder.
The SW folder contains test scripts as well as a command line tool (ubi_programmer.py) used to set the key mapping. To set the key mapping you need ubi_programmer.py, ubi_platform.py, and ubi_regs.py. The other files are test scripts.

How do I use this thing?

First you will need the hardware, boards can be ordered from JLCPCB and all the components are available from LCSC.
Once you have working hardware close the jumper J6 to put it in programming mode, compile the firmware, and use WCHISP or a similar program to upload the firmware.
After the firmware is uploaded remove jumper J6 to put the device in functional mode. Now when it is plugged into USB the LED will blink and then stay on, this means the device is in functional mode.
Touching the capacitive touch button will make the LED turn off, this means the device is in configuration mode. Touching the button again will put the device back into functional mode.
Note that the capacitive button is automatically calibrated each time the device is powered on, so while powering on the device make sure it is placed in its normal operating position and don't touch the capacitive button.
When the device is in functional mode it should appear to the PC as a completely satandard USB keyboard, when it is in configuration mode it will appear as a CDC ACM device.
There is no need to specify a serial port when running the configuration script, as it can scan the serial ports and automatically find the device.

How do I set the key mapping?

Use the provided python script (ubi_programmer.py). Run it with -h to see what arguments it supports.
Example usage: python ubi_programmer.py --eeprom --sw0 0x1A --sw1 0x29
The above example maps sw0 to the 'W' key, and sw1 to the escape key. The hexadecimal numbers representing each keyboard key can be found in the document "HID Usage Tables for Universal Serial Bus (USB)".
The first time you configure the device you should specify all the switches (even if you don't intend to use them) to make sure nothing is mapped to an invalid key.

Parts

73
QtyValueFootprintReferences
110.1uCapacitor_SMD:C_0805_2012MetricC1, C2, C3, C7, C8, C9, C11, C13, C15, C17, C18
1010kResistor_SMD:R_0805_2012MetricR1, R6, R11, R12, R13, R14, R23, R24, R25, R26
91kResistor_SMD:R_0805_2012MetricR5, R7, R8, R9, R10, R19, R20, R21, R22
80Resistor_SMD:R_0805_2012MetricR15, R16, R17, R18, R27, R28, R29, R30
80.01uCapacitor_SMD:C_0805_2012MetricC10, C12, C14, C16, C19, C20, C21, C22
874LVC1G17Package_TO_SOT_SMD:SOT-353_SC-70-5U3, U4, U5, U6, U7, U8, U9, U10
4Conn_01x04Connector_Phoenix_MC:PhoenixContact_MC_1,5_4-G-3.81_1x04_P3.81mm_HorizontalJ2, J3, J4, J5
4MountingHole_PadMountingHole:MountingHole_3.2mm_M3_PadH1, H2, H3, H4
25K1Resistor_SMD:R_0805_2012MetricR2, R3
11uCapacitor_SMD:C_0805_2012MetricC6
14.7kResistor_SMD:R_0805_2012MetricR4
1CH552GPackage_SO:SO-16_3.9x9.9mm_P1.27mmU1
1Conn_01x02Connector_PinHeader_1.27mm:PinHeader_1x02_P1.27mm_VerticalJ6
1MT9700Package_TO_SOT_SMD:SOT-23-5U2
1ORANGELED_SMD:LED_0805_2012MetricD1
1SW_PushButton_Switch_SMD:SW_SPST_PTS810SW1
1TestPoint_FlagSignetics:CapTouch_10mmTP1
1USB_C_Receptacle_USB2.0Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J1

Questions

How big is the Usb button interface PCB?

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

What parts does the Usb button interface use?

73 parts, built around the CH552G, 74LVC1G17Z and MT9700. 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 Usb button interface KiCad files?

From the SteveLRojas/usb_button_interface repository on GitHub, at the commit this page was made from: the board is HW/V1.0/usb_button_interface.kicad_pcb and its schematic HW/V1.0/switch_debounce.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Usb button interface design in my own project?

Its repository publishes it under the CERN-OHL-P-2.0 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 layers47.2 × 69.1 mmBasys3 to lb, the printed circuit board in 3D

    Basys3 to lb

    SteveLRojas/pmod_modules

    Place to keep all my PMOD modules

    35 partsCERN-OHL-P-2.0
  • 2 layers49.8 × 18 mmPS2 to USB Converter, the printed circuit board in 3D

    PS2 to USB Converter

    SteveLRojas/PS2_to_USB_Converter

    A converter for connecting a PS/2 keyboard to a USB host

    29 partsCERN-OHL-P-2.0
  • 4 layers83.1 × 92.5 mmTildagon base, the printed circuit board in 3D

    Tildagon base

    emfcamp/badge-2024-hardware

    183 parts40
  • 6 layers83.5 × 56 mmEspiff v3 1, the printed circuit board in 3D

    Espiff v3 1

    MDCservice/EsPiFF

    An ESP32 in the Raspberry Pi form factor

    172 parts223GPL-3.0
  • 6 layers56 × 65 mmMainboard gen2, the printed circuit board in 3D

    Mainboard gen2

    zephray/NekoInk

    Next gen. of NekoCal: An open-source hackable and programmable e-paper display

    245 parts108
  • 2 layers103.2 × 74.1 mmUno, the printed circuit board in 3D

    Uno

    lukasloetkolben/OpenpilotHardware

    Welcome to the Openpilot Hardware Collection!

    131 parts95MIT
  • 4 layers80 × 100 mmBaseboard, the printed circuit board in 3D

    Baseboard

    NVIDIA-AI-IOT/my-jetson-nano-baseboard

    An open source Jetson Nano baseboard and tools to design your own.

    240 parts91
  • 4 layers110 × 110 mmSmoothiev2-prime, the printed circuit board in 3D

    Smoothiev2-prime

    Smoothieware/Smoothieboard2

    Hardware files for the Smoothieboard v2, and extension boards

    453 parts71