After two weeks, our music spectrum has been finished. This is how it looks, the major portion is a large RGB LED panel.

Now let us share the whole working process of the music spectrum and also provide the complete circuit and PCB for the DIY LED Music Spectrum.

Typical materials:

  1. Flexible 16×16 RGB LED Matrix(WS2812B).
  2. Core Board, DIY by EasyEDA.
  3. Switching power supply, 5V 40A.
  4. Audio Line*1, 1 min 2 audio interface*1, Speakers*1.

parts for music spectrum

How to make a LED Music Spectrum
Step 1) LED Connection      
Connect two 16*16 matrix to form a 16*32 LED matrix.
How to connect: Connect the DOU interface of the first LED matrix into the DIN interface of the second one

Step 2) Power Connection
The operating voltage of my LED is 5 V, so I would like to connect two LED power interfaces into an outlet of a 5V control power.  Please take a note that the each LED panel require 18A current, so it is recommended to use an over 40 A control power and choose a thick enough wire to connect it.
Description: C:\Users\acer-pc\Documents\Tencent Files\513789261\FileRecv\MobileFile\IMG_0150.JPG
(As the illustration above shown,  the LED power interface is connected to a control power. Actually, the wire used is very thick)

Step 3) Making control panel
A control panel is to receive audio signals which are processed by FFT(Fast Fourier transform) and then transported to be shown by LED matrix display.
The controlled LED is a dot-matrix programmed by WS2812b, whose controlling signal frequency is 800KHZ. And the timing-controlling diagram is shown as below,

Each LED is controlled by 24-bit data with its structure of G7~G0+R7~R0+B7~B0. The data are sent by the principle of higher place first and in accordance with the sequence of GRB.
Constructed by LM358 using an analog circuit,  an amplified circuit is displayed by the diagram below.

In the diagram, IN_CH is an audio access terminal of a computer. PC 3 is a signal output end amplified and then sent to STM32 analog signal.
C 13, R6 and R7 are grouped into a signal-strengthening circuit, which can raise the signal voltage and turn a negative voltage into a positive one.
The circuit following R8 is signal-amplifying one, with its signal strength of PC 3 equal to as R9/R8 times as the previous signal before R8. IN 1+ is the end to set the minimum voltage value output from OUT 1.

Here we recommend using EasyEDA to design a control panel. EasyEDA is a simple and efficient online EDA designing software, by which you can draw a diagram or cut a pattern conveniently.

In EasyEDA, the database for the components is huge! You can easily select some of the basic components on the left of the page or search hundreds and thousands of components in their library so it is very easy for you to find what you needed.

The following link is my competed circuit diagram and PCB, where you can see it very clearly.
You can also register an account there so as to download my diagram directly into your account.
Description: IMG_256

Below is a screenshot of PCB layout from EasyEDA
Description: pcblayout


Prototype PCB:
After finish designing PCB and clicking on the icon of Fabrication output above, you will come to the “PCB order ”page. Here you can select the number of PCBs you want to order, how many copper layers you need, the PCB thickness, copper weight, and even the PCB color. After you have selected all of the options, click “Save to Cart” and complete your order, to receive your PCBs within few days.

Here are the boards after manufacturing, the quality of PCBs is quite impressive. The traces are routed precisely and all of the printing is very clear.
Description: C:\Users\acer-pc\Documents\Tencent Files\513789261\FileRecv\MobileFile\IMG_0123.JPG

After components are welded the way the following screenshot is shown, a control panel is completed. It’s very simple.
(A blank board and components are grouped plus a down arrow, see below)


Step 3)
Connect the computer audio cable into the audio interface of control board and play some music on computer. Chances are that you may not hear any sound of the computer music after inserting the audio line. Under such circumstance, we can use a 1-turn-two connector to transform the computer audio output into two channels output. One channel is connected to the core-board while the other to a speaker.

Description: C:\Users\acer-pc\Documents\Tencent Files\513789261\FileRecv\MobileFile\E0E84AE45864094F7AF8887004CF9807.png
This is a connecting diagram of the system, where a core-board is powered by a computer USB and connected by an audio output interface. The other interface of the computer audio output is connected to an external speaker.

Step 4) Download the program
After writing a program and downloading it into the core-board, you can see the colorful music spectrum.


So here we have built the LED music spectrum, hope you like it and you can also write other program to make the music spectrum more splendid.

JLCPCB Prototype: $2 for 10 pcs PCBs, 48 Hours Quick Turn

China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day

Get quote online easily: quote

Facing problem with your embedded, electronics or robotics project? We are here to help!
Post a help request.


Avinash Gupta is solely focused on free and high quality tutorial to make learning embedded system fun !

More Posts - Website

Follow Me:
FacebookLinkedInGoogle Plus

xBoard MINI v2.0

3 thoughts on “DIY RGB LED SPECTRUM ANALYSER using STM32

  • By KAMAL GANGWAR - Reply

    Good Job Avinash these days I too working on STM32

  • By Daniel - Reply

    Is it possible to get the code? I want to build a similar device, but with an STM32F4 and a DIY matrix display. It’s for a student project at the University.

    • By Daniel - Reply

      I have found it on instructables. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

3 + three =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>