Over a million developers have joined DZone.

Building a Kinetis Lava LED Light Cube

A tutorial on how to build an LED cube with Adafruit boards that changes colors.

· IoT Zone

Access the survey results 'State of Industrial Internet Application Development' to learn about latest challenges, trends and opportunities with Industrial IoT, brought to you in partnership with GE Digital.

In “openHAB RGB LED Light Cube with WS2812B and NXP Kinetis” I started experimenting Kinetis boards, a LED cube diffuser and Adafruit WS2812B NeoPixel LEDs. That worked well, but I was not too happy about the visual effects. So here is my next version: I wanted to have control over each side of the cube. For this I have built a cube inside the cube with a 3D printed structure:

Bare LED Cube

Bare LED Cube

To mount the LCD boards in a cube form, I have printed a 3D structure:

3D Printed Structure with Adafruit Boards

3D Printed Structure with Adafruit Boards

The boards get attached to the structure:

Board Placement

Board Placement

This is how the cube looks like with 5 boards mounted:

Boards mounted on Cube

Boards mounted on Cube

First LED Tests, with low current:

First Cube Tests

First Cube Tests

With built-in smoothing between colors:

Bare LED Cube

Bare LED Cube

Video of the transition:

With this I can control each side of the cube and blend the colors nicely. With sides and parts of the sides changing slowy the colors and moving up and down the cube it gives that ‘Lava Lamp’ kind of look:




The cube structure made of PLA can get warm (around 70°C) and softens a bit if the LEDs are at full power. PLA melts around 180-220°C, but because the structure is very light it easily can affect the stabilit. I think I would definitely need some different internal structure material, both for cooling and heat resistance. Right now I’m limiting heat with controlling the average brightness.


Each LED color needs up to 20 mA, so that would be a max of 60 mA per LED (red, green and blue). With 5 times 64 LEDs that makes a maximum of 20.4A (!!!). Glad I had a 5V 40A power supply so I could even add more modules to the cube :-):

5V 40A Power Supply

5V 40A Power Supply

Enoug power to drive more LEDs, but because of the heat I don’t want to run the LEDs full power for too long anyway.


Here are a few impressions how it looks like. But the pictures only barely can capture the real effect in the room:

Cube 1Cube 2Cube 3Cube 4Cube 5


I have now 5 different scenes I can control (color, speed, transition effects).


The cube supports now multi-color effects with a RGB LED cube inside. The total of 320 LEDs draw a lot of current and cooling might be a challenge if running at full brightness. In a next step I could add extra BLE beside openHAB control (see “How to Add Bluetooth Low Energy (BLE) Connection to ARM Cortex-M“). And of course add more colorful programs :-).

Sources of the project are available on GitHub.

Happy Cubing :-)

The IoT Zone is brought to you in partnership with GE Digital.  Discover how IoT developers are using Predix to disrupt traditional industrial development models.

iot app development ,java ,iot development

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}