Picture of Rubik's Cube Solver

- - - - - - -

Kitables made their own kit called the "Rubisolver" based on this Instructable.

Check out their website:

- - - - - - -

So here's 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 Rubik's cube solver.

Like many people searching for "Rubik's Cube Solver" on Google, one of the first robots I found was the Tilted Twister design by Hans Andersson:

I looked around at some other Rubik's cube solvers, but I liked that design because of it's (relative) simplicity, so I built a similar version of it with popsicle sticks, an Arduino and 2 servos.

In the end, my robot takes about 20 minutes to enter the cube state and solve.

Remove these adsRemove these ads by Signing Up

Step 1: Materials


- 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 is pretty straightforward

1. Connect the yellow (signal) wires from the push and rotation servos to pin 6 and 9, respectively.

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

1-40 of 110Next »
nic1294 made it!14 days ago

I made one too!

I rewrote all the code from scratch (it uses m2/old pochman, so it's reeeeally slow, 300+ moves).

Main difference is you input your cube state with buttons and a lcd :)

Here's a video:

Thank you for this instructable!



Hi, Nice one looks like it works very good and seems to have some speed to it. The one I build had a massive change done to it when I put it on me computer chair, forgot it was there and sat on it. I will build another some time soon.

matt2uy (author)  nic129414 days ago

That looks great!

How did you construct the metal joints on the arm? They look pretty solid.

nic1294 matt2uy14 days ago
M3 (16mm) hex bolts, 9mm washers and full nuts locked in position with hot glue :D
matt2uy (author)  nic129414 days ago


I'll keep those in mind for the next Rubik's cube solver i'm building.

zRickyDev1 month ago

Hello, congratulation for your project!

The project is fantastic but I have a problem: When the robot is resolving the cube, in the cmd I see like an endless loop (see the attached image). How Can I resolve this problem?

Thanks very much.

matt2uy (author)  zRickyDev1 month ago

Maybe you entered an invalid set of cube colours?

For example, if 10 blue squares were entered (there are only 9 blue squares on a cube), then the algorithms would get stuck trying to solve it (resulting in the infinite loop).

Try entering the colours from a fully solved cube and running the program to see if it works.

red.saber1 month ago

Didn't have time to check the source code yet, but you managed to let the arduino uno compute the solution without using a pc?

Given the configuration your robot is 100% autonomous? that's really impressive.

matt2uy (author)  red.saber1 month ago
It's completely autonomous except for the fact that you have to enter the cube colours in the beginning.

Adding a camera that could identify the colours would make it fully autonomous though.
amrodgers121 month ago

Should I put in the serial port on both line 18 and 19 or just 18?

matt2uy (author)  amrodgers121 month ago

Change the address in line 18 of, not the Arduino sketch.

Line 18:

amrodgers121 month ago

Line 18 in the arduino sketch is blank. Where do I put in the port?

voilaaa!! i just tweeked the mechanism a little to get the best accuracy for a the 5 to 8 min solves...thanks man for this project.
plz give a your ardino programme
matt2uy (author)  shaditheman1233 months ago
Nice robot!
How did you get it to solve in 8 minutes?
splodgie matt2uy3 months ago

Hi Matt, I cannot wait to see the video of this 5/8 min in action, man that's fast. Bet you cannot wait to see the code tweaking as well, he must be using a negative wait time between actions ?.

Hi, 5/8 min that is mega fast, you will have to do a video of it in action and upload the code, I tried to speed up the one i made and got it down to 15ish min from17ish min but it was shaking it's self to bits and would start to walk round the table when in action.

I see you have powered your servos from a separate power supply as the Arduino will not pass enough mAh's. I have modded my one so it can do two different cubes that I have 55mm and 57mm (one at a time that is)

doodlecraft8 months ago

Amazing, I couldn't do a rubik's cube if you paid me a million dollars and I had years to do it! Haha, great job!

matt2uy (author)  doodlecraft8 months ago


ffarook matt2uy2 months ago
hi I need a ardino programme plzz
cackette2 months ago

