Picture of Rubik's Cube Solver


So here is a project I've been working on for a while...

This robot that can solve a Rubik's cube using Arduino.

I learned how to solve a Rubiks cube last year, and I was also into Arduino, so eventually I ended up with an idea to make my own Rubiks cube solver.

A lot of people have probably seen the tilted twister design by Hans Andersson:

I looked around at the existing Rubik's cube solvers, and I liked that design, so I built a similar version of it with (mostly) popsicle sticks, using an Arduino and 2 servos.

My robot takes 20 minutes to enter the cube state and solve.

Remove these adsRemove these ads by Signing Up

Step 1: Materials (take picture)


- Arduino UNO R3

- 2 servos (I used Hitec HS-311's)

- wires

- USB cable

You can get all of these parts from any robotics store. I got them from


- popsicle sticks

- wooden skewers

- thin plywood

- wooden wheel (skewer must fit inside the hole)

- hot glue

- paper towel roll


- Arduino IDE - (Algorithms in C++)

- Python 2.7+ and Tkinter - (GUI)

- Pyserial

Step 2: Electronics

Picture of Electronics

Wiring up the servos to the Arduino was pretty simple.

- Connect the yellow (signal) wires for the push and rotation servo to pin 6 and 9, respectively.

- Connect the positive and negative wires to the 5v power source and ground. Sometimes the servos had jitters, so I think capacitors could have smoothed out the signals.

1-40 of 67Next »
You2132 months ago

i'm getting this error how do i fix it the arduino is plugged in.. both servos do the test thing when you do plug it in and I try to get the gui working and it does this


Hi, I get the same error,did you sort it out.

matt2uy (author)  splodgie7 days ago
If you're testing out the code, take a look at step 7 (probably step 4-9 within that step).

Hi, Fixed the problem I had with the
call to the comm port, I now opens the GUI as shown in your video, and
sends the output to the Arduino ( TX/RX LED is flashing and it completes
the task.).

Now all I have to do is eat 85 ice popsicle's for
there sticks and i'm ready to start building (The cube turned up after 2
days, the Arduino Nano V3 took 4 weeks, I can now do the Rubik's cube by
hand in 1min 20sec fastest, and average 2:45s.)


matt2uy (author)  splodgie4 days ago
Great! Make sure you post a video or make an instructable when you're done so we check it out.

Thanks for the reply but still no go, What OS are your running it on. Even if i open python and load it in from there,I get the same error.

diy_bloke1 month ago

My solution is always to just take a knife, pop out all the colored elements and rearrange them back in solid fields, but yr solution is pretty good too

You2132 months ago

this one is the real one the other one i screwed up a couple things

matt2uy (author)  You2132 months ago

I redid step 7, and within that step I think step 4 to 9 would help

This is genious. Not only it works, but it is elegant!
matt2uy (author)  pablo de paris2 months ago
Thank you! Though I don't think it's as elegant as some of the other solvers out there.
berq matt2uy2 months ago

There are dozens of other machines that do what yours does. But what makes your project SPECIAL is its significant LACK of elegance! It's the way you so wonderfully finessed the opposing forces of crude and sophisticated into working together that makes people smile when they look at it, whether out of appreciation or because it made their brains do a back-flip. After all, popsicle sticks and glue are supposed to be what 2nd graders use to make ugly picture frames for their parents to throw away; they aren't for making robots! And to make such lowly building materials do what you made them do... that takes an uncommon type of engineering and creative brilliance. Your mind is a gift. I hope it serves you well, whatever you end up doing.

matt2uy (author)  berq2 months ago

Thanks for the comment. I'll keep doing what I love to do!

stmaus2 months ago

I'm trying to make your software work and the serial monitor just keeps giving me "Cross". Is the orientation sensitive when entering each face, and if so what is the standard?

matt2uy (author)  stmaus2 months ago

Yes, the orientation is sensitive. When you enter the face, start with:

Colour in Front | Colour on Top

1. Yellow | Blue

2. White | Green

3. Blue | White

4. Red | White

5. Green | White

6. Orange | White

And when you put the cube inside, take a look at the video ( to see its orientation.

rblades2 months ago

Great build, and the choice of materials and electronics make this repeatable without great expensive. The popsicle sticks look thick in the pictures, I am guessing because of zooming in the picture? I would love to have more details like dimensions of each section on the mechanical part of the build if possible.

matt2uy (author)  rblades2 months ago

Here's a few pictures I took of the robot with a ruler:

EdmondUmolu2 months ago

Wow and I thought I was smart. Nice work man, you have a really bright future ahead and I am not sure I have much if anything to add yet since I have little or no experience with any of the techniques or programs you used. I will need to research a lot more stuff first. Still its amazing and thanks for giving me something to keep me busy this summer. Keep up the good work! Now on to learning how github works......

The only thing he could add was when you put in the rubix cube the arduino knows and then it reads the colours itself so no need for the input from the computer.

great instructable

many thanks

trgz Poppy Ann2 months ago

Sound idea I reckon

EdmondUmolu trgz2 months ago

Second that two but there is some on code on there that could be uptimized for a faster runtime.

I just have no idea how to do that yet :D

you need one of these:-

but don't ask me for the code i can not make head nor tail out of arduino code

Since you're running it tethered through USB, most likely your PC has a webcam, so for the time being it could be easy to code something to read the sides of the cube from there. (Tough first it may be necessary to do a simple check for left-right mirroring, which some webcams need)

matt2uy (author)  TodThanatos2 months ago

My laptop does have a webcam, and I actually tested out an OpenCV python script someone wrote ( that worked on my computer. But it was way in over my head and I couldn't figure out how to extract the outputted cube colours in the python script.

So I just resorted to manually inputting the cube colours in a user interface.

matt2uy (author)  EdmondUmolu2 months ago

Thanks Edmond!

no p

pawanvs992 months ago


fixfireleo2 months ago

very impressive but i can solve it much faster and cheaper....just pull all the stickers off and put them back on in the right order!! :P

ddw_az fixfireleo2 months ago

Yes that works, but the stickers do not stick that good.

I dismantle the cube, then reassemble

key is to twist one plane to a 45 degree angle. then insert a flat
bladed screwdriver into the side of the twisted plane, and pop the side
piece out.

NEVER try to pop the corner piece first.

fixfireleo ddw_az2 months ago
ahh, good to know. i will keep that in mind if i ever have to solve one again. maybe we could just invent one with LED color sides so you can just hit a "reset" switch to change it back and say "here, i finished already!" lol
craftclarity2 months ago

Clever execution, interesting material choices. I like it.

agulesin2 months ago

Amazing!!! never would attempt to make one but seeing it working was worth it!

Iflyer2 months ago

Wonderful Work @matt2uy !
Cool .. keep doing new things ... All the best

Jack Moran2 months ago

Awesome! thats so cool!

Jan_Henrik2 months ago


Build_it_Bob2 months ago

Excellent work ! You must be very proud of your acomplishment !


ndronet2 months ago

This project is freaking awesome!

blissful20152 months ago

you are an inspiration! thank you!

dancingowl1232 months ago
2 words. Awe. Some
1-40 of 67Next »