Sample:
- Visit my website for more info: BilliardBot project
High level overview

- OpenCV analyses overhead camera feed for tracking the ball and robot, as well as for calculating distances and trajectories on the pool table.
- Software sends commands to ESP32 over Wi-Fi, directing robot to maneuver to set coordinates via omniwheels.
- Upon reaching the target position and orientation, the robot charges and discharges its capacitors powering a solenoid to strike the cue ball along the intended path.
Robot:

Phys simulation

GUI

Geometric Targeting: The BilliardBot
Building a robot to play a generic video game is fun; building a physical machine that calculates and executes real-world billiard shots requires insane physics. The BilliardBot project combines an overhead visual tracker with a heavy-duty, two-axis motorized cue stick, proving that Arduino geometry can outplay a human at the pool table.
Overhead Computer Vision (OpenCV)
To play pool, the robot must know where all the spheres are on the felt.
- The project uses a standalone laptop running Python and OpenCV connected to a webcam bolted directly over the pool table, as shown in the high-level overview image.
- The Python script isolates the massive green felt block.
- It specifically scans for the white Cue Ball coordinate
(X_cw, Y_cw)and the target 8-Ball coordinate(X_8, Y_8). - The computer generates a mathematical vector line between the two balls.
- It serializes this exact geometric angle (e.g.,
Aim: 34.5 Degrees, Power: 80%) and beams it over Wi-Fi to the ESP32 microcontroller on the robot.
The Kinematic Execution (Steppers and Solenoids)
The Arduino/ESP32 acts as the "Muscle" of the robot.
- The Cartesian Platform (XY Axis): The robot physically slides along aluminum rails surrounding the pool table, using powerful NEMA 17 Stepper Motors. If the laptop tells it to aim at 34.5 degrees, the microcontroller calculates exactly how many rotational steps the X and Y motors must execute simultaneously to put the robot chassis in the correct orientation, as seen in the robot image.
- The Striker Mechanism: A cheap SG90 servo cannot hit a billiard ball; the impact will shatter it.
- The cue stick is driven by a massive, industrial 12V Push-Pull Solenoid or a tightly coiled spring released by a high-torque servo catch.
- The microcontroller commands the strike. A relay clicks, dumping high current from charged capacitors into the solenoid. BAM! The physical metal rod violently slams the cue ball perfectly down the vectorized coordinate path!
Structural Robotics Integration
- ESP32 (The primary logic interpreter and motor controller).
- NEMA 17 Stepper Motors with heavy A4988 Drivers.
- Overhead USB Webcam feeding into a Python OpenCV script.
- Industrial 12V Solenoid acting as the pneumatic-style cue striker.
- Custom Aluminum framing to allow the bot to physically slide around the perimeter of the table, as visible in the project images.