Modern maker technology has made it possible for anyone to build sophisticated low-cost robots, some of them are even more impressive than state-of-the-art robots from just a decade or two ago. While the mechanical components and motors haven’t changed much — other than becoming more affordable — the electronics to control them have evolved dramatically. That’s evident in this Raspberry Pi Ball Juggler that uses computer vision to track a bouncing ping pong ball at 90 frames per second.
Computer vision is a rapidly growing field, but until recently it was out of reach for makers. Even a simple computer vision setup requires a decent digital camera, a lot of processing power, and complex software to analyze the video. Luckily, there is now powerful open source computer vision software, cameras are dirt cheap, and a low-cost Raspberry Pi has enough processing power to handle real-time computer vision applications.
The robot, which was built by Redditor u/Nekojiru_, uses three NEMA 17 stepper motors to move a ping pong paddle. Those are controlled by the Raspberry Pi through an Arduino and A4988 stepper drivers. A camera points at the paddle, and has a resolution of just 192x256 in order to run at 90 FPS. Using a custom computer vision application written in Python, the Raspberry Pi determines where the ping pong ball is. Then, it adjusts the movement of the paddle as necessary to keep the ball bouncing.