Move to Play: Belt Motion Controllers for a Two-Player Raspberry Pi Game

by tolko in Circuits > Raspberry Pi

259 Views, 2 Favorites, 0 Comments

Move to Play: Belt Motion Controllers for a Two-Player Raspberry Pi Game

instructables-hero-cover.jpg

Winter is coming, and my kids are inside almost every afternoon. I’m fine with some screen time — I’m not the parent who hides the tablet — but I kept noticing the same scene: slouched on the sofa, another video, zero movement. Telling them to “go play on something, stop watching TV” never sticks. What does stick is anything that feels like a game.

So I tried meeting them where they already are: the TV. I made a small box that clips to a belt, with a motion chip inside and a battery you can recharge. Jump, and the character on screen jumps. Duck, and you duck under obstacles. The Raspberry Pi picks it up over Bluetooth — no cables trailing across the living room. The game is called BlobJump, and it’s basically the dinosaur runner we all know, except your body is the controller.

I built two remotes on purpose. One has a blue button (boy hero), one red (girl hero). You set that when you flash the firmware, and you can still swap with a quick press while playing. If a second kid turns their belt on, the Pi splits the screen, and they run the same obstacles side by side.

This Instructable walks through the whole thing: wiring the LiPo and charger board, the ESP32-C3 and MPU-6050, flashing the firmware, then getting the Pi to talk to the belts. You can stop at one controller and add a second later. I also printed a simple case with belt loops, but cardboard and tape is honestly fine for a first test.

Plan on a weekend or two if you’re soldering after work, or you are bad at soldering like me. You should be comfortable with basic electronics and copying a few terminal commands on the Pi. The game itself is for school-age kids; the building part is adult work, especially around the battery.

Anyway — if your house also turns into “indoor season” and you’re tired of the couch potato loop, maybe this helps. The steps are below. Jump when you’re ready.

Supplies

0-02-05-93e23d4d787de6c184917ec6dac32d1e23d97ff2ee5d01ae800c0e2217922482_225e5efd30f.jpg
0-02-05-8d7b83cbfb6c05d8401f08df1adec5ea9cfbc455c42143d16e4db1d00852b16e_225e5f0cb1c.jpg

One belt remote + one Raspberry Pi. For two players, double everything under Each belt.


Each belt

• ESP32-C3 SuperMini (flash blue or red firmware)

• GY-521 MPU-6050 module (I2C, AD0 to GND)

• LX-LCBST USB-C Li-ion charger + 5 V boost (trim to 5.0 V)

• 1S LiPo 3.7 V, 500–1000 mAh, with protection

• Momentary button (blue cap = boy unit, red cap = girl unit)

• Hook-up wire, 24–26 AWG

• USB-C cable to charge the box

• Perfboard, pin headers, heat-shrink, foam for MPU — optional


Pi + TV (once)

• Raspberry Pi Zero 2 W (Bluetooth)

• microSD 16 GB+ with Raspberry Pi OS

• HDMI cable and display

• 5 V USB power supply, 2.5 A or more


Optional

• 3D-printed belt box with lid (PLA or PETG)


Tools

• Soldering iron and solder

• Wire strippers/side cutters

• Multimeter

• USB cable to flash the ESP32

• Computer with PlatformIO or Arduino IDE

• Raspberry Pi Imager

Solder and Wire the Belt Remotes

wire.png
0-02-05-cdeaa8c4cb62995323165f047d7170fe52065af325ef733a0dcd2a9aeff3b6ec_225e5f99b39.jpg

This is the part where the project stops being a pile of parts and starts looking like something you could actually clip on a belt. I soldered pin headers on the SuperMini and the GY-521 first — it’s easier on the bench than inside a tiny box. If you’re using perfboard, lay everything out dry before you commit with solder.

Use the wiring diagram as this step’s main image and keep it open while you work. I still double-check SDA and SCL when I’m tired.

Build one remote start to finish, then make a second for two-player. The wiring is the same on both; you’ll only pick blue vs red button caps here and flash different firmware later.

Power (the LiPo part deserves a slow read)

  1. LiPo B+ / B− → USB-C charge board → LX-LCBST B+ / B−
  2. LX-LCBST VO+ → SuperMini 5V; VO− → GND
  3. Trim the boost to 5.0 V with a multimeter before you walk away
  4. The power button is not wired in the raw battery path alone — it’s GPIO5 to GND for wake/sleep

Motion chip (GY-521)

  1. VCC → 3V3, GND → GND
  2. SDA → GPIO8, SCL → GPIO9 — if motion looks dead, swapped SDA/SCL is the first thing I check
  3. AD0 → GND (address 0x68)

