20 Band LED Spectrum Analyzer

by Hobby Home Electronics in Circuits > LEDs

9352 Views, 114 Favorites, 0 Comments

20 Band LED Spectrum Analyzer

Превью_20_полосный_светодиодный_анализатор_спектра_2.jpg
20 полосный светодиодный анализатор спектра (ENG Sub)

Good afternoon, dear viewers and readers! In today’s article I’ll show you a complete assembly manual for 20-band LED spectrum analyzer based on STM32 microcontroller and WS2812B addressable LEDs.

Supplies

Please support me on Patreon to create a new projects.

You can find all the necessary information for repeating this device by clicking on the link to Patreon:

Link to this video:

Links to radio components and tools:                                             

Radio parts store:

Microchip STM32F407VET6:

Microchip MAX9814:

Microphone amplifier MAX9814:

Microchip LM358:

Linear voltage regulator LM1117 3,3V:

Infrared sensor TSOP38238:

Addressable LED,s WS2812:

Black flexible PCB for WS2812B:

White flexible PCB for WS2812B:

Piezo BUZZER:

Electret microphone:

Tactile Switches:

Vertical audio input 3,5mm:

Connectors KF2510:

Power input 220V:

Power cable 220 V:

Power supply 5 V 80 А:

Remote control:

Programmer ST-LINK/V2

Cable ties:

Wires with a cross section of 2.5 mm:

3 pin wire:

Set of connectors for electrical wires:

Ring lugs for electrical wires:

Heat shrink tubing for wires:

Nylon braid for wires:

Plastic mounting posts M/M:

Plastic mounting posts M/F:

Brass mounting posts:

Round head screws M3:

Nutts M3:

Soldering Station NEWACALOX 8786D:

Wire stripper:

Crimper for crimping terminals on wires:

Wire cutters:

Screwdriwer set:

Circuit Design and PCB Layout

Snapshot_1.png
Snapshot_2.png
Snapshot_3.png
Snapshot_4.png
Snapshot_5.png
Snapshot_6.png
Snapshot_7.png
Snapshot_8.png
Snapshot_9.png

The schematic diagram and printed circuit boards (PCBs) of the 20-band LED spectrum analyzer were designed in the Easy EDA online environment.

On the schematic diagram of the spectrum analyzer, there are such nodes as: the STM32F407VET6 command microcontroller, a microphone amplifier on the MAX9814 circuit, an amplifier on the LM358 circuit, linear voltage regulator on the LM1117 circuit, a Piezo buzzer, an infrared receiver and control buttons.

Based on the schematic diagram, it was obtained a double-sided control PCB with SMD components located on it for surface mounting.

Before converting Gerber files, you can preview the 3D model of the future control PCB.

To form a matrix with twenty rows and twenty columns, there were designed PCBs for WS2812 LEDs. There are five segments on each individual PCB, all of which will have three LEDs.

Of course, to create a spectrum analyzer, you can use a factory-made LED strip, thereby saving time and money, but I decided to complicate my task and went the other way.

To use fewer wire connections, there have been designed PCBs for correct direction and connection of signal, logic and power bus lines.

After that, we create Gerber files and upload them to the website of the JLCPCB printed circuit board manufacturer.

Stainless Steel Stencil for Applying Solder Paste

Snapshot_10.png
Snapshot_11.png
Snapshot_12.png
Snapshot_13.png
Snapshot_14.png
Snapshot_15.png

After the PCBs have been manufactured at the JLCPCB factory and delivered at the address, they can be inspected from all sides, and you can make certain of good workmanship with well-applied masking and silk-screening.

Additionally, in set with PCBs, there were ordered stainless steel stencils to facilitate the installation of SMD components and strictly dosed application of solder paste.

Next, we put a stencil on the control PCB and position the holes in accordance with the location of the SMD components bond pads.

Then, we apply solder paste to the stencil and accurately fill in holes with a small spatula, leaving a good uniform layer on the bond pads for soldering all components of surface mounting.

Installation of Radio Components on the Control PCB

Snapshot_16.png
Snapshot_17.png
Snapshot_18.png
Snapshot_19.png
Snapshot_20.png
Snapshot_21.png

Further, we proceed to installation of the PCB of 20-band LED spectrum analyzer.

For pre-correct positioning of the surface mounting components, we will use tweezers, and for soldering, we will use a soldering station with thermo-air drier.

After work that has been competed, we additionally look the control PCB again to identify and eliminate minor defects after soldering.

Installation of Radio Components on the PCBs for WS2812B LEDs

