← All projects

UC Berkeley · Electronics & controls lead

PID ball balancer

Robotics course project · 2022 – 2023

Our team built a robot that balances a ping-pong ball on a tilting platform: a Python computer-vision system finds the ball, and an Arduino moves the platform to keep it centered. We built it in four weeks.

My role

I wrote the Arduino code. It receives ball coordinates from the Python script over serial, then uses geometric transformations and PID control to command the servos. I also selected the electrical hardware and designed and 3D-printed the linkages.

Result

The platform constantly adjusts to balance a lightweight ping-pong ball, despite an uneven welded plastic ball and sensitivity to air drafts in the room.

The project grew my interest in coding. Afterward, I built a Micromouse, a small two-wheeled robot with encoders and IR sensors, and programmed it in Python with PID control to follow walls in a maze.

Ball balancing project website →