
Have you ever seen a robot that can play catch? Well now you have. This is BaBot – a fully open-source robot built by architecture student Johan Link. And it’s absolutely ingenious – there’s no camera here to keep track of the ball, as you might think at first glance. Instead it uses a matrix of infrared LEDs and phototransistors to detect the position of the ball. The LEDs emit light, and the phototransistors measure what’s being reflected – in a way, Johan has created a very simple version of an eye, with the photoresistors standing in for the cells in the retina.
The ball location data is sent to an ATmega32U4 microcontroller (the kind that’s also used in the Arduino Leonardo), which controls three servos attached to simple mechanical linkages that connect via magnets to the top plate; this adjusts the position of the top part of the robot, balancing the ball on the acrylic plate on top, and creating a continual feedback loop between the ball, plate, sensors, and servos.
You can just about make it out in the photos, but the joints between the top half of the robot and top of the mechanical arms are metal balls and magnets; this gives the joint smoothness and ensures no loss of contact to mess with the algorithm’s calculations.

BaBot isn’t a new idea: Johan made the first version as a high school project in 2018, when videos of it went viral on Instagram. The version you see here represents years of passion, ingenuity, and hard work. “I wanted to create something that brings abstract engineering concepts to life,” Johan tells us. “BaBot is a great way to teach and explore robotics, mechatronics, and control systems, but beyond that, it’s simply fun to watch and interact with. I believe that hands-on, physical systems like this offer some of the most effective learning experiences.”
The first version of BaBot used an overhead camera to monitor the ball, which required much more processing power; using LEDs and photoresistors has enabled the use of a much smaller controller, but it did give Johan a headache when it came to dealing with ambient light.

The robotic balancing act is powered by a 5V, 10A DC power supply, as well as what Johan describes as a “classic PID algorithm”.
The microcontroller processes the data using the PID (Proportional-Integral-Derivative) algorithm, which works out the difference between the ball’s current position and the desired target position (typically the centre of the plate). It then calculates the correct angles for each of the servos; the plate’s orientation changes, and the process repeats approximately 30 times per second to keep the ball perfectly balanced.
If you fancy building your own ball balancing robot you can buy the kit from Johan at ba-bot.com; alternatively, you can make your own with a 3D printer, laser cutter, and Johan’s bill of materials.