Skip to main content
Back to projects

PING PONG Tennis Robot

Bluetooth-controlled table tennis serving robot launching balls at selectable speeds, spins, and court positions.

Verified results and performance

3Speed levels30% / 60% / 90% PWM duty cycle
4Aiming modesLeft, right, middle and random targeting
9600Baud (UART)UBRR = 103 at 16 MHz, HC-05 link
2Control interfacesMobile app and physical buttons

Project details

Role
Embedded Engineer (Team of 4)
Timeline
2025
Tracks
embedded

Technologies and skills

ArduinoEmbedded CC / C++Proteus
Assembled ping pong launcher prototype: PVC launch barrel, two wheel motors, bottle ball hopper and control electronics on a wooden base
Assembled ping pong launcher prototype: PVC launch barrel, two wheel motors, bottle ball hopper and control electronics on a wooden base
Slide 1 of 8The Spark: Why I Built This
Section 01

The Spark: Why I Built This

1 of 8

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.

Hero overview

The assembled launcher prototype.

Scroll down or tap to advance
Section 02

Platform Architecture and Big Picture

2 of 8

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
Block diagram

System block diagram: microcontroller at the centre, with four mechanisms and two input paths.

Scroll down or tap to advance
Section 03

Simulating Before Building

3 of 8

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

Proteus simulation of the controller, motor driver, Bluetooth module and IR sensors.

Scroll down or tap to advance
Section 04

Firmware: A Command-Driven State Machine

4 of 8

The firmware runs as a simple state machine driven by UART commands from the app.

  1. Power on, then initialise GPIO, PWM, UART and interrupts
  2. Enter IDLE and send a "ready" message to the app
  3. Continuously poll for commands from the app
  4. On START, move to READY with the launcher motors running
  5. When the entry IR sensor sees a ball, move to LAUNCHING and notify the app
  6. When the exit IR sensor sees the ball leave, return to READY
  7. On STOP, return to IDLE and switch the motors off
  8. A dedicated error-handling branch keeps operation consistent and gives feedback
Firmware flow chart

Firmware flow chart: IDLE, READY and LAUNCHING states with START/STOP transitions.

Scroll down or tap to advance
Section 05

The Maths: PWM, Servos and UART

5 of 8

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.

Text13 lines
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
Scroll down or tap to advance
Section 06

Mobile App Control

6 of 8

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
Mobile app UI

The control app: mode, speed and spin selection with Start and Stop.

Scroll down or tap to advance
Section 07

From Simulation to Physical Build

7 of 8

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.

Physical build

Final prototype showing the hopper, launch barrel, wheel motors and control box.

Scroll down or tap to advance
Section 08

Scope, Limitations and Future Drill System

8 of 8

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?

Contact Dineth

Dineth Anjitha

Computer engineering graduate

University of Ruhuna, Sri Lanka

© 2026 Dineth Anjitha

First-party analytics only. No third-party trackers.