Button

  1. One leg → GPIO5, other leg → GND
  2. Blue cap on the unit you’ll flash as “boy,” red on “girl” — same wiring either way

Before you tuck it in a pouch: common ground everywhere, ~5 V at the SuperMini, keep the MPU wires short, then a short LiPo test instead of a long first session. Flash blue vs red firmware in a later step after motion_test looks good.

Sync the Code From GitHub

Get the code (first time):

git clone https://github.com/tlk0s/body-ble-games.git
cd body-ble-games


Test the Remotes on Your Computer (Jump, Duck, Sidestep)

2026-10-01_10-50-10.png

Before I clipped anything to a belt, I checked that the motion chip worked over USB. No Raspberry Pi yet. The repo includes a sketch called motion_test that prints jumps and ducks in a serial window on your Mac or PC.

BENCH SETUP

- Power the ESP32-C3 from USB-C on the SuperMini only.

- If the LiPo is wired, unplug the battery for this test.

- Hold the MPU in your hand or on foam.

- Point one edge the same way you will toward the TV on the belt later.


FLASH FIRMWARE

Install PlatformIO (VS Code extension is fine). Open a terminal in the cloned repo.

Go to the motion test folder:

cd body-ble-games/firmware/motion_test

Plug in a data USB-C cable. Find the port (Mac: cu.usbmodem in /dev; Windows: COM port in Device Manager).


Blue button remote:

make flash-blue


Red button remote:

make flash-red


Either remote (generic):

make flash


OPEN SERIAL MONITOR

Baud rate: 115200
make monitor

If the log is empty, press RST on the board once.

Stand still facing your TV direction when calibration runs (about 5 seconds).


WHAT YOU SHOULD SEE

Jump in place

[JUMP]

Squat or lean forward (duck)

[DUCK] ON

Stand up

[DUCK] OFF

Shuffle sideways (hips stay forward)

[STEP] LEFT or [STEP] RIGHT

Press and release the GPIO5 button

[BTN] down and [BTN] up, then boy or girl hero line


I personally tested this on the data cable with soldered motion sensor and hero button to the esp

Flash the Game Firmware and Play BlobJump on Your Computer

2026-10-01_11-20-02.png
blobJump test

Serial motion_test proved the wiring. This step flashes the Bluetooth firmware and runs the real Pygame app on your Mac or PC before you move anything to the Raspberry Pi. Same game, same belts, just on your laptop screen first.

In the repo you already cloned (github.com/tlk0s/body-ble-games):

cd body-ble-games/firmware/body_controller

Unplug any serial monitor. Plug in USB data cable.

Blue button belt:

make flash-blue

Red button belt:

make flash-red

When upload finishes, you can unplug USB from the computer. Power the remote from its LiPo or USB charge port for play. In Bluetooth settings you should see a device named BodyCtrl with extra characters.


SET UP THE GAME ON YOUR COMPUTER

You need Python 3 and Bluetooth turned on (Mac or Windows 10 and up).

cd body-ble-games/pi
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

On Windows use .venv\Scripts\pip instead of .venv/bin/pip.

Mac or Linux:

MOCK_BLE=0 ./run

Windows (PowerShell, from the pi folder):

$env:MOCK_BLE="0"; .\.venv\Scripts\python.exe main.py

A window opens. It is waiting for a belt, not keyboard 1 or 2.

  1. Power on one remote (button if it sleeps).
  2. Wait until the menu says a controller is connected (not only "waiting").
  3. Do a jump motion. That picks BlobJump, same as on the Pi.
  4. Play: jump over obstacles, duck under them.
  5. Short-press the belt button to swap boy and girl hero if you like.
  6. Press Esc on the keyboard to quit the app.

Optional two-player on the desk: power a second remote. The game should split the screen when both are connected. Jump on either belt to start.

Optional skip menu (go straight into BlobJump):

MOCK_BLE=0 BODY_GAME=blob_jump ./run

3D Print the Belt Enclosure (Box and Lid)

0-02-05-1d2ee3b74c92426194e482726c82371123a46c41d3df5eb43f1bd23e2a67b79f_225ef66a695.jpg
0-02-05-7d60a36444351fe8ae22dcb64d3c93024e47255a1edac1402e9889c40e3a61f5_225ef667e2c.jpg

Cardboard and tape is fine for the first desk test. Before kids wear it on the sofa, I wanted a small box that clips to a belt, exposes the power button, and leaves a USB-C opening for charging without opening the lid every time. I modeled mine in Tinkercad (you can use Fusion, OpenSCAD, or any slicer-friendly tool) whith some support from a web parametric box generator.