Snapshot_22.png
Snapshot_23.png
Snapshot_24.png
Snapshot_25.png
Snapshot_26.png
Snapshot_27.png
Snapshot_28.png
Snapshot_29.png

Next, we proceed to the installation of the PCBs for WS2812B LEDs.

We follow the same process of positioning the stencil and applying solder paste to the PCBs for the LEDs as we did it in case of control PCB.

To form the matrix of a 20-band spectrum analyzer, we need 1200 LEDs mounted on eighty PCBs.

We visually check PCBs for identifying and elimination minor defects after soldering, as well as for the correct LEDs installation.

Downloading the STM32 ST-LINK Utility

Snapshot_30.png
Snapshot_31.png
Snapshot_32.png
Snapshot_33.png
Snapshot_34.png

Next, let’s move to the software part of the 20-band LED spectrum analyzer.

Before programming the microcontroller on the control PCB, we need to download and install the STM32 ST-LINK Utility program.

By clicking the link, we go to the official website of STMicroelectronics, scrolling through the page, go down and click on the tab with the latest version of the program. Further, it will appear a page with rules and license agreement. After reading the rules and license agreement, click on agree tab, then it will appear a window where you will need to fill out a short questionnaire, providing your data and email, after which you will have access to download the ST_LINK Utility.

Description of ST-LINK/V2 Programmer

Snapshot_35.png
Snapshot_36.png

To download the program code to the microcontroller, I will use the ST-LINK/V2 programmer.

ST-LINL/V2 is an in-circuit programmer and debugger for STM8 and STM32 microcontrollers, which is an inexpensive analogue of the original STLINK programmer of STM company.

With ST-LINK/V2, you can program and debug using SWIM (for STM8 microcontrollers), SWD and JTAG (for STM32 microcontrollers) interfaces. All communication interfaces (SWIM, SWD, JTAG) are available for use and connected to the programmer 10-pin connector.

Also on the official website of STMicroelectronics for the ST-LINK/V2 programmer, you need to download and install a specific version of the driver, depending on the used computer operating system.

Connecting the Programmer

Snapshot_37.png
Snapshot_38.png
Snapshot_39.png

Next, we connect the programmer and the 4-pin connector with wires connected to the microcontroller on the control PCB, and connect the programmer to the computer USB-port.

After connecting, on the control PCB, the green LED will light up to indicate the running status.

Microcontroller Programming

Snapshot_41.png
Snapshot_43.png
Snapshot_44.png
Snapshot_45.png
Snapshot_46.png
Snapshot_47.png
Snapshot_48.png

Further, we proceed to the microcontroller firmware.

In the STM32 ST-LINK Utility bootloader, click on the Target tab, then in the window that opens, click on the Connect tab. After that, click on Target tab again and select the Programs and Verify tabs, after which it will open a window in which you need to specify the location of the folder with the microcontroller firmware. Then click on the Start tab.

The second illuminated green LED on the control PCB indicates the programmed microcontroller status.

To disconnect the microcontroller from the programmer, in the STM32 ST-LINK Utility, click on the Target tab and in the window that opens click on the Disconnect tab.

3D Visualization

Snapshot_49.png
Snapshot_50.png
Snapshot_51.png

To create 3D visualizations and drawings of the case of a 20-band LED spectrum analyzer, it was used the KOMPAS 3D software. The device case parts will be made of 4 mm plywood designed for laser cutting. All drawing files were converted to DXF format and handed over to a company engaged in cutting sheet wood.


Installation of PCB With LEDs on the Middle Panel

Snapshot_52.png
Snapshot_53.png
Snapshot_54.png
Snapshot_55.png
Snapshot_56.png
Snapshot_57.png
Snapshot_58.png
Snapshot_59.png
Snapshot_60.png
Snapshot_61.png

Next, we proceed to the assembly of the case of the 20-band LED spectrum analyzer.

Case assembly begins with the installation of PCB with LEDs on the middle panel.

We align the holes located on the PCBs with the holes on the middle panel, after which we insert M3 screws 8 mm long and fix them with M3 nuts on the back side of the middle panel.

At each edge of the middle panel, we install PCBs with pointers in the form of arrows. These pointers help you determine the direction of the logic bus line, and also help you correctly connect PCBs with LEDs to each other.

After that we proceed to the connection of PCBs with LEDs to each other. For this, there are provided soldering pads with dimensions of 2 by 2 mm at the joints.

Installation of 36 Plastic Poles on the Middle Panel