Hey @matt2uy, can you give more details on how to attach the rear arm to the rear arduino? I'm having difficulty with this.

matt2uy (author)  cackette2 months ago

I hot glued the servo horn (red servo attachment) to the popsicle stick.

I also used rubber bands to test the arm, but they weren't needed later on.

daaryancode2 months ago

You can try using a color sensor to get all colors of the cube instead of putting them manually

twooters3 months ago

Hi guys whenever I enter python the GUI comes up but doesnt show the colors when I click. here is a screenshot of what it looks like how do I fix this?

Screen Shot 2014-11-16 at 1.04.59 AM.png
make sure u have the right virsion of python and that u dnt change enything else than the com port and baud rate.

Are we going to see a Video of it in action, and how did you get it to solve in 5 min's ?.

Thanks man im going to work on it more today

Shadi where the Video of it in action, Cannot wait to see it M8ty.

suchitmintu4 months ago

#ser = serial.Serial(COM0, 9600)

ser = serial.Serial(COM3, 9600)

...this is my modification on my windows and when i run send cube state .py file i get this error....

Traceback (most recent call last):

File "C:\Python27\", line 18, in <module>

ser = serial.Serial(COM3, 9600)

NameError: name 'COM3' is not defined

....and also should my arduino software stay open with python cause it keeps on telling me serial port already in use? ....plz help

i want to try this program in windows so please help

u have to put quotations..('com3'...
saarsh03203 months ago

Which arduino you used from the website below? I am a bit confused

matt2uy (author)  saarsh03203 months ago
Arduino Uno R3. But any arduino could be used.


splodgie made it!4 months ago

Hi, Well after waiting weeks for the servo to turn up I completed the the Project (98% ish, still needs a bit of cleaning up to call it finished). Used a Arduino Nano V3 as it was cheaper, $2.50, 2x Servo's $6.50 of eBay, £1.00 2x 50 Garden marker sticks from Wilko's, Tube of Uhu glue from £1 shop, (guess what it cost), and about 40Hrs work in total, Setting it up and working out the bugs was a bit of a pain but part of the fun as well, made it so it all pulls apart if needed, so in all it cost about £10.

One things sure without the Instructable and Matt2uy ,I could never have worked it out, The best bit when it's working is the way it och's the cube into line so it's squared up for the next move, brilliant bit if coding Matt.

As you can see in the video I had a play with the GUI code to make it easy for me to use, (I know nothing about coding apart from look and see, and maybe that may work).

Did a quick Video to show it working. Now it's time to get some sleep .

Thanks again for the Instructable.


matt2uy (author)  splodgie4 months ago
That's awesome!

I watched your video and I think your mechanical design is a lot more reliable and well constructed than the one I made.

It's really awesome to see someone actually use my instructable to help make their own robot!

When you're 100% done, I think you should make an instructable if you want.

splodgie matt2uy4 months ago

Hi Matthew, Thanks for your comment and very happy you like my attempt at taking your design and hard work in trying to replicate it in the best way I could.
I tried to stay within the materials used and method of your design, (A evo design based on the master prototype).
As you know getting it to work after you have made your design is the hard part, or you are very lucky if it works first time.

I may try to show some of the design and the measurements I have in my copy at a later date. As some one said ' the way it works and the materials used to complete the mind bogeying complication of completing the Rubik's cube just has to makes you smile'. you should be on Dragons Den with it.


matt2uy (author)  splodgie4 months ago

Yes, getting it to work probably took up more time than actually making it for me, but that was probably due to my build quality.

I probably won't be on Dragons Den, but I hope that this project is a stepping stone for some more projects I'll be making.

suchitmintu4 months ago

yes sir downloaded the file but not working

suchitmintu4 months ago

sir made adjustments but now the cursor is simply blinking, as the program says that alternations of y can be seen but nothing is coming so plz try to help me out

thank you

buddhikag4 months ago

How to fix this? Please,

1-40 of 110Next »