The assembly is pretty tight, but a dash of hot glue magic and some electrical tape will keep everything together ;)

Raspberry Pi Kiosk Mode (SSH Setup, No Keyboard)

0-02-05-89648bffecd76ad38325d987b91ed4e617f88a07ec5cb7f0c5e8f664ef95c62e_225effcf9ed.jpg

The Pi sits behind the TV: power on, full-screen BlobJump, belt remotes over Bluetooth. I never plugged a keyboard into the Pi. Everything below is done from my laptop over SSH, plus one-time options in Raspberry Pi Imager before the first boot.

Install Raspberry Pi Imager. Insert the microSD.


Choose Raspberry Pi OS with desktop (32-bit is fine on Zero 2 W). Click the gear icon (Customize):

  1. Set hostname: bodygames (or any name)
  2. Set username and password (example user pi)
  3. Configure Wi-Fi name and password
  4. Enable SSH: Use password authentication (or paste your public key if you use keys)
  5. Set locale and keyboard layout

Write the card. Put it in the Pi, connect HDMI to the TV and power. Wait about two minutes.

On your laptop (same Wi-Fi as the Pi):


ssh pi@bodygames.local


If .local fails, check your router for the Pi IP, then:
ssh pi@192.168.x.x


First login uses the password you set in Imager.

sudo apt update
sudo apt full-upgrade -y
sudo apt install -y python3 python3-venv python3-dev libsdl2-2.0-0 libportmidi0 bluez bluetooth git

sudo usermod -aG bluetooth,render,video $USER

sudo systemctl enable --now bluetooth

Log out and back in over SSH so groups apply:

exit
ssh pi@bodygames.local

Check Bluetooth:

bluetoothctl show
You want Powered: yes.
cd ~
git clone https://github.com/tlk0s/body-ble-games.git
cd body-ble-games/pi
python3 -m venv .venv
.venv/bin/pip install -U pip
sudo apt install -y build-essential libdbus-1-dev python3-dev
SKIP_CYTHON=1 .venv/bin/pip install -r requirements.txt
chmod +x start-kiosk.sh run
Note: Building dbus-fast can look stuck for 20+ minutes on 64-bit Pi OS. SKIP_CYTHON=1 avoids the long compile. On 32-bit OS you can use piwheels instead: pip install -r requirements.txt --extra-index-url https://www.piwheels.org/simple

Desktop must start at boot so the game has a display.

sudo raspi-config nonint do_boot_behaviour B4
B4 = auto login to desktop.

Disable screen blanking:

sudo raspi-config nonint do_blanking 1

Reboot:

sudo reboot

Wait one minute, SSH in again.

On every login the Pi runs start-kiosk.sh: git pull, pip install, then full-screen BlobJump with MOCK_BLE=0.

mkdir -p ~/.config/autostart

Create the autostart file (one block paste in SSH):

cat > ~/.config/autostart/body-ble-games.desktop << EOF
[Desktop Entry]
Type=Application
Name=Body BLE Games
Comment=Full-screen BLE kiosk
Exec=$HOME/body-ble-games/pi/start-kiosk.sh
Terminal=false
X-GNOME-Autostart-enabled=true
EOF

Reboot:

sudo reboot

After reboot the TV should show the game without typing anything on the Pi. Updates log to ~/body-ble-games/pi/kiosk-update.log.


Power cycle the Pi: game should start, remotes connect, kids jump on the TV. You keep the laptop for SSH updates only.


AI-Assisted Software

The belt hardware and how we play on the TV are a hands-on build. The Python games on the Raspberry Pi — including BlobJump and the launcher — were written with help from AI coding assistants. I still chose the game feel, tuned motion thresholds, playtested with kids, and fixed what broke on real hardware. I am sharing that openly because Instructables readers deserve to know what was assisted and what was soldered at the bench.

WHAT AI HELPED WITH

  1. Game logic, graphics scaffolding, and BLE glue code in the pi/ folder
  2. Firmware structure and motion detection tuning in firmware/body_controller/
  3. Drafts

WHAT STAYED HUMAN

  1. Wiring, LiPo safety, enclosure design, and what actually goes on the belt
  2. Flashing remotes, Pi kiosk setup, and troubleshooting on my TV
  3. Decisions, ideas, enclosure...

What's Next

  1. Add a game via pull request (AI can help :) )
  2. Lane Race game (sidestep) is in the repo as a work in progress
  3. Upload your enclosure STLs for others to print
  4. Scores and sound on faster Pi boards
  5. Share your play video in the comments


Thanks for reading — if you build it, I'd love to see a photo of your belt setup.