Robotics + Computer Vision + AI

AI Air Hockey

An autonomous air hockey opponent powered by real-time computer vision, predictive AI, and a custom-built 2-axis robotic mechanism. Human vs. Machine, one puck at a time.

Scroll

Turning a tabletop game into an engineering challenge

This project transforms a standard consumer air hockey table into a fully autonomous AI opponent. An overhead camera tracks the puck in real time, a prediction algorithm calculates the trajectory, and a custom-built 2-axis linear actuator system drives the AI's mallet to intercept, block, and strike back. The result: a machine that plays air hockey against a human, reacting in milliseconds.

2
Axis Motion
<50ms
Reaction Time
CV
Puck Tracking
AI
Strategy Engine

See it in action

▶ Video
Gameplay DemoAI tracking puck movement across the table surface
Robotic mechanism close-up
2-Axis MechanismLinear rail system with stepper motors and the AI mallet
▶ Video
Live PlayHuman opponent testing the system during development
▶ Video
Mechanism DetailSide view of the rail-mounted actuator assembly

What powers the system

👁

Computer Vision

Overhead camera captures the playing field. Real-time image processing isolates the puck and tracks its position frame by frame with sub-pixel accuracy.

OpenCV Color Detection Frame Differencing
🧠

Prediction Algorithm

Calculates puck velocity and trajectory from tracked positions. Predicts bounce angles off walls and determines optimal intercept point for the AI mallet.

Kinematics Trajectory Prediction Real-time

Motion Control

Custom 2-axis gantry built from linear rails and stepper motors. Controlled via microcontroller, translating predicted intercept coordinates into precise physical movement.

Stepper Motors Linear Rails Microcontroller
📈

Strategy Engine

Beyond pure defense: the AI evaluates when to block, when to counter-attack, and how to position for advantage. Adaptive difficulty keeps the game competitive and fun.

Game AI State Machine Adaptive Play

From puck to response in milliseconds

01

Capture

Overhead camera feeds live video of the playing surface to the processing unit at high frame rates.

02

Detect

Computer vision isolates the puck position from the background using color filtering and contour detection.

03

Predict

The algorithm calculates velocity, direction, and wall bounces to determine where the puck will arrive.

04

Strike

The 2-axis actuator moves the mallet to the intercept point, executing a block or counter-attack.

AI Air Hockey at exhibition
Exhibition DemoShowcased live at a project exhibition with visitors playing against the AI