Cubeduino - Rubik's cube-like display thing

So I've been working on this thing from time to time the last half year or so, and it is getting longer and longer between updates. So I thought I make a post about it here, even though I'm not completely finished. Basically it's just some coding that is left, even thought I also would want a nicer physical finish on it some time.

In short, it is a cube measuring about 15 cm cubed, weighting about 1.1 kg, having 96 RGB LEDs and 96 buttons all over it, controlled by one Atmega 328 with an Arduino-compatible bootloader. And lots of shiftregisters (24)!

Originally I only thought about making a Rubik's cube like thing (The Rubik's Revenge, as it is 4 by 4 by 4), but it is kind of impractical after all (weight and size for one, plus it feels sort of like a cube-shaped rubber ball :P) I find I mostly use the small color-tests I've made while making this. So it's more of a mood-lamp-thing. Also I haven't combined this with the Rubik's cube code, so there are two different versions to download.

I put up a blog with a more detailed description, schematics and code to download here: http://cubeduino.wordpress.com/

And a video:

Might seem a bit odd, but the reason being I borrowed a camera, and while filming I am explaining things like The Most Boring Man. So after I delivered the camera back, I wanted to discard all that jabber but had to make due with the footage I got. And ended up with this.

In the video I have two wires attached to it, one for power and one for serial communication (to update code). But it can be without them, as it also contains 3 AA batteries. But I usually don't use those.

Except for the shiftreglcd library I hacked together last year, this is basically my first real arduino project. Also the first time I've made several identical PCBs, and a first multi-PCB project. Since I finished my UV box last year I was searching for PIC's (since I had used it - once, from my Flutter display in the message wand thread here), but luckily I landed on Arduino :slight_smile:

Words cannot descibe awesomeness! :o

I love it!

I thought of rubik's cube as soon as I saw the video :stuck_out_tongue:

I am at a loss as to what else you could do with it though! ;D

Mowcius

Thanks mowcius! :slight_smile:

I am at a loss as to what else you could do with it though!

Sort of me too, but I do got some ideas. For one I'm a bit annoyed by myself that I haven't utilized the 3-axis accelerometer I stuck in there yet. So eventually I hope to make a "artificial horizon" mode, I just need to get my head around it.

As for the Rubik's cube fork of the code, I could imagine things like saved games, a Rubik's cube 2x2x2 and 3x3x3 (by combining the 2 middle layers), but atm I'm at a loss for a menu system (and nearing the memory limits of the SRAM in the atmega 328 I too). Btw the accelerometer could probably be used for scrambling the cube, by shaking it :stuck_out_tongue: However, the build is not really ment for that kind of handling, as the only thing holding the keypads are the 8 connecting headers for it.

I love this too .. brilliant, just brilliant. in both concept
and execution.

That's really cool, well done!

How about giving it a keyboard function? And since it has an accelerometer, perhaps it could also act as a mouse.
Love the look of it =)

Very nice indeed :slight_smile: Well done!

How about giving it a keyboard function? And since it has an accelerometer, perhaps it could also act as a mouse.

Thats a pretty cool idea! But I imagine it would be even worse to write on than one of those foldable rubber keyboards!
Now, if I only had used 96 of those graphical LCD buttons instead :stuck_out_tongue: Like on the Optimus keyboard, but thats not really a cheap solution :o (I figure mine were expensive enough).

However, the build is not really ment for that kind of handling, as the only thing holding the keypads are the 8 connecting headers for it.

You could have it in a nice laser cut acrylic box with the buttons poking out and that would hold it all together :slight_smile:

I think the shaking for scrambling the cube is also a good idea...

Mowcius

ou could have it in a nice laser cut acrylic box with the buttons poking out and that would hold it all together

Yeah, I have been thinking about that. For the moment I don't really know how to begin making that, but sometime in the undefined future I hope to get that done.

Also, I could replace the screws holding it together, with longer screws that protrude a bit through the 4 by 4 button bases (have to drill 4 additional holes in the button bases then), to fasten it properly. These could also go through that acrylic sheets on top of it I think. Which is what I initially thought doing, but went "temporarily" away from.

Yeah, I have been thinking about that. For the moment I don't really know how to begin making that, but sometime in the undefined future I hope to get that done.

Well that's my speciality so if you ever want one doing then give me a nudge :slight_smile:

Mowcius

http://www.duinoaday.wordpress.com

But I imagine it would be even worse to write on than one of those foldable rubber keyboards!

Even if it isn't, it sure would have that novelty factor!

Another obviously insane application would be to use it as a 'keypad' for a lock ;D
"nono, he pressed this combination!... ehm.. on which side did he do it again..."

Well that's my speciality so if you ever want one doing then give me a nudge

That's cool! But I imagine I would still have to wait a bit with that.

Anyway I'm curious as to what you'd charge for 6 sides about 12cm by 12cm? Also what kind of format or software would I need to supply you (I imagine you would need some sort of CAD file?). I got a couple of other questions too but I guess I can take that later.

Even if it isn't, it sure would have that novelty factor!

True :slight_smile:

Another obviously insane application would be to use it as a 'keypad' for a lock

Already thought of that. But I think I rather not leave it outside my door :wink:

Would be a bit hard to open the door with the cubeduino on the other side :wink:

Perhaps it'd make a decent alarm clock?
Add a speaker of some kind, and to deactivate it you need to press certain colours (that change?)
Such a puzzle would surely wake you up, the accelerometer can be used to detect cheating (read: pulling the plug), making it impossible to deactivate without opening it up!

Already thought of that. But I think I rather not leave it outside my door

Haha, yeah indeed! :wink:

Mowcius

Nice
Pretty Cool

I did see an idea where they mounted minature pushbuttons under the LED's, and bent the leads so that when you pressed the LED, it pressed the pushbutton.

At the time I couldn't think why, you'd use it, but in your application it would suit.

How about using it as a clock?
Rather like the one in Hong Kong?, and use the accelerometer to make sure its always the right way up.

Mark

That's a beautiful piece of industrial ART! I love it! This is some very sophisticated work. You did a really nice job of documenting/blogging the construction too.

I skimmed your blog, but without real study, I don't understand how you drove 288 separate PWM elements from a single Atmega. :o :-?

Help me out here!

I skimmed your blog, but without real study, I don't understand how you drove 288 separate PWM elements from a single Atmega. :o :-?

Help me out here!

He used shift registers. This meant that he couldn't do 'proper' high resolution PWM so he is limited in terms of colour combinations but as he says, it is enough for a rubik's cube.

Mowcius

andylama: Thanks!

Well the secret is having a very limited range of PWM via shiftregisters :slight_smile: The arduino uses 256 levels of PWM, I use 3 or 4 mostly. I haven't really tested the limits yet (even if its a simple thing to do, I'll get around to it soon). If memory serves, the ISR (interrupt service routine for the display) uses about 40% of processing time, at 1 kHz. I said in my blog I could probably get it up to 16, but I'm not sure with the current method. At least 8 should work fine, but with less processing power to other stuff (so the display would slow down anyway, as calculating the colors and stuff would slow down, but it would't flicker as bad).

While the ISR is at 1 kHz, the display is not, as there are 4 rows, each looped PWM levels-1 time.

(I think I discovered a bug in my documentation in the blog now regarding calculating FPS).

Anyway, at PWM=3 levels, the FPS should be 1 kHz / (PWM-1) / 4 = 125 Hz
At 4 PWM levels, FPS = 83.333 Hz

and so on.

I start noticing flicker at 6 PWM levels, which is 50 Hz.. except now I got a bit unsure, it sounds too high. I think I have to look closer at the PWM - FPS calculation I use (so no guarantee on the correctness here).

markB:

I can google it, just a quick question anyway: what is the clock in Hong Kong like? At 4 by 4 pixels (almost 6 by 6 except corners, if borrowing from the other sides :P), its pretty limited what it can display.

EDIT:

Since I got a scope now, I thought it was about time to measure it.

And indeed the FPS is my formula mentioned above :slight_smile:
(so there is a slight error in my blog doc,but i'll fix it soon).
However now I don't see the flicker noticeably at 50 Hz, though I see it is not quite stable (at the limit I think). But at 7 PWM I see the flickering (41.67 Hz).

raron

If I recall the clock was at the top of the building, and used illuminated sections going around, so it was visible from every direction.

If I recall they showed the hour and 15min.

I don't have broadband, so a quick search wasn't quick at all. :-[

Sorry I can't recall much more than that, but I did think it was neat when I first saw it on the TV. :-/

Mark