GlowBit Desktop Audio-Visualiser

Updated 23 March 2023

Introduction

I’ve had this little 8x8 Glowbit matrix for a few weeks now, and for whatever reason, the first thing I thought after running the example programs was “This needs to be synchronised to music!”


So, I set out to turn it into an audio-visualiser, and oh boy was that a process. Fortunately for those of you following along at home, I’ve already sorted out the code problems and designed a neat little mount that you can send straight to the printer (no supports, obviously!).


Contents


  • What You Will Need
  • Assembly Instructions
    1. Print the Bits
    2. Preparing the GlowBit Matrix
    3. Insert Nuts
    4. Mounting the Pico
    5. Wiring the Pico
    6. Mounting The Matrix
    7. Cover it Up
    8. Secure It Down
    9. Attach the OLED Display
    10. Enjoy
  • Software Setup
    1. Set up MicroPython
    2. Install Packages
    3. Upload the Code
    4. Configuring the Project
    5. Getting It Running
  • Final Remarks

What You Will Need


Hardware

Tools

If you don’t have a 3D printer or a soldering iron, you can still follow this guide, but you may have to find other ways to mount the components and attach cables to the Glowbit display.

In addition to all of these parts, you will need access to a modern computer (Ideally Windows) and a rudimentary knowledge of Python and installing packages.

Here’s what full_plate.stl looks like when it’s sliced and ready to print.


Assembly Instructions

Alright, now that’s out of the way, it’s time to get into the thick of it!

Step One: Print The Bits

First course of action is printing the case since that’ll hold all the electronics at the end and it’s gonna take a few hours. I’ve uploaded all of the parts to Thingiverse. There are 3 models, as well as one which has all of them closely packed to print in one go. All of the models are correctly oriented and should print without supports (although you may want to add a brim to the cover).

  • Note that the Thingiverse page also contains alternate versions of the models for those of you who would prefer not to attach an OLED Display.

Here’s what full_plate.stl looks like when it’s sliced and ready to print.


Step Two: Preparing The GlowBit Matrix

 

We’re going to need to solder headers to our Glowbit Matrix (although I’ve had some luck with bending the plug end of a jumper cable through the connectors, in a pinch).

Start by using pliers to snap a single header pin off the end of the strip.

Grab the single pin with the pliers.

Using your fingers, gently push the shroud to the end of the pin (do not remove it!)

 Take your newly adjusted pin, and push it through one of the connector holes on your Glowbit Matrix such that the shroud is on side with the LEDs. From the other side, solder the pin to the pad. Repeat this process for the remaining 5 connectors.


Step Three: May Contain Nuts

Take the base part that we printed earlier and place nuts into each of the slots. Be careful to properly seat all of them, since they can be pretty fiddly to get back in if they fall out later.

 


Step Four: Mounting The Pico

Place the Raspberry Pi Pico with the pins facing up and the micro-USB port facing to the left. Make sure that all of the mounting holes line up with the standoffs.

After putting the Pico in place, gently secure it with M2x12mm screws. Don’t worry if the holes are slightly too tight, since PLA is soft enough that gently turning the screw ought to be enough to coax it into place.

If this is done correctly you should still be able to see the BOOTSEL button looking from the bottom of the case (although ideally you won’t be pressing this very often!).


Step Five: Wires, Wires, Wires

If you have a big strip of jumper wires like I did, you can keep things tidy by only breaking off the ones you need. For this you’ll need to break off a strip of 4, a strip of 2, and an individual wire.

  • First things first, we’ll wire up 5V and Ground for the Glowbit Matrix. Take the strip of 2 wires and connect them to VSYS and GND.
  • Next, take the individual wire and connect it to pin 18. This will serve as the data pin for the Glowbit Matrix.
  • Now we’ll connect the wires for the OLED display. Take the strip of 4 wires and, going right-to-left, connect them to GND, 3V3 Out, GPIO 2, and GPIO 1.

Step Six: Mounting The Matrix

Finally getting on to the fun stuff, it’s time to mount the Glowbit Matrix to the stand.

First, take the Glowbit Matrix, and the mounting plate, and place it inside so that the pins stick out the back.

Take the wires from before, and connect them to the Matrix. Connect GND to GND, VCC to VSYS, and DIN to GPIO 18.

After connecting the Glowbit Matrix, secure the mounting plate to the stand using M2x12mm screws. Be careful not to push out the captive nuts we put in earlier! It may help to initially thread the screws with your hands, before using a screwdriver to tighten.

You can now take a step back to marvel at your hard work (and also go back and check that all the wiring is right!).

I’ve also taken a moment to tuck the jumper wires under the Pico where I can, since the ones I have are a bit too long and I don’t want them getting in the way in the next step.


Step Seven: Cover Up


It’s finally time to put on the back cover!

Place the stand and the cover down such that the open side of the cover faces the back of the stand.

Carefully thread the wires for the OLED display through the hole in the top of the back cover. Make sure not to twist them! It’ll be much simpler to connect it up if they’re in the right orientation to begin with.

Now, carefully push the two parts together. I’ve found it helpful to have them both resting on my work surface while I do this to make sure they line up on the first try.

After making sure that no wires are in the way and that everything lines up, press the two parts together. They should “click” somewhat and mostly stay in place.


Step Eight: Secure it down

Place 2 nuts into the slots on the back cover.

Secure the back cover from the other side using M2x6mm screws. Again, it may be helpful to thread the screw with your fingers initially, using a screwdriver to tighten.


