Skip to the content
2 layers126.4 × 97.8 mmGamepad, the printed circuit board in 3D

Raspberry Pi Bluetooth LE HID Game controller

Size
126.4 × 97.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
29
Nets
48
Pads
174
Tracks, vias
169, 17
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
18 Jan 2025
Updated
31 Mar 2025

Overview

Gamepad is an open-source printed circuit board by kevinisabelle, from the kevinisabelle/raspigamecontroller repository on GitHub. It is a 2-layer board of 126.4 × 97.8 mm with 29 parts on 48 nets, routed with 169 tracks and 17 vias.

It is built around the MCP3008-I/P. Its parts include 9 switches, 8 resistors, 2 connectors, 1 capacitor and 1 IC. It belongs with the keyboards and input and radio and wireless boards of this library.

Main components

1

README

README.md

RaspberryPi Bluetooth LE HID Game controller

Reference documentation

Current Issues:

  • Reconnection not working automatically
  • The number of axies also seems to be limited.

Setup

Install python and bluez

bash
#sudo apt get py3-setuptools
sudo apt update && sudo apt upgrade -y
sudo apt install libbluetooth-dev

# Blutooth
sudo systemctl enable bluetooth
sudo systemctl start bluetooth

Enable Spi0 and Spi1

  • Run the raspi-config app and enable Interface Spi.
  • Then modify /boot/firmware/config.txt
  • Add these if not present:
text
dtparam=spi=on
dtoverlay=spi1-3cs
  • Reboot

Setup bluez service parameters

bash
sudo nano /lib/systemd/system/bluetooth.service

# Modify the exec start
ExecStart=/usr/libexec/bluetooth/bluetoothd -E --noplugin=*

# Save the file and restart bluetooth

sudo systemctl daemon-reload
sudo systemctl restart bluetooth

Generating the Hid Report Map and Payload Interface

In the HidTools folder, use the HidReportMapCreator program.

  • Create a copy of the KiGPSimple.cs class and name it as you like
  • Modify the Program.cs and use the new class to create the device reference
  • Run the program
  • Copy the python code from the output in the python/GamepadValues.py file
  • Modify the python/UpdaterService.py and adapt the _update_gamepad_controls according to the generated GamepadValues1 class

Running

Start the program

  • Copy the content of the python folder on the Pi
  • Run with
bash
sudo python3 App.py
  • Once the program is properly started, you can connect it to Windows using the Bluetooth configuration like any device.
  • Once the device is bonded in Windows, you can open the "Set up USB controller" to display connected Gamepads.

Debugging

Using dbus-tool

Use dbus-tool to check Bluez is connecting with the program properly:

text
sudo dbus-monitor --system

Using Wireshark

Use Wireshark on Windows to inspect the GATT services packets.

  • Start a session using Pcap2
  • Filter out protocol USB
text
!(\_ws.col.protocol == "USB")
  • Or you can filter in the proper services:
text
(\_ws.col.protocol == "ATT" || \_ws.col.protocol == "SDP" || \_ws.col.protocol == "SMP" || \_ws.col.protocol == "GAP" || \_ws.col.protocol == "GATT" || \_ws.col.protocol == "HCI_EVT")

Using Hid Explorer

You can also use this great online tool (which runs in the browser): https://nondebug.github.io/webhid-explorer/ . Using this tool you can connect to the recognized HID devices and see their definition and notifications.

Hid Creator output example:

text
Hid Report Map and Payload interface creator
---------------------------------------------------

Notes:
-------
1. This tool is used to generate a report map and payload for a HID device.
2. The report map is a list of instructions that the device uses to send data to the host.
3. It will generate the Python class code for the report payload to use in the python part of this project.

---------------------
Report Map Descriptor
---------------------

0x05, 0x01      # Usage Page (Generic Desktop Controls)
0x09, 0x05      # Usage (Gamepad)
0xA1, 0x01      # Collection (Application)
0x85, 0x01      # Report ID 1
0x05, 0x09      # Usage Page (Button)
0x19, 0x01      # Usage Minimum (1)
0x29, 0x08      # Usage Maximum (8)
0x15, 0x00      # Logical Minimum (0)
0x25, 0x01      # Logical Maximum (1)
0x75, 0x01      # Report Size (1)
0x95, 0x08      # Report Count (8)

