Skip to the content
2 layers73 × 41 mmCyberbrick breakout, the printed circuit board in 3D

Cyberbrick breakout

mybesttools/esp32-c3-arcade

This project targets ESP32-C3 BLE gamepad mode by default.

Size
73 × 41 mm
Copper layers
2
Thickness
1.6 mm
Parts
34
Nets
24
Pads
128
Tracks, vias
0, 0
Pours
1
Routed
Not yet
KiCad
KiCad 9.0 (file 20241229)
Created
15 Apr 2026
Updated
6 May 2026

Overview

Cyberbrick breakout is an open-source printed circuit board by mybesttools, from the mybesttools/esp32-c3-arcade repository on GitHub. It is a 2-layer board of 73 × 41 mm with 34 parts on 24 nets.

Its parts include 22 connectors, 5 capacitors and 2 ICs. It belongs with the interfaces and adapters boards and the ESP32 and RISC-V boards of this library.

README

README.md

ESP32-C3 Controller Firmware

This project targets ESP32-C3 BLE gamepad mode by default.

The board advertises as ESP32-C3 Arcade and pairs directly with RetroPie over Bluetooth.

It also includes an optional tiny OLED status display (SSD1306 I2C) showing:

  • boot status
  • advertising / connected state
  • live axis and button activity

BLE and USB support

Yes, both are supported from the same codebase:

  • BLE gamepad mode on ESP32-C3 (esp32c3_esp32c3_ble)
  • USB serial bridge mode on ESP32-C3 (esp32c3_esp32c3_usbserial)

Note: ESP32-C3 does not expose native USB HID gamepad device mode in this project. USB mode here is CDC serial output for a Pi-side bridge.

Project layout

  • src/main.cpp: controller firmware (BLE + USB HID + serial bridge modes)
  • include/pinmap.h: joystick/button mapping and calibration
  • platformio.ini: PlatformIO build config
  • tools/flash_our_firmware.sh: upload helper for default ESP32-C3 BLE env

Pinouts

Config B — single joystick, direct GPIO buttons (default)

Environments: esp32c3_esp32c3_ble, esp32c3_esp32c3_usbserial

Joystick (analog, connect to 3.3 V, GND, and wiper):

SignalGPIOArduino pin
JOY XGPIO0A0
JOY YGPIO1A1

Buttons (active LOW — wire between GPIO pin and GND, internal pull-up enabled):

ButtonGPIO
A2
B3
X4
Y5
L6
R7
START9
SELECT10
HOTKEY20
COIN21

OLED status display (I2C, shared with Config A):

SignalGPIO
SDA5
SCL6

Note: GPIO5/6 are shared between the OLED and button Y/L in Config B. If the display is connected, remove buttons Y and L from the BUTTON_PINS[] array in include/pinmap.h, or remap them to unused GPIOs.


Config A — dual joystick, MCP23017 expander board

Environments: esp32c3_ble_mcp

All buttons are wired to the MCP23017 I/O expander (no direct GPIO buttons). The MCP23017 connects over I2C with A0/A1/A2 address pins all tied to GND (address 0x20).

Joysticks (analog, connect to 3.3 V, GND, and wiper):

SignalGPIOArduino pinRole
Left JOY XGPIO0A0Hat switch
Left JOY YGPIO1A1Hat switch
Right JOY XGPIO2A2BLE Rx axis
Right JOY YGPIO3A3BLE Ry axis

I2C bus (MCP23017 + OLED share the same bus):

SignalGPIOConnected to
SDA5MCP23017 SDA, OLED SDA
SCL6MCP23017 SCL, OLED SCL

MCP23017 button mapping (active LOW — wire each button between the MCP pin and GND; internal pull-ups are enabled by firmware):

MCP pinBoard labelButtonNotes
GPA0A0D-pad Up✓ wired
GPA1A1D-pad Left✓ wired
GPA2A2D-pad Right✓ wired
GPA3A3D-pad Down✓ wired
GPA4A4L shoulderwire here
GPA5A5R shoulderwire here
GPA6A6Startwire here
GPA7A7Selectwire here
GPB0B0Hotkeywire here
GPB1B1Coinwire here
GPB2B2R3 (right joystick click)✓ wired
GPB3B3L3 (left joystick click)✓ wired
GPB4B4A / Cross ✕ (Down)✓ wired
GPB5B5Y / Triangle △ (Up)✓ wired
GPB6B6B / Circle ○ (Right)✓ wired
GPB7B7X / Square □ (Left)✓ wired

Optional tiny OLED display

The BLE environment enables status output (ESP32C3_STATUS_OLED).

