Instructables

Rubik's Cube Solver

Featured
Picture of Rubik's Cube Solver

Video: https://www.youtube.com/watch?v=gy5B6neyWf8


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)

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 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 62Next »
diy_bloke12 days ago

great.
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

You21315 days ago

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

2.PNG
matt2uy (author)  You21314 days ago

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

You21315 days 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
This is genious. Not only it works, but it is elegant!
matt2uy (author)  pablo de paris1 month ago
Thank you! Though I don't think it's as elegant as some of the other solvers out there.
berq matt2uy19 days 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)  berq15 days ago

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

stmaus17 days 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)  stmaus15 days 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 (https://www.youtube.com/watch?v=gy5B6neyWf8) to see its orientation.

rblades29 days 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)  rblades28 days ago

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

20140701_160955.jpg20140701_161030.jpg20140701_161007.jpg20140701_161321.jpg20140701_161249.jpg20140701_160837.jpg20140701_160922.jpg20140701_161208.jpg
EdmondUmolu1 month 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 Ann1 month ago

Sound idea I reckon

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:- http://www.ebay.co.uk/itm/RGB-Color-sensor-module-...

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)  TodThanatos1 month ago

My laptop does have a webcam, and I actually tested out an OpenCV python script someone wrote (http://www.cs.ubc.ca/~andrejk/525project/) 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)  EdmondUmolu1 month ago

Thanks Edmond!

no p

pawanvs991 month ago

awesome!!

fixfireleo1 month 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

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

I dismantle the cube, then reassemble

the
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.

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

Clever execution, interesting material choices. I like it.

agulesin1 month ago

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

Iflyer1 month ago

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

Jack Moran1 month ago

Awesome! thats so cool!

Jan_Henrik1 month ago

amazing!

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

Build_it_Bob

ndronet1 month ago

This project is freaking awesome!

you are an inspiration! thank you!

2 words. Awe. Some
msemtd1 month ago

Wonderful! I have seen the Tilted Twister but it never occurred to me to try and emulate the design in other materials. I would very much like to build one! Well done!

matt2uy (author)  msemtd1 month ago
Thanks. I'm looking forward to what you'll build!
Ugifer1 month ago

What a fab' project! Love the robot, especially the fact that it's made largely out of sticks!

I reckon, however, that with 3 RGB LEDs and a bright light you could also do the colour input using the Arduino - that would make it truly automatic and doubly amazing!

See this instructable for RGB LEDs as colour sensors:

http://www.instructables.com/id/Using-an-RGB-LED-t...

I used LED sensing of light in general (not colour specifically) on this:

http://www.instructables.com/id/Throwduino-Basic-L...

and it worked amazingly well.

Keep up the great work!

Ugi

matt2uy (author)  Ugifer1 month ago
Thanks! I actually tried out the instructable, but due to the design of my robot I had a few problems. But if I make a version 2.0, i'll keep your suggestion in mind!
Ugifer Ugifer1 month ago

Sorry - not sure that is the right link. There is an 'ible (or similar) somewhere about actually using an RGB LED as a sensor. I'll if I can find it.

1-40 of 62Next »