Rusty Cube
A Rubik's cube solving robot
Author: Porojan Mihai-Iulian
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-PorojanMihai
Description
This project is a Rubik's cube solving robot using a 4 clamp servo powered system along with a color sensing module. My goal is to reduce the workload of the microcontroller by generating an optimal solution with Kociemba's algorithm on my laptop to allow for a much faster solve (< 20 moves).
Motivation
I chose this project because I was fascinated by the MIT robot that managed to solve a scrambled cube in 0.38 seconds and decided to create my own version using a more budget friendly approach with servomotors instead of stepper motors and a manual color sensing module instead of cameras.
Architecture
Log
Week 5
Decided on the final project idea and ordered 2 servos and a color sensing module to allow for initial testing.
Week 6 - 8
Received the STM32U5 microcontroller from the lab. Tested the SG90 servo to make sure it can turn the face of the cube before ordering more. Tested the color sensor, encountered issues in detecting the orange and white face, the module is highly influenced by ambient lightning so i tried to find a solution without altering the cube itself. I plan on 3d printing a small box with a hole for the color sensing module on the bottom, this will allow me to place the cube on top of the sensor with no external interference, if this is unsuccessfull I will have to resort to using a sharpie on the orange and white face of the cube.
Week 9
Decided on using Kociemba's algorithm on my laptop to generate the solution because of memory constraints.
Hardware
My project is based around the STM32U5 provided at the lab to take the solution generated on my computer using Kociemba's algorithm and control the rotating clamps. The 4 clamps are designed with a pair of SG90 servos each, one servo moves the clamp away and towards the cube, while the other rotates the face of the cube 90 or 180 degrees. The color of each piece of the cube is detected using the TCS34725 color sensor seated in a small box separate from the main mechanism to ensure no external interference with the sensor.
Schematics
Todo
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| STM32 Nucleo-U545RE | The microcontroller | Borrowed |
| TCS34725 Color Sensor | Color detection | 49.82 RON |
| SG90 Servomotor (8x) | Rotating the cube's faces and moving the clamps | 9.49 RON |
| Electronics Kit | Breadboard,wires,resistors etc. | 39.99 RON |
Software
| Library | Description | Usage |
|---|---|---|
| embassy-stm32 | Hardware Abstraction Layer | Controls the pins, the USB/UART connection to the laptop, and the I2C bus |
| embassy-executor | Async Executor | Used for drawing to the display |
| kociemba | Algorithm crate | Used for generating the solution on the computer |
| embassy-time | Timer | Handles the pause between servo movements |
| tcs3472 | Color sensor driver | Read the colors from the detection module |
| defmt | Logging framework | Debugging |