For ABrobot ESP32-C3 OLED boards, the onboard 0.42" display is a 72x40 pixel OLED driven over I2C on GPIO5 (SDA) / GPIO6 (SCL).

Reference article: ESP32-C3 0.42" OLED — emalliab

Key findings from debugging:

  • Board I2C address may be 0x3C or 0x3D depending on variant — firmware probes both.
  • Display controller may be SSD1306 or SH1106 — both U8g2 drivers are included.
  • Wire.begin() with no arguments on ESP32-C3 defaults to GPIO8/GPIO9, which conflicts with the onboard LED on GPIO8. Always pass explicit SDA/SCL pins.
  • The article uses U8G2_SSD1306_72X40_ER_F_HW_I2C which works without offset. The U8G2_SSD1306_128X64_NONAME variant also works with offset (30, 12).

Default config is in include/pinmap.h:

  • STATUS_DISPLAY_ENABLED = false
  • STATUS_OLED_I2C_ADDR = 0x3C
  • STATUS_OLED_USE_SH1106_72X40 = true
  • STATUS_OLED_SDA_PIN = 5
  • STATUS_OLED_SCL_PIN = 6

Note: ABrobot SH1106 72x40 panels are not SSD1306-compatible and need SH1106 command mode.

If your display has different dimensions or address, change those constants.

Setup — step by step

1. Build and upload to ESP32-C3

bash
cd firmware/esp32c3-usb-gamepad
pio run -e esp32c3_esp32c3_ble
pio run -e esp32c3_esp32c3_ble -t upload

# USB serial bridge firmware
pio run -e esp32c3_esp32c3_usbserial
pio run -e esp32c3_esp32c3_usbserial -t upload

If needed, upload with explicit port:

bash
pio run -e esp32c3_esp32c3_ble -t upload --upload-port /dev/tty.usbmodemXXXX

Or use the helper script:

bash
./tools/flash_our_firmware.sh

2. Pair with RetroPie

In RetroPie Bluetooth settings:

  1. Register and connect new Bluetooth device
  2. Select ESP32-C3 Arcade

3. Configure in EmulationStation

In RetroPie/EmulationStation:

  1. Hold any button to start controller setup.
  2. Map joystick directions and action buttons.
  3. Map Start / Select / Hotkey.
  4. Skip unused controls by holding a button.

Verify on Pi (optional)

Install joystick tools to inspect Linux input events:

bash
sudo apt install joystick

Test:

bash
jstest /dev/input/js0

Raspberry Pi OS and RetroPie setup

Recommended OS: Raspberry Pi OS Lite (32-bit)

RetroPie runs its own EmulationStation frontend and does not need a desktop environment. Lite keeps the install lean and leaves more RAM and CPU for emulation.

1. Flash the SD card

Use Raspberry Pi Imager on your Mac:

  1. Choose Raspberry Pi OS (other) → Raspberry Pi OS Lite (32-bit)
  2. Open the settings panel (gear icon) and configure:
    • Hostname (e.g. retropie)
    • Username and password
    • Wi-Fi SSID and password
    • Enable SSH
  3. Flash to your SD card

SSH is disabled by default on Raspberry Pi OS. Enabling it in Imager before flashing means you can connect headlessly from the first boot.

2. Install RetroPie

SSH in, then run:

bash
sudo locale-gen en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git
git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
cd RetroPie-Setup
sudo ./retropie_setup.sh

Choose Basic Install from the menu. Takes 30–60 minutes on a Pi 3 or 4.


USB serial bridge — install and run from GitHub

On the Raspberry Pi, clone the repo, install the dependencies, and run the bridge script:

bash
git clone https://github.com/mybesttools/esp32-c3-arcade.git
cd esp32-c3-arcade
sudo apt-get update
sudo apt install -y python3-serial python3-evdev
sudo python3 firmware/esp32-c3-usb-gamepad/tools/pi_usb_serial_to_uinput.py --port auto

To target a specific port instead:

bash
sudo python3 firmware/esp32-c3-usb-gamepad/tools/pi_usb_serial_to_uinput.py --port /dev/ttyACM0

The script requires sudo to create a uinput virtual gamepad device.

Install as a systemd service

This runs the bridge automatically on boot. Assumes the repo was cloned to /home/admin/esp32-c3-arcade.

Create the service file:

bash
sudo tee /etc/systemd/system/esp32-gamepad-bridge.service > /dev/null << 'EOF'
[Unit]
Description=ESP32-C3 USB serial gamepad bridge
After=local-fs.target

[Service]
ExecStart=/usr/bin/python3 /home/admin/esp32-c3-arcade/firmware/esp32-c3-usb-gamepad/tools/pi_usb_serial_to_uinput.py --port auto
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