Snapshot_62.png
Snapshot_63.png
Snapshot_64.png
Snapshot_65.png
Snapshot_66.png
Snapshot_67.png

Next, install 36 plastic poles 20 mm long with M3 internal thread on the middle panel and fix them with M3 screws 10 mm long on the back.

Installation of Plastic Poles on the Front Ribs.

Snapshot_68.png
Snapshot_69.png
Snapshot_70.png
Snapshot_71.png
Snapshot_72.png
Snapshot_73.png
Snapshot_74.png

Further, we proceed to the installation of plastic poles 30 mm long with M3 internal thread on the front horizontal and vertical stiffener ribs. Plastic poles are attached to the ribs with M3 screws 10 mm long.

Installation of the Front Vertical Stiffener Ribs on the Middle Panel

Snapshot_75.png
Snapshot_76.png
Snapshot_77.png
Snapshot_78.png
Snapshot_79.png
Snapshot_80.png
Snapshot_81.png

Next, we install front vertical stiffener ribs on the middle panel, on the top of which we insert short horizontal ribs into rectangular grooves.

We install long front horizontal stiffener ribs in the remaining free rectangular grooves on the vertical ribs.

After mounting the front stiffener ribs, it is obtained a frame with four hundred individual cells.

Installation of the Front Panel and Light Diffuser

Snapshot_82.png
Snapshot_83.png
Snapshot_84.png
Snapshot_85.png
Snapshot_86.png

Above the front stiffener ribs, we install a light diffuser made of white matte plastic 1 mm thick.

Then, on top, we install the front panel of the case, positioning the holes through which we insert M3 screws 10 mm long, screwing them into the already installed plastic poles on the middle panel.

Installation of the Back Stiffener Ribs

Snapshot_87.png
Snapshot_88.png
Snapshot_89.png
Snapshot_90.png
Snapshot_91.png
Snapshot_92.png
Snapshot_93.png
Snapshot_94.png
Snapshot_95.png
Snapshot_96.png
Snapshot_97.png
Snapshot_98.png
Snapshot_99.png

Further, we proceed to the installation of the back stiffener ribs.

We do the same process as in the case of front stiffener ribs: we install plastic poles 30 mm long on the back horizontal and vertical stiffener ribs.

Then, into the rectangular holes on the back horizontal ribs, we insert supporting stiffener ribs with holes designed to suspend and hold the entire case weight during operation.

We fix supporting ribs with M3 screws 12 mm long and M3 nuts inserted into rectangular holes.

We also install stiffener ribs designed to hold the power supply, fixing them in the same way as the supporting stiffener ribs.

Then, we insert the back vertical ribs into rectangular grooves on the back horizontal ribs.

On the back vertical ribs, there are provided rectangular holes where M3 nuts are inserted, with which the back case panel will be fixed.

Installation of the Power Supply Inside the Device Case

Snapshot_100.png
Snapshot_101.png
Snapshot_102.png
Snapshot_103.png
Snapshot_104.png

To mount the power supply inside the device case, we will use brass poles 4 mm long with M3 external and internal threads.

Then we install the power supply on the stiffener ribs untended for it, after which we fix it with M3 screws 5 mm long.

Installation of the Control PCB and Power Input

Snapshot_105.png
Snapshot_106.png
Snapshot_107.png
Snapshot_108.png
Snapshot_109.png
Snapshot_110.png
Snapshot_111.png
Snapshot_112.png
Snapshot_113.png

We install plastic poles 8 mm long with M3 internal thread on the control PCB.

After that, on the horizontal side panel, on top, we put a facing horizontal panel. On the side that will be inside the device case, we install the control PCB and fix it from the back side with M3 screws 10 mm long. Then we insert the power input with the power button into a large rectangular hole, also fixing all with M3 screws 10 mm long and M3 nuts.

Installation of the Horizontal Side and Facing Horizontal Panels

Snapshot_114.png
Snapshot_115.png
Snapshot_116.png
Snapshot_117.png

Next, we proceed to the installation of the horizontal side and facing horizontal panels.

First, we install a horizontal side panel, into each rectangular hole of which we insert all the protrusions of the front and back stiffener ribs, as well as of the middle panel, thereby stiffening the device case.

Above the horizontal side panel, we install a facing horizontal panel, positioning the holes through which we insert M3 screw 12 mm long, screwing then into the already installed plastic poles on the stiffener ribs, thereby finally fixing two panels and stiffener ribs between them.

Wire Preparation

