Introduction: 20 Band LED Spectrum Analyzer
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:
Step 1: Circuit Design and PCB Layout
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.
Step 2: Stainless Steel Stencil for Applying Solder Paste
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.
Step 3: Installation of Radio Components on the Control PCB
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.
Step 4: Installation of Radio Components on the PCBs for WS2812B LEDs
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.
Step 5: Downloading the STM32 ST-LINK Utility
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.
Step 6: Description of ST-LINK/V2 Programmer
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.
Step 7: Connecting the Programmer
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.
Step 8: Microcontroller Programming
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.
Step 9: 3D Visualization
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.
Step 10: Installation of PCB With LEDs on the Middle Panel
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.
Step 11: Installation of 36 Plastic Poles on the Middle Panel
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.
Step 12: Installation of Plastic Poles on the Front Ribs.
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.
Step 13: Installation of the Front Vertical Stiffener Ribs on the Middle Panel
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.
Step 14: Installation of the Front Panel and Light Diffuser
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.
Step 15: Installation of the Back Stiffener Ribs
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.
Step 16: Installation of the Power Supply Inside the Device Case
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.
Step 17: Installation of the Control PCB and Power Input
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.
Step 18: Installation of the Horizontal Side and Facing Horizontal Panels
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.
Step 19: Wire Preparation
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.
Step 20: Installing Wires Inside the Case
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.
Step 21: Installation of the Vertical Side and Facing Vertical Panels
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.
Step 22: Installation of the Facing Corners
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.
Step 23: Installation of the Back Panel
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.
Step 24: Description of the Buttons and Remote Controller
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.
Step 25: Work Result
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