Enable and start it:

bash
sudo systemctl daemon-reload
sudo systemctl enable esp32-gamepad-bridge
sudo systemctl start esp32-gamepad-bridge

Check status:

bash
sudo systemctl status esp32-gamepad-bridge

If you cloned the repo to a different path, update ExecStart accordingly.

Tuning

Edit include/pinmap.h and adjust:

  • JOY_CENTER_X, JOY_CENTER_Y
  • JOY_DEADZONE
  • JOY_MIN, JOY_MAX
  • BUTTON_PINS[] order if you want a different button layout

Environments

EnvironmentConfigDescription
esp32c3_esp32c3_bleBBLE gamepad, single joystick, direct GPIO buttons (default)
esp32c3_ble_mcpABLE gamepad, dual joystick, MCP23017 expander buttons
esp32c3_esp32c3_usbserialBUSB CDC serial bridge for Pi-side uinput script, single joystick
esp32c3_rp2040_usbhid—Wired USB HID gamepad on Raspberry Pi Pico

Parts

34
QtyValueFootprintReferences
5100nFCapacitor_SMD:C_0402_1005MetricC1, C2, C3, C4, C5
4M3MountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
1COINConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ24
1DL_DWNConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ12
1DL_LFTConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ10
1DL_RGTConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ11
1DL_UPConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ9
1DR_DWNConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ16
1DR_LFTConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ14
1DR_RGTConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ15
1DR_UPConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ13
1ESP32-C3 botConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalU1B
1ESP32-C3 topConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalU1A
1HOTKEYConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ23
1I2CConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ7
1LXConnector_JST:JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_HorizontalJ1
1LYConnector_JST:JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_HorizontalJ2
1PWRConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ8
1RXConnector_JST:JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_HorizontalJ3
1RYConnector_JST:JST_SH_SM03B-SRSS-TB_1x03-1MP_P1.00mm_HorizontalJ4
1SELConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ22
1SHL1Connector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ17
1SHL2Connector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ18
1SHR1Connector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ19
1SHR2Connector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ20
1SOIC-28W_7.5x17.9mm_P1.27mmPackage_SO:SOIC-28W_7.5x17.9mm_P1.27mmMCP23017-E/SO
1STARTConnector_JST:JST_SH_SM02B-SRSS-TB_1x02-1MP_P1.00mm_HorizontalJ21

Similar boards

  • 2 layers26 × 30 mmMicrocontroller, the printed circuit board in 3D

    Microcontroller

    FrameworkComputer/ExpansionCards

    Reference designs and documentation to create Expansion Cards for the Framework Laptop

    34 parts1.1kCC-BY-4.0
  • 2 layers171.2 × 72.9 mmAmiga gfxcard old, the printed circuit board in 3D

    Amiga gfxcard old

    mntmn/amiga2000-gfxcard

    MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog

    34 parts1k
  • 2 layers53.5 × 62.5 mmLed matrix, the printed circuit board in 3D

    Led matrix

    hackclub/OnBoard

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

    34 parts915
  • 2 layers45 × 26 mmESP32-HELP Button, the printed circuit board in 3D

    ESP32-HELP Button

    pcbreflux/espressif

    all espressif stuff will committed here

    34 parts608GPL-3.0
  • 2 layers41.7 × 25.7 mmHeadphones flex pcb rigid, the printed circuit board in 3D

    Headphones flex pcb rigid

    strangeparts/niubi-headphones

    Flexible circuit board design for adding a headphone jack to an iPhone 7

    34 parts493MIT
  • 2 layers18.8 × 16.3 mmAmoeba, the printed circuit board in 3D

    Amoeba

    mtl/keyboard-pcbs

    Keyboard PCBs

    34 parts485
  • 2 layers127 × 69.9 mmEzcgi, the printed circuit board in 3D

    Ezcgi

    baldengineer/bit-preserve

    Project for capturing vintage, classic, aka old computer schematics in KiCad.

    34 parts446

Questions

How big is the Cyberbrick breakout PCB?

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

What parts does the Cyberbrick breakout use?

34 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 Cyberbrick breakout KiCad files?

From the mybesttools/esp32-c3-arcade repository on GitHub, at the commit this page was made from: the board is hardware/cyberbrick-breakout/kicad/cyberbrick-breakout.kicad_pcb and its schematic hardware/cyberbrick-breakout/kicad/cyberbrick-breakout.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Cyberbrick breakout design in my own project?

Its repository states no licence, so its author keeps all rights: ask mybesttools before reusing the design.