Snapshot_118.png
Snapshot_119.png
Snapshot_120.png
Snapshot_121.png
Snapshot_122.png
Snapshot_123.png
Snapshot_124.png
Snapshot_125.png
Snapshot_126.png
Snapshot_127.png
Snapshot_128.png
Snapshot_129.png

Next, we prepare the wires for further connecting the power supply to the LED matrix and control board.

For the power supply and LED matrix of the spectrum analyzer, wires with a cross section of 2,5 mm will be used.

With a knife or a stripper, we remove all excess insulation and, using a crimper, we install terminals on the copper wire conductors, which we insulate with a heat shrink tube to avoid a short circuit.

Then we put on a nylon-weave cover to combine the wires into one common bundle, as well as to protect against friction and mechanical damage.

We repeat the same process for all other wires.

Installing Wires Inside the Case

Snapshot_130.png
Snapshot_131.png
Snapshot_132.png
Snapshot_133.png
Snapshot_134.png
Snapshot_135.png
Snapshot_136.png
Snapshot_137.png
Snapshot_138.png

We install the prepared wires inside the device case.

Then we connect the wire terminals to the DC voltage bus line of the power supply and fix it with M4 screws.

After that, we connect one side of the power wires to the AC voltage bus line, and connect the other side to the power input terminals, fixing all with M4 screws.

Next, it is need to blanch the ends on the power wires intended for the LED matrix.

In order to be able to solder the power wires to the LED matrix, you need to remove the front panel and light diffuser.

After the soldering of the power wires is completed, we install the front panel and the light diffuser back.

Installation of the Vertical Side and Facing Vertical Panels

Snapshot_139.png
Snapshot_140.png
Snapshot_141.png
Snapshot_142.png
Snapshot_143.png

Next, we proceed to the installation of the vertical side and facing vertical panels.

First, we install vertical side panel on the protrusions of the stiffener ribs and the middle panel, then we install the facing vertical panel and fix all with M3 screws 12 mm long.

Installation of the Facing Corners

Snapshot_144.png
Snapshot_145.png
Snapshot_146.png
Snapshot_147.png
Snapshot_148.png
Snapshot_149.png

Along the edges of the device case, we install facing corners, fixing all with M3 screws 12 mm long.

The facing corners were made with a special flexible cut in order to be able to bend them round a radius of the front and back panels.

Installation of the Back Panel

Snapshot_159.jpg
Snapshot_160.jpg
Snapshot_150.png
Snapshot_151.png
Snapshot_152.png
Snapshot_153.png

We complete the installation of the case by installing the back panel.

We insert M3 screws 14 mm long through the holes and tighten them into M3 nuts mounted on the back stiffener ribs.

There are also ventilation holes on the back panel for power supply cooling.

Description of the Buttons and Remote Controller

Snapshot_155.png
Snapshot_154.png
Snapshot_156.png
Snapshot_157.png
Snapshot_158.png

Next, we proceed to the description of the buttons on the device case and to the description of the remote controller.

The rightmost button on the device case, it is the top red button on the remote controller, designed to turn the device on and off, and also to exit from the subroutine menu, to change the modes of the incoming sound signal and brightness modes.

The middle button on the device case and on the remote controller is designed to change 12 operation modes of the 20-band LED spectrum analyzer, and also using this button you can change the modes of the incoming sound signal, from the microphone or from the line input. In order to get into this subroutine, you need to hold the button for a long press for about one second.

The leftmost button on the device case and the bottom button on the remote controller are designed to change 12 color modes. This button also controls the brightness of the entire screen of the 20-band LED spectrum analyzer. In order to get into this subroutine, you need to hold the button for a long press for about one second.

Also on the device case, not far from the buttons, there is a line input and a microphone with a Piezo buzzer.

Work Result

IMG_7815.JPG
IMG_8693.JPG
IMG_7888.JPG
IMG_7938.JPG
IMG_7956.JPG
IMG_7964.JPG
IMG_7967.JPG
IMG_8054.JPG
IMG_8070.JPG
IMG_8157.JPG
IMG_8158.JPG
IMG_8210.JPG
IMG_8239.JPG
IMG_8246.JPG
IMG_8455.JPG
IMG_8469.JPG

After mounting the case, we proceed to a demonstration of the operation of 20-band LED spectrum analyzer.

The operation of a 20-band LED spectrum analyzer is best observed personally and in a darkened room, since it is not possible to fully convey the whole of color saturation through the camera lens.

Thank you all for watching the video and reading the article. Don’t forget to like it and subscribe to the “Hobby Home Electronics” channel. Share it with friends. Further there will be even more interesting articles and videos