Step Nine: OLED Display


We’re nearly there! The final step in assembly is to attach the OLED display to the top of the mounting plate.

Place the display into the slot on the mounting plate such that the mounting holes line up properly. This will probably require a little force, since it is quite a snug fit, so be careful not to put any pressure on the ribbon cable or the display itself.

Once the display is pressed into place, secure it using the remaining screws and nuts. I used one finger to hold the nut in place while fastening the screw from the other side.



The final step is to connect the jumper wires to the pins on the OLED display. If you followed all of the previous steps properly, this will be super straightforward.

(Just to be thorough, the connections should be GND to GND, VDD to 3V3 Out, SCK to GP0, and SDA to GP1)


Step Ten: Enjoy!

 

The assembly is finally done, so feel free to take a break!

Not a long break though! We still have to flash the program to get this thing going.


Software Setup

Step One: Set up MicroPython


Before we can get the program running, you’ll need to make sure your Raspberry Pi Pico is running MicroPython. There are plenty of guides on how to do this, but I’ll be following this one since it covers setting up Thonny, which is good for uploading code to the Pico.


Step Two: Install Packages


In order to run the program on the Pico, you’ll need to have a few packages installed, namely “glowbit” and “micropython_ssd1306”. Technically I could just give you all of the contents to copy over to your Pico, but installing packages with Thonny is a good little exercise.

Start by connecting the Pico to your computer with a Micro-USB cable.


Open Thonny, make sure that you have selected “MicroPython (Raspberry Pi Pico)” in the bottom right corner.

Open the Thonny package manager by clicking Tools > Manage Packages…


In the window that opens, type the name of the package you’d like to install into the search bar. Start with “glowbit”

Click on the first result (the name should match identically) and click “Install”.


Repeat the process for “micropython_ssd1306”. Again, make sure the name is an exact match.

When you’re done, your list of installed packages should look like this.


Step Three: Upload the Code


Download the code from my GitHub and extract the contents of the zip file to a folder you’ll remember.

In Thonny, go to View > Files to bring up the file manager.

Using the file manager, navigate to the folder you just placed all of the code in.

Make sure that your Raspberry Pi Pico is still connected to Thonny. Right-click main.py and click “Upload to /” to put the program on to the Pico.

You can now unplug your Pico and plug it back in to restart it. Upon restarting, the OLED display should say “Connect to PC”.


Step Four: Configuring

Before we can finally get it running, I’ll quickly run over the config.json file (since the program may not work if it isn’t right).

Open config.json in your text editor of choice. It should look something like this: 

We can ignore the “Time Format” and “Date Format” keys for now (although they’re a bit of fun to customise if you’re familiar with date string formatting and want to put some funky messages on the screen).

What we’re mainly worried about is “COM Port” and “Windows Song Data”.

In Thonny, with your Raspberry Pi Pico connected, pay careful attention to the device name in the lower right corner.

That last part, where for me it says “COM5”, can be different for some people. Make sure that the “COM Port” key in your config file matches the text displayed here in Thonny exactly.

The other thing we’re concerned with is “Windows Song Data”. If you’re not on Windows, ignore this and leave it false. If you are using Windows, though, you can set this to true to make the OLED Display show the name of the currently playing song (It will show the date and time otherwise).

 

 


Step Five: Finally Getting it Running


Oh boy, we're finally here.

If you’re on Windows, this one will be super easy for you. Simply find av_windows.exe and run it. If you’ve done everything right to this point, the display will say “Connected! Play Audio to Start” and should start responding to any audio you play.

If the program says anything about “Compatibility Mode” don’t worry! Some sound cards are slightly more difficult to read audio from, but I’ve tried to compensate for this in code so the latency shouldn’t suffer by any noticeable amount. If you are noticing more than half a second of latency, try connecting Bluetooth headphones and see if that alleviates the problem.


Unfortunately for MacOS and Linux users, the process will be slightly more complicated (still pretty easy though, don’t worry).

For this, you’ll need to have Python 3.9 (with pip) installed on your computer. Unfortunately, the version bundled with Thonny won’t do, since it isn’t compatible with the audio package my program relies on.

Once you have Python 3.9 installed, use the terminal to navigate to the folder where all of the code is placed. You should be able to use pip to install all of the packages from requirements.txt. This can vary from one operating system to another, but it will likely be some variation on this:

Apps\glowbit-audio-vis>pip-install -r requirements.txt

Anyone more comfortable with Python might want to set up a Virtual Environment before doing this, to keep everything contained. RealPython has a great little guide on how to do this if you haven’t before.

After everything is installed, just run the program with this command (or its equivalent on your system).

Apps\glowbit-audio-vis>py av_main.py

If all is working properly, you should see the same “Connected!” text appear on the OLED Display.

If you get an error when running the code, make sure to close Thonny, since it may still be connected to the Pico!

Provided everything has gone smoothly, you should have your very own audio visualiser! All that’s left to do is bask in its esoteric beauty as it illuminates your desk for all of time!



Final Remarks

I made this project for a bit of fun over the course of a couple of weeks, so I’m super glad if you’ve followed it this far. It’s mostly a fun little toy/decoration, but I’m still interested to see if there are any practical use cases for a real-time visualiser. Maybe I’ll adjust it to work as an audio monitor for live streaming, we’ll just have to see.

If you have any issues, concerns, or feedback, feel free to mention me on Twitter or raise an issue on GitHub

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.