Automated Rubik's Cube Solver

A mechatronic system combining Python, Arduino, and custom hardware to automatically solve Rubik's cubes using computer vision and robotics.

Project Overview

In this collaborative project with Minhaz Rakin, we developed a Rubik's Cube solver that integrates hardware and software solutions. The system features a Python GUI for inputting cube colors, which then processes the configuration and sends commands to an Arduino-controlled mechanical system to physically solve the cube.

Hardware Development - The Hardest Part!

For the mechanical system, we chose to use three NEMA 17 stepper motors with L298N motor drivers. Rather than implementing the typical six directions of cube movement, we designed an efficient system that only required left, right, backward rotation, and 90° turns. The key innovation was our lego-rubber band mechanism that ensured the cube remained perpendicular to its base after each rotation. While our use of LEGO and wood pieces might not win any beauty contests, it created a cost-effective and remarkably secure design.

CAD design of Bottom Stopper
CAD Design

Software Integration

The software architecture involves multiple components working in harmony to solve the cube. When users input the cube's current state through our Python GUI and press "SOLVE", the system processes this information using an existing cube-solving library that we integrated into our solution. This library takes the cube configuration as a specially formatted array and returns the solution sequence.

A crucial part of our software is the translation layer that converts the standard Rubik's cube notation [L, R, D, U, B, F] into our simplified four-movement system [L, R, B, T]. This conversion allows us to achieve all necessary cube manipulations with our streamlined hardware design.

Python GUI Interface

For Arduino communication, we considered two approaches. The PyFirmata library offered direct Arduino control from Python with simpler implementation and better stability, but came with installation challenges and longer delay times. We ultimately chose direct serial communication for its superior speed, despite the debugging limitations of an unavailable serial monitor.

Project Details

Role

Hardware & Software Developer

Technologies Used

  • Python
  • Arduino
  • NEMA 17 Motors
  • L298N Drivers
  • Serial Communication