Skip to the content
2 layers110.5 × 75.5 mmGameboy, the printed circuit board in 3D

Designed a Handheld Game Console PCB in KiCad around an STM32F103.

Size
110.5 × 75.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
57
Nets
59
Pads
219
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 6 (file 20211014)
Created
15 Aug 2026
Updated
15 Aug 2026

Overview

Gameboy is an open-source printed circuit board by TalhaHossainKhan, from the TalhaHossainKhan/Handheld-Game-Console repository on GitHub. It is a 2-layer board of 110.5 × 75.5 mm with 57 parts on 59 nets.

It is built around the STM32F103C8T6, AMS1117-3.3 and 1N4148W, with the AO3401A and BC847 among its other parts. Its parts include 16 capacitors, 11 resistors, 8 switches, 5 connectors and 3 ICs. It belongs with the retro computing and games boards and the STM32 boards of this library.

Main components

5

README

README.md

Handheld Game Console — STM32F103

A battery-powered handheld game console built around an STM32F103C8T6. This repository holds the KiCad hardware design: a 2-layer board with an SPI TFT display, microSD storage, PWM buzzer audio, a six-button game pad, USB-C charging with automatic battery/USB power switching, and an SWD debug header.


Hardware at a glance

MCUSTM32F103C8T6, LQFP-48, 16 MHz HSE crystal
DisplaySPI1 TFT on an 8-pin header (CS / RES / DC / MOSI / SCK + backlight)
StoragemicroSD over SPI2 on a 4-pin header
AudioPWM buzzer on PB6 (TIM4_CH1) driven through a BC847 low-side switch
Controls6 tactile buttons (D-pad + A/B), boot-select and power slide switches
Power inUSB-C receptacle with 5.1 kΩ CC resistors
ChargingMCP73831 single-cell Li-Po charger, ~500 mA, status LED
Power pathSchottky (USB) + P-channel MOSFET (battery) auto-switchover
RegulationAMS1117-3.3 LDO → 3.3 V rail, ferrite-filtered VDDA
MonitoringBattery voltage divider into ADC channel PA6
Board110.5 × 75.5 mm, 2 layers, 1.6 mm FR4, 6 × M2 mounting holes
Debug4-pin SWD header (SWDIO / SWCLK / 3.3 V / GND)

Schematic

Schematic

The sheet is split into a power section (charging, power path, regulation and battery sensing) and a microcontroller section (clock, buttons, audio, display, microSD, USB-C and SWD).


Peripheral configuration

Peripherals and the clock tree are configured in STM32CubeIDE.

STM32CubeIDE pinout

SPI1 drives the display, SPI2 the microSD card, TIM4_CH1 generates the buzzer PWM on PB6, and ADC1_IN6 reads the battery divider on PA6. The D-pad and A/B buttons are plain GPIO inputs, PD0/PD1 carry the external crystal, and PA13/PA14 are reserved for SWD.

STM32CubeIDE clock configuration

Design notes

Power tree

text
USB-C VBUS ─┬─ MCP73831 charger ── +BATT ── JST-PH battery
            │        (R9 = 2k → ~500 mA charge current, status LED)
            │
            ├─ D3 Schottky ─────────┐
            │                       ├─ V_SYS_IN ─ SW10 ─ AMS1117-3.3 ─ +3.3V
+BATT ── Q2 AO3401A P-MOSFET ───────┘
         (gate tied to VBUS, 100k pulldown)

With USB plugged in, VBUS pulls the P-MOSFET gate high and disconnects the battery from the system rail, so the load runs from USB while the charger works on the cell. Unplug USB and the 100 kΩ pulldown turns the MOSFET on, handing the system back to the battery. The Schottky keeps battery current out of VBUS.

The 3.3 V analog supply is filtered from the digital rail through a 120 Ω ferrite bead with 10 nF + 1 µF, and each VDD/VBAT pin gets its own 100 nF capacitor alongside a 10 µF bulk cap.

Battery monitoring

A 100 kΩ / 100 kΩ divider halves the battery voltage into PA6 (ADC12_IN6), so a full 4.2 V cell reads about 2.1 V — comfortably inside the ADC range.

Buttons

All six game buttons switch to ground, so the firmware enables the internal pull-ups. SW9 selects the BOOT0 level through a 10 kΩ resistor for the bootloader, and SW10 is the main power slide switch ahead of the regulator.

Audio

