PING PONG Tennis Robot
Bluetooth-controlled table tennis serving robot launching balls at selectable speeds, spins, and court positions.
Verified results and performance
Project details
- Role
- Embedded Engineer (Team of 4)
- Timeline
- 2025
- Tracks
- embedded
Technologies and skills
The Spark: Why I Built This
Table tennis is fast, and the skills that win points (spin control, trajectory adjustment, precision) only come from repetition. The hard part is finding a partner who can feed you the same kind of ball again and again.
"Inconsistent practice from human partners slows skill development and makes training less effective."
Commercial ball machines exist, but this project set out to build something simple, accessible and tunable from a phone for players of any level. As a team of four for EE6352 Embedded System Design at University of Ruhuna, we designed, simulated and built the whole system.
The assembled launcher prototype.
Platform Architecture and Big Picture
The system is built around a single microcontroller that coordinates four mechanisms and two input paths.
- Controller: physical buttons plus an HC-05 Bluetooth module for the mobile app
- Ball release: a servo releases balls from the storage hopper into the supply tube
- Ball supplier: an IR sensor detects a ball in the tube, and a DC motor pushes it toward the launcher
- Launcher: two DC motors fire the ball, and a second IR sensor confirms the ball is ready to launch
- Aiming: servo motors reposition the launcher to target different areas of the table
System block diagram: microcontroller at the centre, with four mechanisms and two input paths.
Simulating Before Building
Before touching hardware, the full circuit was modelled in Proteus: an Arduino Uno (ATmega328P), an L298 motor driver for the DC motors, servo motors, an HC-05 Bluetooth module and two IR obstacle sensors.
Simulating first let us validate pin assignments, motor driver wiring and UART communication before committing to the physical build.
Proteus simulation of the controller, motor driver, Bluetooth module and IR sensors.
Firmware: A Command-Driven State Machine
The firmware runs as a simple state machine driven by UART commands from the app.
- Power on, then initialise GPIO, PWM, UART and interrupts
- Enter IDLE and send a "ready" message to the app
- Continuously poll for commands from the app
- On START, move to READY with the launcher motors running
- When the entry IR sensor sees a ball, move to LAUNCHING and notify the app
- When the exit IR sensor sees the ball leave, return to READY
- On STOP, return to IDLE and switch the motors off
- A dedicated error-handling branch keeps operation consistent and gives feedback
Firmware flow chart: IDLE, READY and LAUNCHING states with START/STOP transitions.
The Maths: PWM, Servos and UART
Speed, aim and communication are all configured from a few small calculations.
Each launch speed is simply a different duty cycle on the launcher motors, and each aiming angle maps to a servo pulse width between 1000 and 2000 us.
Motor speed (16-bit PWM, max 65535)
Low 30% -> 65535 x 0.30 = 19660
Medium 60% -> 65535 x 0.60 = 39321
High 90% -> 65535 x 0.90 = 58982
Servo angle -> pulse width
pulse (us) = 1000 + (angle x 1000 / 180)
50 deg -> 1277.78 us -> PWM 71
90 deg -> 1500 us -> PWM 128
120 deg -> 1666.67 us -> PWM 171
UART baud 9600 @ 16 MHz
UBRR = 16,000,000 / (16 x 9600) - 1 = 103
Mobile App Control
A phone app talks to the robot over Bluetooth (HC-05, 9600 baud). The interface is grouped into the same options the firmware exposes:
- Mode Selection: Left, Right, Middle or Random landing zone
- Speed Control: Low, Medium or High
- Spins: Left, Right, Random or No Spin
- Start / Stop: big buttons to begin and end a session
The control app: mode, speed and spin selection with Start and Stop.
From Simulation to Physical Build
The final prototype uses a PVC pipe as the ball barrel, two wheel motors as the launcher, a repurposed plastic bottle as the ball hopper, and a wooden base. The electronics sit in a transparent box with an external power supply.
Final prototype showing the hopper, launch barrel, wheel motors and control box.
Scope, Limitations and Future Drill System
Deliberately in scope: three speed levels, spin selection, multiple aiming directions and wireless control.
Deliberately out of scope for this version:
- Automatic ball collection and refilling
- A ball-sequence feature to schedule launch frequency and intensity
Both would be natural next steps toward a full training-drill system.
Discuss this project
Have questions about the architecture or design decisions?