Instructables
Picture of Rubik's Cube Solver

- - - - - - -

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

Check out their website: http://kitables.co/kits/rubiks/

- - - - - - -

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:

[Play Video]

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

Electronics:

- 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

Hardware:

- popsicle sticks

- wooden skewers

- thin plywood

- wooden wheel (skewer must fit inside the hole)

- hot glue

- paper towel roll

Software:

- 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 98Next »
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.
temp_756938420.jpg
plz give a your ardino programme
matt2uy (author)  shaditheman1231 month ago
Nice robot!
How did you get it to solve in 8 minutes?

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)

doodlecraft6 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)  doodlecraft6 months ago

Thanks!

hi I need a ardino programme plzz
cackette7 days 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)  cackette7 days 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.

daaryancode20 days ago

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

twooters1 month ago

Hi guys whenever I enter python Send_Cube_State.py 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.

suchitmintu2 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\state.py", 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'...
saarsh03201 month ago

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

http://arduino.cc/en/Main/ArduinoBoardUno

matt2uy (author)  saarsh03201 month ago
Arduino Uno R3. But any arduino could be used.

Thanks

splodgie made it!2 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.

Dave

matt2uy (author)  splodgie2 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.

Matthew
splodgie matt2uy2 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.

Dave

matt2uy (author)  splodgie2 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.

suchitmintu2 months ago

yes sir downloaded the file but not working

suchitmintu2 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

buddhikag2 months ago

How to fix this? Please,

Capture.JPG
i used 3.4 python.and after i got that prb iv installed 2.7..now its working fine.

#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\state.py", 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

(removed by author or community request)

windows 7 64 bit....it was on com3 ....

Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32

Type "copyright", "credits" or "license()" for more information.

>>> ================================ RESTART ================================

>>>

Traceback (most recent call last):

File "C:\Users\......\Desktop\2", line 18, in <module>

ser = serial.Serial('/dev/ttyACM4', 9600)

File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 38, in __init__

SerialBase.__init__(self, *args, **kwargs)

File "C:\Python27\lib\site-packages\serial\serialutil.py", line 282, in __init__

self.open()

File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 66, in open

raise SerialException("could not open port %r: %r" % (self.portstr, ctypes.WinError()))

SerialException: could not open port '/dev/ttyACM4': WindowsError(3, 'The system cannot find the path specified.')

>>>

How do i solve this??plz help!!!!

matt2uy (author)  shaditheman1232 months ago
Step 5 and 6 in the "how to use" step would probably help.
All abot Dogs2 months ago
This is a very good for me I love the way it solves the problem and I can't even solve a Rubik's cube
You2135 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

2.PNG
splodgie You2133 months ago
(removed by author or community request)
matt2uy (author)  splodgie3 months ago
If you're testing out the code, take a look at step 7 (probably step 4-9 within that step).
splodgie matt2uy3 months ago
(removed by author or community request)
matt2uy (author)  splodgie3 months ago
Great! Make sure you post a video or make an instructable when you're done so we check it out.
1-40 of 98Next »