Rusty Goals
A dual-controller foosball game
Author: Cristina Stîngă
Github Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-Cristinaaa12
Description
The project is an interactive foosball game designed for a dynamic two-player experience. Each player uses a custom-built remote controller to command their digital striker on the field. The strikers are powered by stepper motors and move along the OX axis to position themselves and execute rapid striking maneuvers to kick the ball.
Using a set of arcade-style buttons, players can move their striker left or right to block shots and trigger a strike action to score a goal. The system features a distributed architecture, where a central STM32 master coordinates the movement while two Raspberry Pi Pico units handle player input and real-time scoring updates on OLED displays. To ensure reliability and precision, the machine is equipped with endstops to recognize its frame boundaries and infrared sensors to automatically detect goals.
This project combines hardware engineering and real-time control into a fun, high-speed test of player coordination.
Motivation
I wanted to create an interactive project that I could test and enjoy with my classmates. After researching various concepts, I was inspired by a unique foosball mechanism I discovered on social media.
Architecture
The project uses a modular design where different parts work together to control the game and track the score in real-time.
Main Components:
-
Processing Units
- STM32 Nucleo-U545RE-Q: This is the main controller. It handles the game logic and monitors all sensors at high speed.
- Raspberry Pi Pico H: These boards manage the buttons and screens for the players. They send player inputs to the STM32 and update the displays based on the information received back.
-
Movement & Action
- Attacker Mechanism: This part uses stepper motors and linear rails. The motors are connected to the STM32 through A4988 drivers, which translate digital signals into precise physical movement.
-
Sensors & Feedback
- Goal Detection: Infrared sensors are placed in the goals. When the ball passes, the system automatically updates the score.
- OLED Displays: Small screens that show the current score.
- Endstops: Limit switches that tell the motors to stop at the edges.
-
User Controls
- Arcade Buttons: High-quality buttons that players use to move and shoot. They are designed for fast and repeated use.
Log
Week 6 April - 12 April
-
Thought about the game concept and made a first list of needed parts.
-
Looked into how the players should move and kick.
Week 13 April - 19 April
-
Checked if the STM32 and Pico work well together.
-
Figured out how to link the controllers to the main board.
-
Decided to use buttons instead of joysticks for better control.
Week 20 - 26 April
-
Ordered all the necessary electronic components and hardware parts.
-
Sent the custom-designed slider parts for 3D printing to begin the mechanical assembly.
Hardware
The system uses one main controller (STM32 Nucleo-U545RE-Q) and two secondary boards (Raspberry Pi Pico H) to handle the game smoothly.
-
Main Controller (STM32 Nucleo-U545RE-Q): This is the brain of the project. It runs the game logic and tells the motors how to move. It communicates with the player boards using Serial communication via USB-C modules and sends signals to the motor drivers.
-
Player Boards (Raspberry Pi Pico): Each player has a Pico board. Its job is to read the Arcade Buttons and show the score on the OLED screens.
-
Motors & Movement: I use NEMA 17 motors with a GT2 belt system to move the players. Linear bearings and steel rods make the movement smooth, while Endstops stop the motors safely at the edges.
-
Sensors: IR Sensors are placed in the goals. When the ball passes through, the sensor sends a signal to the STM32 to increase the score.
-
Power Supply: A 12V adapter powers the motors. I use an LM2596 converter to change 12V into 5V for the controllers.
Schematics
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| STM32 | The microcontroller | - |
| Raspberry Pi Pico H | Boards for the players to read button inputs and control the screens | 41.14 RON x 2 |
| NEMA 17 Stepper Motor | Provide the physical force for moving and kicking the ball | 67.06 RON x 2 |
| A4988 Drivers | Act as intermediaries to control the motors based on STM32 signals | 8.09 RON x 2 |
| A4988 Expansion Board | Simplifies wiring and protects drivers from voltage spikes | 9.97 RON x 2 |
| OLED Displays (0.96") | Small screens that show the live score to each player | 16.95 RON x 2 |
| Infrared obstacle sensor | Detect when the ball enters the goal to update the score automatically | 3.12 RON x 2 |
| Endstops SS-5GL2 | Small switches that detect when the slider reaches its physical limit | 5.23 RON x 4 |
| Arcade Buttons | Durable buttons used by players to move and shoot | 9.99 RON x 6 |
| LM2596 Step-Down Module | Converts 12V to stable 5V output | 6.69 RON |
| GT2 Timing Pulley | Used to drive the belt and move the players | 4.67 RON x 2 |
| GT2 Timing Belt | Transfers rotation into linear movement | 6.70 RON x 2 |
| LM8UU Linear Bearings | Ensure smooth sliding on the steel rods | 4.90 RON x 8 |
| GT2 Idler Pulley | Keeps the belt tensioned and aligned | 10.89 RON x 2 |
| Type-C Panel Module | Professional connection for USB-C cables | 11.53 RON x 4 |
| 3D Printed Parts | Custom mounts and sliders | - |
| Linear Shafts (8mm x 300mm) | Precision steel rods for the track | 28.49 RON x 4 |
| USB-C Braided Cables Set | Connect controllers to the STM32 | 9.15 RON |
| 12V 5A Power Adapter | Main power source for the entire system | 50.70 RON |
| DC Female Jack Adapter | Connects power adapter to wiring | 4.14 RON |
| Resistor Kit | Used for current limiting, signal conditioning and pull-up/down configurations | 15.16 RON |
| Mini Breadboard (170 pts) | Provides a stable mounting point for the Pico H and connects arcade buttons/OLEDs | 2.42 RON x 2 |
| Breadboard (830 pts) | Main hub for STM32 integration | 10.00 RON |
| Electrolytic Capacitor | Filters power supply noise and protects drivers from voltage spikes | 3.03 RON x 3 |
| TOTAL | Estimated Total Project Cost | 727.09 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-stm32 | Hardware Abstraction Layer for STM32 microcontrollers | Used to control the motor pins, read the IR sensors and handle Serial communication |
| embassy-rp | Hardware Abstraction Layer for the Raspberry Pi Pico | Used on the player boards to read the arcade buttons and drive the OLED displays |
| embassy-executor | An async/await executor for embedded systems | Used to run multiple tasks at once, like moving the motor while checking for button presses |
| embedded-graphics | A 2D graphics library for embedded screens | Used to draw the score on the OLED displays |
| ssd1306 | OLED Display driver | This is the specific driver that talks to my 0.96" screens via I2C |
| embassy-time | Handles timing and delays | Used to control the motor speed and to make sure a button press is counted only once |
| defmt | A highly efficient logging framework for resource-constrained devices | Used for debugging |
| panic-probe | Panic handler | Used for debugging crashes |
Links
- Project Concept: https://www.instagram.com/reel/DVoDEazjhOp/?igsh=cjRhNHViMnJhc3Nu
- Movement Mechanism: https://www.instagram.com/reel/DXIX2Q3Efan/?igsh=MTh3N2l1MmZrN3hyOQ==