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.

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 canadarobotix.com


- 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

<p>for some reason when I send the info from GUI, CDM does everything and prints on the screen everything perfectly but the servos do not move a bit. Also many a times arduino IDE says 'uploading' for half an hour but does not upload. Also one of the servo jitters a lot. HELP PLZ</p>
<p>Does Tkinter come with python 2.7?</p>
<p>can you direct me to the part where it creates the algerithm to be executed? I am doing a similar project and I am trying to find code for it.</p><p>Thanks</p><p>-Dwight</p>
<p>Almost done. Can you explain me better how to make the machinery itself. I wanna blow people's minds at the science fair. Dont worry, I'll give you the credits </p>
<p>Thanks dude:)</p>
How to download the pyserial for python 2.7....pls provide me with a link bcause the site gives too much options n i get jumbled up as i m new
<p>if you are to lazy to even find the correct download, I don't think you are qualified to build this project.</p>
<p>just goto python install directory and do</p><p>pip install pyserial</p>
<p>When I try to run the .py script <br>NO Module Named serial COmes up like shown below. Need help please. <br>I dont have knowlodge about python and c++<br>Design is same so far this step is making me stuck.</p>
<p>Install the Pyserial libary</p>
What if i dont use python and pyserial...will it still work?
<p>No, Pyserial is used to communicate with Arduino</p>
<p>Hello, friend, I have to do a project for the university, so I decided to choose this one because I like it a lot, but I had a problem, when I went to look for the Python code the web page presents problems and does Do not give me the download link, and another question, the code should be edited in order to receive the cube faces instead of just &quot;x&quot; or &quot;o&quot;. Please help me, I expect a prompt response. I'm from Colombia.</p>
<p>What should be the starting position of the motor?? Please reply</p>
<p>Thanks for the instructions Matt2uy. With some tweaking of the program due to a slightly different mechanical design, I was able to make it work. </p><p>Photo attached, video link to follow.</p>
<p>hi, can i ask you something about that design :( i'm stuck. please help me<br>my gmail: skyhostvn@gmail.com<br>thanks!</p>
<p>I'm having problem, can you help to take a look, which values i should adjust for the code? push_pos, rotate_pos, rotate_finish, etc - <a href="https://www.youtube.com/watch?v=Z-q8WYRX7fc&t=0s" rel="nofollow">https://www.youtube.com/watch?v=Z-q8WYRX7fc</a></p>
<p>in how many moves and in how much time does it take to solve it?</p>
<p>It all depends on the solve and the algorithm input into the computer. Sometimes it can take up to 120 moves. Other times it can take 5-10. And it also depends on the speed of the servo's turning. So it will vary quite a bit.</p>
what is the paper towel roll for?<br>
<p>In the images, it shows the paper towel roll being used to add height to the project to allow the arm to not hit the table or whatever it is sitting on.</p>
<p>Hi :( i use arduino UNO r3. and Futaba S3003 Servo. it turns not like 90 degrees :( please help me.</p>
<p>which servo motor should i choose for it ? ie what should be torque required fot it ?</p>
is 1.6kgf torque servo enough ??
Wow its amazing and out of popsicle sticks too!
<p>Hi, I just finished building the Cube solver and now made my way to the coding part, it seems that the tic tac toe GUI isn't available to download anymore. Is there another GUI link available?</p>
<p>is this correct? seem like repeating the same thing.... </p>
<p>Hey matt2uy even I am facing the problem of getting endless loop of 'Whole Cross: F'. I tried entering differnt combinations but get same result for all of them.</p><p>Any suggestions?</p>
hey man im having one problem with the rotating platform, its very glitchy.in some directions it rotates 90 degrees fine and alignes perfectly with the hand but in other directions it totally misses and the platform becomes not centered so the cube wont flip.ive tried a lot of thing but i couldnt fix it.hope anyone helps .<br>thanks!
<p>Same here. I'm almost done with my rubik' solver and i have a problem with the rotating platform. My platform does not align with the pushing arm unlike their work which works perfectly fine. I really need help with this problem too! I hope they could read our comments.</p>
try getting a clean power supply, lithium batteries work great .<br>if you still have the problem try getting the same hitec servos because they are more precise because some servos don't need to be that accurate like servos used in rc stuff.
<p>Did you ever fix the problem of it not rotating completly? I am having the same problem</p>
<p>how to reverse the rotating servo ?</p>
How much did it cost u to build one ?
<p>Will a micro servo motor do the job?</p>
<p>Hi, It tried Quality SG90 mini servos, and they struggle big time,pulling high mAh and not working. Of the 4 STD sizes, Micro/Tiny/Mini/Standard, you are better of using the standard size as Matt has listed for your first build, it hard enough on the to get it working correct with them, then you could swap them out for smaller ones at a later date. </p>
Oh thanks for the information.
<p>Thank you very much Matt for this amazing instructables, can't replicate exactly your version, mechanics was for me too complicated, so i choose this slightly different... </p><p>https://www.youtube.com/watch?v=NRRSYEWIQ_w</p>
How to chamge the angle that the push servo is pushing at?<br>Thanks in advance
<p>I have an Arduino MEGA 2560, is it compatible? Thanks!!</p>
Yes, you can use any arduino for the project.
<p>Maaaadeeeee!!! Thank you so much!!!!</p>
<p>Thanks, but when i'm uploading the program to the Arduino, it sends me a message avrdude: stk500v2_ReceiveMessage(): timeout. Never happened before. </p>
<p>Hi matt, why do you have so complicated rotation function?</p>
<p>is the rotate servo a full rotation one</p>
<p>I made one too!</p><p>I rewrote all the code from scratch (it uses m2/old pochman, so it's reeeeally slow, 300+ moves).</p><p>Main difference is you input your cube state with buttons and a lcd :)</p><p>Here's a video: <iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/ViafK5Dlph8" width="500"></iframe></p><p>Thank you for this instructable!</p><p>Nicola</p>
Hey nic please can you teach me completely that how did u made it cos i cannot afford arudino frm my pocket money
I used an arduino pro mini clone, you can find one for 4-5&euro; shipped online. The servos are a bit more expensive, I paid 20&euro; for both.<br>The ice lolly sticks are around .03&euro; each, you'll need about 100 of them I guess.<br>To build it I suggest you follow this awesome instructable, it's pretty straightforward :)
<p>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.</p>

About This Instructable




More by matt2uy:Rubik's Cube Solver How to make a vertical phone stand 
Add instructable to: