Glow Cuboid

by MarkMakies in Circuits > LEDs

876 Views, 14 Favorites, 0 Comments

Glow Cuboid

glow-cuboid-feature.jpg
Coded Glow Dots R-4590

I wanted to make something artistic and dynamic using an 8x8 matrix of RGB LED's, that I recently discovered. 

I used a cheap RP2040 MCU module, programmed in Python to produce the random patterns. I just played around with numbers and algorithms until I liked the look of them. It seems that people all have very differing favorites and some that I didn’t like, others love. So to that end, I created 4 different algorithms which create distinctive patterns over time. I didn’t want to use any switches so an accelerometer determines the orientation of the cube which sets the mode. The unit resets itself when put on its back. 

Basically, you just plug it into a USB power source and it does its thing. Two of the modes take some time to initialize.

The size of the unit was determined by a piece of sample frosted acrylic lying around that measured 100 x 100 x 10mm.

Supplies

CE08607-1.jpg
glowbit-matrix-8x8_1_.jpg
IMG_5389.JPEG

I have no commercial affiliation with any particular suppliers. If there is a link to a supplier, it's where I got my parts from from. I'm based in Australia, and if I can I shop local.

3D Print Front and Back Pieces

cb9.jpg

I used generic black PLA. There is nothing special about prints, but it needs supports for the front piece rebate. My printer is a Prusa i3, so I've included the 3mf format files as well as 3D models in step format for your own slicing.

The FreeCAD format of the design is available from my GitHub https://github.com/MarkMakies/Glow-Cuboid/blob/main/Matrix 3.FCStd if you want to change it up.

Assemble Electronics

glow-cuboid6.jpg

Cover the back of the LED matrix with electrical tape, use as much as you need to ensure that you don't get a short on the back of the LED matrix.

Hot glue your micro of choice, the USB plug, and accelerometer onto the tape.

Make sure the accelerometer is pretty straight and aligned.

Use the front printed piece as a guide when gluing in USB plug.

Solder Up

glow-cuboid8_1.jpg

You can use any kind of wire.

Drop the Module Into the Enclosure.

glow-cuboid2.jpg

Snap on Back Cover

glow-cuboid7.jpg

I didn't glue it in place, but you could.

Install Acrylic Diffuser

glow-cuboid.jpg
glow-cuboid4.jpg

The front without cover should look like this.

Push the acrylic into the front. Mine fits tight, so glue wasn't needed, and a tap to get it out if required.

You could really use anything here that is 100 x 100 x 10 mm. Even some textile material across the front can look good.

The Patterns Explained

I ended up spending almost 2 weeks playing with the random algorithms until I was happy. Very subtle changes can have a big impact. Then I tested on family and friends. As they say, beauty is in the eye of the beholder, everyone has a different opinion on which looks best and what I should change. So that is when I decided on only the 4 modes, my favorite and the three most popular other ones. And since I published the videos on YouTube, even more opinions.

  • Type A: random slopes and levels, assigned to a finite number of pixels, only 2 of 3 pixel LEDs on at any one time
  • Type B: random slopes and levels randomly mapped, spatially, with random timing. Combined with random pixel deletion and random low probability pixel generation.
  • Type R: Just random(ish)
  • Type S: Random with a weighting to try to promote symbol like patterns


The mode is changed by rotating the cube so that it sits on a different edge. Placing it on it's back turns off the LEDs.


Upload Code

The mpu6050.py module is required for the accelerometer that I used.

Downloads

The Videos

Coded Glow Dots S-4553
Coded Glow Dots B-4569
Coded Glow Dots A-4560

It is difficult to get a good picture or video of the device in operation using a smartphone. However, I have managed to capture the 4 different patterns using my SLR instead.

The videos were so popular amongst friends that I filmed them in 4K UHD, so if you get a chance check them out on a big screen in UHD. They can be quite mesmerizing. In these videos, I just mirrored the edge pixels on both sides to fill the screen.

The Future

I thought I would share an idea I had for the Glow Cuboid but never implemented.

I only ever make one or two of the same type of thing before moving on to the next new project. In this case I did consider making a few more of these for special friends and family that would be entirely unique.

First I would use a well documented and robust pseudo random number generator, rather than the Python builtin. It would need to be able to be seeded with a say 1024 or higher bit key, that would be entirely responsible for the random sequence that it would generate.

The Python code would be modified so that it will use to new random generator, it would save state, say every hour so it wouldn’t loose the random ‘chain’ and lastly it would allow a single once off entry of the key/seed, in ASCII - keyboard / USB / BT.

The recipient of this Cuboid gift would be able to enter 128 (or whatever) character string. A secret message or note, something special that will remain locked in the cube forever.

Until that is, quantum computing or the like comes along and is able to take a number of current samples and extrapolate all the way back to the key and contained message.

So, maybe in 1000 years the Glow Cuboid reveals its secret message.

Food for thought.