Rubik’s cube! One of the most fascinating and challenging puzzles for man and machine. Many have come up with an easy and fast solution to this. Rubik's Cube Solving Robot is a robotic system that solves a Rubik's Cube puzzle autonomously. This robot aims to solve the cube in the fastest way possible.

Rubik's Cube Solving Robot

Materials Used:


Stepper Motor interface with ESP8266

Stepper Motor is a Brushless DC Motor. Stepper motor receives control signals to rotate it in steps. Since the stepper motors require high current which cannot be handled by a microcontroller or a microprocessor, the motors are wired to stepper motor drivers. All the 6 stepper motor drivers are then connected to ESP8266. We used A4988 is a bipolar stepper motor driver.

Stepper Motor interface with ESP8266

Mechanism and Algorithm:


Firstly, using a webcam, the image of each face of the cube is taken in a specific order. Using OpenCV, colour sequences of each face is identified from the image. With God's algorithm, the quickest solution to solve the cube is determined by using the same. The output is a series of moves to resolve the cube. This output is converted into a set of instructions for the six stepper motors interacting with the Rubik's Cube. Each stepper motor is controlled by stepper motor drivers. The sequence of moves produced to solve the cube is executed by driving the stepper motors.

God's Algorithm

God's algorithm is a concept that arose from discussions of how to solve Rubik's cube, but it can also be extended to other mathematical puzzles and games. It refers to an algorithm, which generates a solution with the least possible number of moves. The maximum number of moves it takes to solve a Rubik's Cube is 20 which is also known as God's Number.

Working Video:

Rubik's Cube Solving Robot