Blog Home

Watch 24 colorful acrylic blocks dance to music

Arduino TeamJune 8th, 2016

Lights synchronized to music, what’s not to love? YouTuber “Robert Robert” has done just that using 24 acrylic blocks, an Arduino Uno, four 12-pixel WS2812B addressable LED strips, an Adafruit electret microphone amplifier, a 12000mAh external battery pack, and some code.

The blocks are divided into two sets of 12, held together by threaded rods and nuts, with LED strips hot glued to the back. A 60cm x 40cm stainless steel shelf rests underneath to reflect the light back.

In terms of code, the project uses Adafruit’s NeoPixel library:

The first part of the code is Adafruit’s own mic code which calibrates the sound level so that whether you’re using a big speaker or, as in the video, a tiny iPad speaker, the mic remains sensitive. The second part of the code maps the sound level onto 12 if statements so that when quiet it idles with the NeoPixel library rainbow but then as the sound level gets higher more effects are triggered. Within each if statement I have then included a random() function so that the display stays interesting. You can edit each individual strip pixel to create patterns in an infinite variety of ways and using the random () function you can keep on building so you never get bored. The code works best with music with a wide dynamic range (soft and loud parts).


4 Responses to “Watch 24 colorful acrylic blocks dance to music”

  1. M_James_O Says:

    Awesome project! I really like the very end where it fades slowly.

  2. Knelf Says:

    Fantastic effect. Where are the LED strips attached? It mentions there are 4, two on each block of twelve. I can see there is one strip attached to each side at the back centre by the looks of it, where is the other one? Next to it? Or underneath or something?

  3. RobertRobert Says:

    Hi – it is hard to see in the video, but they are just two strips along the back about 4 cm apart. I didn’t film the back because, let’s face it, there is no way to use hot glue and leave an elegant finish. Glad you like the project and thank you for the nice comment.

  4. markthespark Says:

    could i have a copy of the code to play around with please

Leave a Reply

You must be logged in with your Arduino account to post a comment.