For my MIE438 (Microprocessors and Embedded Microcomputer Systems) final project, my team and I built an autonomous cup pong robot: a turret that scans the table, finds the nearest cup, aims itself, and launches a ping pong ball into it with no human input.
Here it is in action:
We originally planned to find the cups with computer vision, but after some feedback we pivoted to a 1D LiDAR (TF-Luna) mounted on a rotating servo base. The robot sweeps across the table in 2° steps, logs the distance at each angle over I²C, and picks the angle with the smallest reading as the closest cup. It then slews the turret to that angle, spins up a pair of brushless flywheels to a fixed speed, and a feeder motor pushes the ball into the launcher. The whole sense–plan–act loop runs on a single ESP32, written in C++ with PlatformIO, and is structured as a Scan → Aim → Fire state machine.
The end result:
- 100% cup detection rate
- ±2° angular accuracy
- 200cm maximum reliable shooting distance
The hardest parts were all mechanical and electrical rather than software. Our custom ball bearing made the turret tilt, our DIY hall-effect RPM sensor couldn't survive the flywheel speeds, and faulty wiring killed our planned PID control loops, so we settled on fixed-speed shots instead. Even so, we ended up with a clean embedded system, coordinated entirely by one microcontroller, that reliably shoots ping pong balls into cups.
The CAD was done in Onshape; the only part we didn't design ourselves was the ball feeder tube, adapted from Tylr-J42's shooter.