PB6 (TIM4_CH1) drives the base of a BC847 through a 1 kΩ resistor; the buzzer sits between +BATT and the collector with a 1N4148W flyback diode across it. Tone generation is therefore a straight PWM/timer job in firmware.


STM32F103C8T6 pin map

FunctionSignalPortPin
Display chip selectSC_CSPA414
Display resetSC_RESPA313
Display data/commandSC_DCPA212
Display SPI clockSPI1_SCKPA515
Display SPI dataSPI1_MOSIPA717
microSD chip selectSD_CSPB1225
microSD SPI clockSPI2_SCKPB1326
microSD SPI MISOSPI2_MISOPB1427
microSD SPI MOSISPI2_MOSIPB1528
D-pad upUPPB018
D-pad downDOWNPB119
D-pad leftLEFTPB1021
D-pad rightRIGHTPB1122
Button AAPA010
Button BBPA111
Buzzer PWMAUDIO_PWMPB642
Battery senseBATT_SENSEPA616
USB data −USB_D-PA1132
USB data +USB_D+PA1233
SWD dataSWDIOPA1334
SWD clockSWCLKPA1437
Crystal inHSE_INPD05
Crystal outHSE_OUTPD16
Boot selectBOOT0—44
ResetNRST—7

The USB D+ line carries the 1.5 kΩ pull-up to 3.3 V required for full-speed device enumeration. The display backlight pin is tied to 3.3 V through a 10 Ω series resistor.

Connector pinouts

J1 — display (1×8, 2.54 mm)

12345678
+3V3GNDCSRESDCMOSISCKBacklight

J5 — microSD (1×4, 2.54 mm)

1234
CSMOSIMISOSCK

J2 — SWD (1×4, 2.54 mm)

1234
+3.3VSWDIOSWCLKGND

Bill of materials

57 placements, all SMD except the headers, switches and buzzer.

QtyReferencesValueFootprint
1U1STM32F103C8T6LQFP-48 7×7 mm
1U2MCP73831-5-OTSOT-23-5
1U3AMS1117-3.3SOT-223-3
1Y116 MHz crystal3.2 × 2.5 mm, 4-pin
1Q1BC847 NPNSOT-23
1Q2AO3401A P-MOSFETSOT-23
1D11N4148WSOD-123
1D2LED (charge status)0603
1D3SchottkySMA
1FB1120 Ω ferrite bead0603
1BZ2Magnetic buzzerPKLCS1212E
2C1, C1710 µF0603
5C2–C5, C9100 nF0402
1C610 nF0402
2C7, C81 µF0402
2C10, C1110 pF0402
2C13, C144.7 µF0603
2C15, C1622 µF0805
1R110 kΩ0402
1R21 kΩ0402
1R310 Ω0402
1R51.5 kΩ0402
2R6, R75.1 kΩ0402
1R92 kΩ0402
1R10470 Ω0402
3R11–R13100 kΩ0603
6SW1, SW2, SW4, SW6–SW8Tactile push buttonSKQG
2SW9, SW10SPDT slide switchPCM12
1J1Display header 1×82.54 mm
1J2SWD header 1×42.54 mm
1J3Battery connectorJST-PH 2-pin
1J4USB-C receptacleGCT USB4105, 16P
1J5microSD header 1×42.54 mm
6H1–H6Mounting holeM2, 2.2 mm

Repository layout

text
Gameboy.kicad_pro     KiCad project
Gameboy.kicad_sch     Schematic (single sheet)
Gameboy.kicad_pcb     Board layout
MyParts.pretty/       Custom footprint library
docs/                 Schematic print and STM32CubeIDE configuration images

Opening the project

Install KiCad 6.0 or newer, then open Gameboy.kicad_pro. Newer KiCad versions will offer to upgrade the file format; the custom footprint library MyParts.pretty is referenced from the project and needs no extra setup.

Author

Talha Khan

Parts

