Project / Robotics & AI

Robot
J4

A robotic arm that plays Connect Four. Combining mechanical design, computer vision and the Minimax algorithm into a physical intelligence.

Concours Cgénial / National Winner EUCYS Latvia / CERN European Prize
Minimax AI Computer Vision Arduino Python UART Mechanical Design

A machine that
thinks and acts.

Robot J4 is not just a program. It's a physical presence at the table. When it's its turn, it looks at the board, thinks, and reaches for the grid. The whole loop: perception, decision, action. It all happens in the real world.

At its core lives the Minimax algorithm, a strategy borrowed from game theory. J4 simulates future game states, weighs outcomes and picks the move that maximises its chances of winning, or minimises yours.

Built as part of a high school engineering specialisation, the project won the national title at Concours Cgénial, then the CERN European Prize at EUCYS in Latvia.

6
Depth levels in Minimax tree
360°
Full loop: vision to physical move
1st
Concours Cgénial national final
CERN
European prize at EUCYS Latvia
01

Coin toss

A random draw determines who plays first: J4 or the human. The robot handles both opening and response strategies equally.

02

Visual perception

A camera continuously films the board. Computer vision processes the feed in real time to detect token positions and maintain an accurate board state.

03

Minimax decision

The algorithm explores the game tree up to a set depth. A custom heuristic evaluates each position, rewarding alignment, blocking threats and weighting centre control.

04

Physical execution

The chosen column is sent via UART to the Arduino. J4 moves into position and drops the token into the grid with precision.

05

Automatic turn detection

After the human plays, the camera detects the new token without any button press. The cycle continues until someone wins or the grid is full.

PythonGame engine, Minimax logic, camera interface and the full user interaction layer.
Minimax AlgorithmTree-search strategy with a custom heuristic scoring function for board evaluation at depth.
Computer VisionReal-time board state recognition and automatic token detection via continuous camera feed.
ArduinoMotor control and physical command execution for the robotic arm movements.
UART / SerialCommunication bridge between the Python logic layer and the Arduino hardware controller.
Mechanical DesignCustom robotic arm engineered for precise column targeting and reliable token handling.
Camera
Board recognition
→
Python Engine
Minimax · Logic
→
Arduino
UART · Motors
→
Robotic Arm
Physical execution
Minimax Algorithm
A recursive strategy from game theory that simulates all possible future moves up to a given depth. J4 assumes both players act optimally and picks the move that leads to the best worst-case outcome, maximising its own score while minimising the opponent's.
Heuristic Evaluation
Exploring every possible game state is computationally intractable. A custom scoring function evaluates board positions at the search horizon, rewarding aligned tokens, penalising threats and weighting central control.
Human-Robot Interaction
The loop is designed to feel natural. J4 acts, the human responds, J4 perceives. No buttons, no forced delays. The robot adapts to the human's pace through passive vision rather than explicit signalling.
Embedded Architecture
The split between Python (logic) and Arduino (execution) mirrors a real embedded systems pattern: a high-level brain communicating with a low-level controller over a defined serial protocol. Clean separation of concerns at the hardware level.

2025 / Riga, Latvia

EUCYS

Selected to represent France at the European Union Contest for Young Scientists. Awarded the CERN European Prize for exceptional work in science and engineering.

CERN European Prize