Raspberry Pi Buzz Wire Game (fully Recycled Build)

by AwniAlholi in Circuits > Raspberry Pi

16 Views, 0 Favorites, 0 Comments

Raspberry Pi Buzz Wire Game (fully Recycled Build)

WhatsApp Image 2026-06-17 at 09.31.59.jpeg

A smart buzz wire game with automatic level detection, per zone vibration feedback, a live scoreboard and history on a web dashboard. Built entirely with hand tools and recycled materials only the electronics were bought.


Supplies

Screenshot 2026-06-17 215744.png

Github link: https://github.com/howest-mct/2025-2026-projectone-mct-AlholiAwni

Bill of Materials


The whole "making" part (box, frame, handle) is recycled and cost me nothing:

  1. Box & lid: recycled wood/plywood sheets (±3.3 mm).
  2. Frame: recycled plastic cable duct (Legrand) double duct per side.
  3. Handle: an empty bubble-blower bottle.
  4. Legs/support strips, glue, velcro, screws: leftover material

Electronics (bought, ±€130 total):

Part: Raspberry Pi 5 (4GB)

Qty: 1

Note: the brain

Part: IR obstacle sensor (TCRT5000-type, 3-pin)

Qty: 3 (5 bought)

Note: zone detection, 2–30 cm range, sensitivity adjustable via potentiometer

Part: TCS34725 color sensor (I2C)

Qty: 1

Note: level detection via strap color

Part: 4x3 matrix keypad

Qty: 1

Note: player ID

Part: LCD 1602 I2C (PCF8574A backpack)

Qty: 1

Note: game info + IP

Part: Coreless vibration motor 1015 (3V)

Qty: 1 (2 bought)

Note: zone feedback in the stick

Part: Tactile push buttons

Qty: 2

Note: power-off + display toggle

Part: Silicone hook-up wire (set)

Qty: 1

Note: wiring

Part: Stainless steel wire 1 mm (10 m)

Qty: 1

Note: buzz wire + ring

Part: JST XH 3-pin connector + housing

Qty: a few

Note: makes frame ↔ box and stick detachable

Tools

Only hand tools, deliberately chosen to prove this is re-creatable without a laser cutter or 3D printer:

  1. hand saw / coping saw
  2. drill + bits
  3. sandpaper
  4. wood glue + super glue + glue gun
  5. soldering iron + heat shrink
  6. multimeter (check continuity!)
  7. screwdriver, knife, ruler/pencil


How It Works (block Diagram)

6edc9200-c459-4f3c-9bea-2b05a0895502.png

The Raspberry Pi sits in the center. Inputs on the left, outputs on the right:

  1. In → keypad (player ID), 3× IR sensor (zones), color sensor (level), 3 contact wires (start / end / buzz), 2 push buttons.
  2. Pi (logic): Python backend with FastAPI + Socket.IO. Sensor threads (RPi.GPIO) push events to the async event loop via asyncio.run_coroutine_threadsafe.
  3. Out → vibration motor (PWM, stronger per zone), 16x2 LCD (game info / IP), the website (live + history).
  4. Database: MySQL database on the Pi (BuzzWireGame).

Set Up the Database

21a0d9fc-6285-4bb6-a436-8f78b2e26b67.png

The database is normalized and consists of five main tables in MySQLDatabase:

  1. players — id, name, player_code (4 digits)
  2. levels — id, name, color (green = Easy, red = Hard)
  3. rounds — player_id (FK), level_id (FK), start_time, end_time, completed
  4. faults — round_id (FK), timestamp, fault_zone
  5. hardware_history — links sensor and actuator events to a round (with additional catalog tables: sensors, actuators, and hardware)


Backend

The Python backend runs continuously on the Pi (python backend/app.py):

  1. GPIO callbacks from the keypad, IR and contact wires run in separate threads and push events to the async loop.
  2. On startup the color sensor reads the level (normalized RGB → Euclidean distance against calibrated values → green or red).
  3. Start/end contacts handle the timer; if the ring touches the buzz wire → fault → game stops.
  4. All data is written to MySQL, even without the dashboard.


Frontend

ChatGPT Image 17 jun 2026, 21_48_00.png

A responsive, dark-themed single-page site (HTML/CSS/JS) on a separate web server:

  1. Live (Socket.IO): play time, current zone, game state, current level.
  2. REST (from DB): scoreboard per level (fastest first) + full history.
  3. Dashboard buttons: 4 test buttons for the vibration motor (one per zone) and a power-off button for the Pi.
  4. Secured with user management and passwords.


Build the Enclosure

WhatsApp Image 2026-06-17 at 21.50.27.jpeg