57
QtyValueFootprintReferences
6MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4, H5, H6
6SW_PushButton_Switch_SMD:SW_SPST_SKQG_WithoutStemSW1, SW2, SW4, SW6, SW7, SW8
5100nCapacitor_SMD:C_0402_1005MetricC2, C3, C4, C5, C9
3100kResistor_SMD:R_0603_1608MetricR11, R12, R13
210pCapacitor_SMD:C_0402_1005MetricC10, C11
210uCapacitor_SMD:C_0603_1608MetricC1, C17
21uCapacitor_SMD:C_0402_1005MetricC7, C8
222uCapacitor_SMD:C_0805_2012MetricC15, C16
24.7uCapacitor_SMD:C_0603_1608MetricC13, C14
25k1Resistor_SMD:R_0402_1005MetricR6, R7
110Resistor_SMD:R_0402_1005MetricR3
110kResistor_SMD:R_0402_1005MetricR1
110nCapacitor_SMD:C_0402_1005MetricC6
1120RInductor_SMD:L_0603_1608MetricFB1
116MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
11N4148WDiode_SMD:D_SOD-123D1
11kResistor_SMD:R_0402_1005MetricR2
11k5Resistor_SMD:R_0402_1005MetricR5
12kResistor_SMD:R_0402_1005MetricR9
1470Resistor_SMD:R_0402_1005MetricR10
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U3
1AO3401APackage_TO_SOT_SMD:SOT-23Q2
1BC847Package_TO_SOT_SMD:SOT-23Q1
1Battery PinsConnector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_HorizontalJ3
1BootButton_Switch_SMD:SW_SPDT_PCM12SW9
1BuzzerBuzzer_Beeper:Buzzer_Murata_PKLCS1212EBZ2
1D_SchottkyDiode_SMD:D_SMAD3
1Display PinsConnector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ1
1LEDLED_SMD:LED_0603_1608MetricD2
1MCP73831-5-OTPackage_TO_SOT_SMD:SOT-23-5U2
1PowerButton_Switch_SMD:SW_SPDT_PCM12SW10
1SD PinsConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ5
1STM32F103C8T6Package_QFP:LQFP-48_7x7mm_P0.5mmU1
1SWD PinsConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1USB_C_Receptacle_USB2.0Connector_USB:USB_C_Receptacle_GCT_USB4105-xx-A_16P_TopMnt_HorizontalJ4

Similar boards

  • 2 layers99.1 × 59.7 mmLaserHarp3 - Rev3.1, the printed circuit board in 3D

    LaserHarp3 - Rev3.1

    amonbenson/laserharp

    Setup a virtual environment and install the dependencies:

    134 parts1
  • 2 layers57 × 41 mmCantoto, the printed circuit board in 3D

    Cantoto

    haroldm/cantoto

    Hardware and firmware to convert infotaimment CAN messages.

    56 partsGPL-3.0
  • 4 layers70 × 70 mmMBR, the printed circuit board in 3D

    MBR

    sceric/ElectronicTheory

    96 parts
  • 2 layers50.5 × 74.3 mmStm32 macro keyboard, the printed circuit board in 3D

    Stm32 macro keyboard

    mirmisbahali/macro_keyboard

    A custom 6-key macro keyboard built from scratch custom written bare-metal STM32 firmware, hand-drawn schematics, and a PCB designed in KiCAD. No Arduino. No HAL. Just registers, datasheets, and stubbornness.

    44 parts
  • 2 layers50.6 × 71.1 mmOpen ESPilot, the printed circuit board in 3D

    Open ESPilot

    Tomas-Kuchta-FPV/Open-ESPilot

    An open-source project to develop a custom ESP32-based flight controller designed primarily for use with ArduPilot. Focused on affordability, flexibility, and ease of integration with various robotic and UAV platforms.

    109 parts18CERN-OHL-W-2.0
  • 2 layers151.3 × 122.6 mmRemote v2, the printed circuit board in 3D

    Remote v2

    KIIT-Robotic-Society/Dharma_RoboFest4.0

    Dharma Bot is a quadruped robotic dog featuring 12-DOF locomotion, real-time sensing, and a modular subsystem design.

    135 parts4MIT
  • 2 layers126 × 57 mmMini Oven Controller, the printed circuit board in 3D

    Mini Oven Controller

    MAWoodMain/ESP-Reflow-Oven

    A retro fit of a Lidl middle aisle mini oven into a home reflow oven

    46 parts2MIT
  • 2 layers67.3 × 99.7 mmSensor, the printed circuit board in 3D

    Sensor

    oakayasaroglu/esp32d_i2c

    esp32d based i2c pcb

    40 parts1

Questions

How big is the Gameboy PCB?

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

What parts does the Gameboy use?

57 parts, built around the STM32F103C8T6, AMS1117-3.3, 1N4148W and AO3401A. 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 Gameboy KiCad files?

From the TalhaHossainKhan/Handheld-Game-Console repository on GitHub, at the commit this page was made from: the board is Gameboy.kicad_pcb and its schematic Gameboy.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Gameboy design in my own project?

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