Rubik's Mood Cube / Magic Cube

YouTube demo

Guests seem to enjoy the cube when they come over, so I thought I’d share my solution with you all.


Rubiks Cube:

Here’s the gist if you’d like to implement it with Home Assistant:

I’ve got a SmartThings hub using MQTT, which passes message to my RaspberryPi running Home Assistant. All of my automations come from HA, and I just use the ST hub to connect Zigbee/Zwave devices.


Very cool!

1 Like

I wasn’t sure what this was doing at first, but as you watch the video for a few seconds it dawns on you and you say, “What an interesting and fun application!”

So I’m not going to spoil it by saying anything except it’s worth your time to watch this. :smiley:

Nice job!

I wonder if there is a non smartthings sensor that could be adapted to this. Time to check Amazon.

Well, it’s just a Zigbee sensor, so if your HA setup does Zigbee, then it would work

That is so cool and creative. I must see if I can give that a try someday; maybe with an EPS8266 and a gyro maybe.

Really cool implementation! Thanks for sharing.

Definitely inspires some creative ideas. (For example, a cube with a different music genre/band/playlist printed on each side to select music.)

Going to have to borrow this and run with it, thanks!

1 Like

i made a mysensors node replicating this functionality;

  • Arduino pro mini
  • ADXL345 accelerometer by adafruit (but any adxl345 will do i think).
  • 2 AA battery (3.3 step-up is in the mail).

The node sleeps until interrupted on digital pin 2 by the adxl345 activity detection, waits for 2 seconds and translates the X-Y-Z coordinates from the adxl345 into a ‘Z+’ or ‘X-’ or whatever orientation the cube ended up in after being woken up.
In hass i made some automations that trigger based on the state:
Z+ means turn on ‘scene all livingroom lights’ , Y- means scene livingroom lights dimmed etc.

With the adxl345 tap and double tap is also possible. I implemented the single tap as a binary switch (tap once is on, secondtap is off), but get mixed results as handling the cube sometimes results in a tap being registered while i was actually only turning it around…I’m hoping this can be fixed with the tap treshhold settings of the adxl345.

Am planning to get a cube lasercut with different icons on all 6 sides that represent the corresponding scenes, but first al blank cube with x+, z+ etc. will be made.

Power consumption is not yet really tested, but the pro-mini is running for 4 days now on the 2AA’s with powerled and regulator intact and the adxl345 in low power mode.
volt measured by the arduino internals went from 3.143 to 3.074 during this period.
I hope with the step-up module, powerled and regulator removed it will run for several months on the 2 AA’s as it will be enclosed in the lasercut cube. …

FYI: i looked at doing this with an esp8266 but it seems deepsleeping and being interrupted on an external pin is not possible (at least on a wemos d1 mini that i have).If this however is possibe i would like to hear how :slight_smile:

1 Like

Small sample video.
Cube is taped together as everything is still very beta :slight_smile:

1 Like

Please develop this a little more with your code and a building diagram :wink:
I want to make something similar.

very crude code here:

The code needs heavy clean-up but is fully functional.
It implements a
  • Orientation (X-Y-Z) sensor

  • Single Tap switch

  • Binary Motion sensor (when activity is detected sends on, after 1500 millies sends off)

  • Connect the NRF module as explained on the mysensors site

  • Connect the ADXL345 as explained on the adafruit site

  • Connect the NRF module directly to BAT-VCC, not the V-OUT of the step-up module

  • Connect VIN from Arduino & ADXL345 to the Step-up module

  • Connect INT1 from the ADXL345 to D2 on the Arduino.

1 Like

Just wanted to share mine. It’s a provisional plastic box, while waiting a cubic one. The arduino/nrf is an Slim Node from MySensors. I’m not using the step-up.
Had to tweak some of your code as my ADXL345 gave me different values for every axis.