The box is a wooden case (±50 × 25 × 25 cm) made from recycled sheets, built with hand tools: sawing, sanding, drilling and gluing. The top sheet is the lid that flips open (hinge) so you can reach the Pi and wiring. The back gets a feed-through for USB-C (Pi power) and a separate power supply.


Front Panel: Drill Holes and Place Components

Drill/cut the openings in the front panel and mount:

  1. left: the 4x3 keypad
  2. center: the 16x2 LCD, with the green LED below it
  3. right: the red power-off button
  4. the display-toggle button goes right next to the LCD (Desloovere feedback applied)


Mount the Sensors in the Lid

WhatsApp Image 2026-06-17 at 09.32.02 (1).jpeg

On the inside of the lid (the top sheet) go:

  1. 3 IR sensors at 10 / 25 / 40 cm → determine zones 2, 3 and 4 (zone 1 = start, no sensor).
  2. The TCS34725 color sensor, with velcro on both sides so the color strap lies flat over it.

The buzz wire dips down above each IR sensor so the ring comes within range (2–30 cm) of the IR sensor. This way you detect the zone without putting sensors on the frame.

This is what it should look like now:


Make the Swappable Wire Frame

WhatsApp Image 2026-06-17 at 09.32.59.jpeg
WhatsApp Image 2026-06-17 at 09.32.02 (5).jpeg
WhatsApp Image 2026-06-17 at 09.32.02 (4).jpeg
WhatsApp Image 2026-06-17 at 09.32.02.jpeg

The frame is an inverted U made from double plastic cable duct (2 legs + top bar), 50 cm wide. Cut the duct to size and glue/screw the corners. Sand and paint the frame white for a clean look.

Shape the Buzz Wire and Lay It in the Frame

Lay the stainless steel wire (1 mm) in a natural, wavy shape inside the duct — no sharp angles. At each IR position let the wire dip down (toward the IR sensor in the box), but not too close. Fix the wire in the duct. Start and end contacts sit at mid-height.

The Color Strap (level Detection)

Hang a colored strap (for my project I used 2 colored cloths) low on one leg, level with the velcro (or double face tape) on the box. The color sensor reads the color and picks the level:

  1. green → Easy
  2. red → Hard

Calibrate once: sample both colors with kalibratie.py; it writes normalized RGB constants that app.py uses.

Make the Handle (stick)

WhatsApp Image 2026-06-17 at 09.32.50.jpeg
WhatsApp Image 2026-06-17 at 09.32.02 (3).jpeg
WhatsApp Image 2026-06-17 at 09.32.02 (2).jpeg

The handle is an empty bubble-blower bottle (recycled):

  1. Drill a hole in the bottom/through the cap for the wiring.
  2. Make a ring/loop from stainless steel wire (inner diameter ±2 cm) and fix it on top.
  3. Put the vibration motor inside the bottle.
  4. Run the wires (motor + ring contact) through the hole to a coiled cable toward the box.


Make It Detachable With JST XH 3-pin Connectors

To swap frames and detach the stick, I use JST XH 3-pin connectors (instead of GX12):

  1. Frame ↔ box: the contact wires (start / end / buzz + common ground) run through JST connectors, so you can lift one frame out and plug another in.
  2. Stick: a separate JST 3-pin for the vibration motor + ring contact.

Solder the wires to the JST pins, heat-shrink them, and check continuity with the multimeter.

Wire Everything to the Pi

Connect everything to the Raspberry Pi (BCM numbering):

  1. Keypad: rows on GPIO 17, 23, 25, 27 — columns on GPIO 24, 22, 5. (Do not change these pins.)
  2. IR sensors: GPIO 4, 6, 13 (active-LOW, internal pull-up).
  3. Vibration motor: GPIO 18 (PWM, via a transistor circuit — you don't drive the motor straight off a GPIO).
  4. Color sensor + LCD: I2C (color sensor 0x29, LCD 0x38/0x27).
  5. Buttons + contact wires: on their GPIOs with pull-up.
  6. Common ground

Testing

Test step by step with your separate test scripts (keypad.py, IRsensors.py, kleursensor.py) before running everything together:

  1. Keypad: does each key print the right value?
  2. IR: does each sensor detect object/free?
  3. Color sensor: does it read green vs. red correctly after calibration?
  4. Contact wires: do start, end and buzz trigger?
  5. Vibration motor: does it vibrate harder per zone?
  6. LCD: does it show game info and toggle to the IP?

Then start python backend/app.py and open the site at http://<Pi-IP>:5000/.



Done! Play

Click the wire frame into the two legs, plug in the JST connectors, put the strap on place, and you're ready:

  1. Green (on the website): you're safe, game running.
  2. Red (+ buzz/vibration): ring touched the wire → game over.
  3. Completed: ring through the end contact → time saved → appears on the scoreboard.