Rubik's Cube

Hi all, I need your help to deal with my problem. Shortly I would like making an elettronic Rubik’s cube using arduino. I thought about structure of the cube and I decides to use RGB leds for each square (x54) and, in order to have an input, an homemade touch screen with 8 sensors per face (x6). About the touch screen I’m gonna try to explain through an image my idea:

each lines is touch sensitive, so in this way it’s possible to exactly determinate all different feasible moves. I looked at the Arduino Capacitive Sensing Library, although I can use the arduino to make a single face with 8 sensors, I can’t do it for all the faces counting 48 sensors. Searching on the web I found the MPR121 chip, that could be the trick. It can drive up to 12 sensors, so 4 will be enough. At the end I would like driving the leds through a cascade of shifters. About this, since each RBG led has 4 pins, and in each face there are 9, I decided to use something like 2x STP16C596. With its 16 outputs I will drive 9 leds and 5 outputs more. This is the main idea, for sure I am not an expert in elettronics and I would be so glad to read your opinions and advices about this project

You cannot move the squares (LEDs) physically, this would result in knotted wires. But you can change the colors of the LEDs, and I think you want to do just that already. As a side effect the sensors also don't move, so that it's sufficient to have sensors on e.g. the top and front sides.

For the LED wiring and coding you'll find lots of LED cube projects, with multiplexed control.

Thanks for your reply! Yep, of course I don’t want to make a physically rotating cube, that will be useless. I got a good point from your answer, that is using just 2 faces for input. That sounds good, in fact no one need to really use all 6 faces for doing moves. What I am looking for now is whether my choice of MPR121 is a good one or I can a better one. Do u have any suggestion?

I have no experience with that chip, but the data sheet looks good, Adafruit and SparkFun offer breakout boards. An I2C level shifter may be required.

I wonder how you want to build the sensors?

I found this breakout board: SparkFun Capacitive Touch Sensor Breakout. It let you connect up to 12 capacitive sensors. So, according to the previous images and using only 2 faces for input, i thought to use the following scheme:

Each number wants to indicate the output connection of the breakout. In this way i need just one mpr121 to make the entire inputs structure. About the sensors i thought to use copper lines and maybe, put them under a glass square. The idea is when you want to make a move, you just drag your finger in the relative line and it will touch two of this copper sensors giving the right input.

Do u think this is right?

Don't confuse capacitive and resistive touch sensors. Capacitive sensors require conductive areas, not only lines.

Mmm OK, thus do you think that using 5mmx50mm Cooper area (line) it will not work well?

5mm sounds good. Do you want to build a matrix, or single contacts?

What do you mean by matrix or single contacs?

A capacitive sensor consists of 2 plates. You can use the stripes for one plate (Gnd), of make them form a grid with the sensitive areas between two stripes.

Single contacts plates act as antennas, catching whatever environmental noise.

I didn't know about the former! Got it! I thought to use the single contact method, but I wanna investigate on the other.

Sorry for the wrong wording in my preceding post :-(

If you have a look at the data sheet, on page 2 you'll find some electrode patterns. The slide bar in (c) will be close to what you need, with the sensitive areas at the zig-zag lines between adjacent electrodes. The button matrix (b) or touch panel (d) will be better for 2D gestures, but I honestly don't know how the electrodes are connected to the wires, or are not connected at all.