Parts

29
QtyValueFootprintReferences
8R10KResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1, R2, R3, R4, R5, R6, R7, R8
1Button1Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW1
1Button2Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW2
1Button3Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW3
1Button4Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW4
1Button5Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW5
1Button6Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW6
1Button7Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW7
1Button8Button_Switch_THT:SW_SPST_Omron_B3F-40xxSW8
1C_PolarizedCapacitor_THT:CP_Radial_D4.0mm_P2.00mmC1
1LIN1Potentiometer_THT:Potentiometer_Bourns_PTA6043_Single_SlideRV1
1LIN2Potentiometer_THT:Potentiometer_Bourns_PTA6043_Single_SlideRV2
1LIN3Potentiometer_THT:Potentiometer_Bourns_PTA6043_Single_SlideRV3
1LIN4Potentiometer_THT:Potentiometer_Bourns_PTA6043_Single_SlideRV4
1MCP3008Package_DIP:CERDIP-16_W7.62mm_SideBrazed_SocketU1
1PiZero2WConnector_PinSocket_2.54mm:PinSocket_2x20_P2.54mm_VerticalJ2
1PowerConnectorConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ1
1ROTARY1Potentiometer_THT:Potentiometer_Bourns_PTV09A-1_Single_VerticalRV5
1ROTARY2Potentiometer_THT:Potentiometer_Bourns_PTV09A-1_Single_VerticalRV6
1ROTARY3Potentiometer_THT:Potentiometer_Bourns_PTV09A-1_Single_VerticalRV7
1ROTARY4Potentiometer_THT:Potentiometer_Bourns_PTV09A-1_Single_VerticalRV8
1SW_SPSTButton_Switch_THT:SW_DIP_SPSTx01_Slide_9.78x4.72mm_W7.62mm_P2.54mmSW9

Similar boards

  • 2 layers380 × 148.5 mmKeyboard, the printed circuit board in 3D

    Keyboard

    InkboxSoftware/all-screen-keyboard

    The first open source all-screen keyboard

    500 parts241MIT
  • 2 layers100 × 100 mmRecurBOY, the printed circuit board in 3D

    RecurBOY

    cyberboy666/recurBOY

    a rpi0 video-instrument – created in collaboration with Guergana Tzatchkova

    35 parts122GPL-3.0
  • 4 layers43.2 × 43.2 mmPogobot head, the printed circuit board in 3D

    Pogobot head

    nekonaute/pogobot

    Pogobot is an open-source open-hardware robotic platform for swarm robotics

    140 parts21
  • 2 layers100 × 100 mmI n c u r, the printed circuit board in 3D

    I n c u r

    cyberboy666/i_n_c_u_r

    a r_e_c_u_r video sampler extension circuit - adding knobs, cv and serial midi control

    38 parts16GPL-3.0
  • 4 layers101.6 × 141.7 mmPiPtr, the printed circuit board in 3D

    PiPtr

    jmlzone/PiPtr

    Repeater controller

    388 parts8
  • 2 layers111.4 × 40.9 mmRainworks Electrical, the printed circuit board in 3D

    Rainworks Electrical

    IceyPlazza/EWB-EPA-Rainworks

    26-27 EWB EPA Rainworks project; We're putting a sensor box in the ground!

    29 parts7
  • 2 layers150 × 69 mmProgramming jig r1.0, the printed circuit board in 3D

    Programming jig r1.0

    butterstick-fpga/programming-jig

    A FT232H based production programming jig for the ButterStick

    50 parts6
  • 2 layers56 × 65 mmDataHat, the printed circuit board in 3D

    DataHat

    challengerjdb/RaspberryPiHat-datalogger

    My name is Jacob Bendell, and I’m a student at the University of Pennsylvania studying Electrical Engineering. I took this past year off from school to avoid online classes and intern at Amped Innovation, a start-up in…

    22 parts6

Questions

How big is the Gamepad PCB?

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

What parts does the Gamepad use?

29 parts, built around the MCP3008-I/P. 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 Gamepad KiCad files?

From the kevinisabelle/raspigamecontroller repository on GitHub, at the commit this page was made from: the board is pcb/kicadproj/gamepad.kicad_pcb and its schematic pcb/kicadproj/gamepad.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Gamepad design in my own project?

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