Begin by downloading the Piccolo repository from Github. Download the code from all the directories.

There will be two folders inside: “Piccolo” should be moved to your usual Arduino sketchbook folder. “ffft” should be moved into your Arduino “Libraries” folder (inside the sketchbook folder — if it’s not there, create one).

If you’re unfamiliar with installing Arduino libraries, please follow this tutorial. And never install in the Library folder adjacent to the Arduino application itself…the proper location is always a subdirectory of your home folder!

If you haven’t already installed the Adafruit LED Backpack Library (for using the LED matrix), please download and install that as well. For modern Arduino IDE versions, use the library manager.

Once the folders and libraries are situated, restart the Arduino IDE, and the “Piccolo” sketch should be available from the File->Sketchbook menu.

With the Piccolo sketch open, select your Arduino board type and serial port from the Tools menu. Then click the Upload button. After a moment, if all goes well, you’ll see the message “Done uploading.” The project should now be responsive to sound…try clapping your hands!


If there’s no response from the device, try the following:
  • Double-check all wiring against the diagrams. Did you include the 3.3V-to-AREF connection? D and C pins from the matrix backpack should connect to SDA and SCL on newer Arduinos, or analog pins 4 and 5 on older boards.
  • Test the matrix using the example code from the Adafruit LED Backpack Library. If there’s no response, the matrix may have been soldered to the board backwards.
  • The gain on the mic amplifier may be set low. There’s a dial on the back of the board that can be adjusted with a small screwdriver.

Principle of Operation

Using the normal Arduino analogRead() function would be much too slow for sampling audio. Instead, a feature of the microcontroller’s analog-to-digital converter called free-run mode is utilized. This automatically takes repeated analog samples at precise intervals…about 9.6 KHz for this project, the maximum a 16 MHz Arduino can handle with 10-bit samples.

The raw audio samples are converted into a frequency spectrum using a fast Fourier transform or FFT. There are a number of Arduino FFT libraries out there, but we keep finding ourselves returning to the venerable ELM-ChaN ffft library for its speed and good looks.

The FFT output still needs a bit of massaging to make for a good presentation on the limited 8x8 matrix. Several tables of scales and weights de-emphasize certain frequency ranges as they’re reduced to just eight columns. The software works at keeping the graph interesting, but some columns will always be less lively than others, especially comparing live speech against music of varying genres. If everything seems to stick toward one end of the graph, try another musician, musical genre, or different speakers.

This guide was first published on Nov 28, 2012. It was last updated on Nov 28, 2012.

This page (Code) was last updated on Aug 15, 2022.

Text editor powered by tinymce.