Lego Robot Solves Rubik's Cubes - Yes, Really

| 9 Dec 2008 14:28

I don't know what makes a guy wake up one morning and decide, "I'm going to build a Rubik's Cube-solving robot out of Lego today," but there's no denying that the results are awfully damned cool.

Hans Andersson was inspired to build the beast after seeing Cube solvers created by other people, using only a standard Lego Mindstorms NXT kit he'd previously bought for his two daughters. One of the trickiest parts turned out to be color recognition, which he accomplished via the kit's light sensor; unfortunately, some of the colors on the Cube report almost identical sensor values, meaning it was impossible to properly differentiate them. The solution was a simple matter of replacing some of the colors on the Cube with non-standard hues.

The software to control the device was originally written in C, and after a good deal of testing was then ported to NXC, the language for the "programmable brick" in the Lego Mindstorms NXT set. The first algorithm averaged 97 moves per solution, but by implementing a combination of techniques devised by other people he was able to reduce that to an average of 60 moves, as well as increase calculation speeds.

The end result? A little Lego monster that solves Rubik's Cubes better than you can. To be clear, this thing is not plugged into a PC; it's entirely self-contained, "seeing" and solving the puzzles with no outside help. For the aspiring (and Lego-equipped) engineers in the crowd, Andersson has even provided all the instructions for building one of these things yourself, as well as the source code and executables for his software, at his website,

via: mental_floss

Comments on