Music Spectrum and dB Visualizer

Receive input from a 3.5mm jack, divides the music into 7 frequency bands, shows the loudness of each frequency band in DB using LEDS.

Similar projects worth following
The device receives an audio signal from a 3.5mm jack (i.e. a headphone jack) that is connected to any analog sound source. The audio signal is then separated into the 7 music frequency ranges and their respective volumes' are then displayed on 10 LED's each using a logarithmic scale. The brightness of the LEDs and the maximum value of the logarithmic scale can be adjusted by the user.
*Circuits were simulated in LTspice. The schematic capture and PCB layout of the final design was done in KiCad.

Summary of Functionality:
- Can change input source to a male or female jack using a slide switch, both of which are single channel
- Can safely handle a differential input voltage signal of up to 32V
- Uses 6th order 60dB/decade active Butterworth filters to segment the signal into 7 spectrums
- Both the brightness of the LEDs and maximum scale voltage can be changed using logarithmic potentiometers
- Powered by 9V

  • This is a block diagram of how the music visualizer operates
  • The entire system is powered by 9V
    • A pmos transistor is placed between the DC power jack and the wrest of the circuit to protect it from negative voltages
    • When the device is switched on, a blue indicator LED will glow, confirming that the board is receiving power
  • The device takes in a mono-stereo audio signal from either a jack or a plug, depending on the position of the input switch, and is fed to the Filter Array
  • The Filter Array:
    • Is composed of seven 6th degree bandpass filters
      • Sub-Bass - [20Hz : 60Hz]
      • Bass - [60Hz : 250Hz]
      • Lower-Midrange - [250Hz : 500Hz]
      • Midrange - [500Hz : 2kHz]
      • Upper-Midrange - [2kHz : 4kHz]
      • Presence - [4kHz : 6kHz]
      • Brilliance - [6kHz : 20kHz]
    • Is powered by +5V and -5V
    • Can accept analog signals with a magnitude of up to 3.5V without clipping
    • Once each filter is finished processing the input analog filter, they sound their outputs to the output array
  • The Output Array:
    • Is composed of seven LED drivers, each of which have 10 LEDs that they drive logarithmically 
    • Each driver receives an input from its associated bandpass filter, based on the magnitude of the received signal, it will pass particular amount current through a certain number of LEDs 
  • Volume Scale Control:
    • An HMI interface, by turning the potentiometer, a user can change the reference voltage (from 0V to 3.5V) that the LED driver uses to decide how many LEDs should be activated
  • Brightness Control:
    • An HMI interface, by turning the potentiometer, a user can change how much current the LED drivers all to pass in the LEDs when they are activated, from 0mA to 18mA


A star is born, everything shown off

MPEG-4 Video - 14.77 MB - 11/03/2023 at 03:44



Singer her verse in closer

MPEG-4 Video - 13.58 MB - 11/03/2023 at 03:44



Sweep Entire audio band, and show LED response

MPEG-4 Video - 10.02 MB - 11/03/2023 at 03:43



The frequency response of each filter (except sub-bass), the corner frequencies, midpoint frequency, and an octave lower and higher than the corner frequencies

sheet - 14.62 kB - 11/03/2023 at 03:06



sheet - 9.16 kB - 11/03/2023 at 03:06


View all 12 files

  • Issue with Sub-Bass Filter

    Ghani Lawal11/03/2023 at 03:27 0 comments

    • Unwanted oscillations were being produced by the third stage of the sub-bass filter
    • Producing a 343Hz wave when no input was present
    • Creating a square wave, started to appear around 32Hz
    • Fully present at around 50Hz

  • How I would Improve!

    Ghani Lawal11/03/2023 at 03:20 0 comments

    • Use filters with more stages (and possibly Chebychev) so that the slope of the transition bands will be sharper
    • Append an inverting amplifier, with R2 (or R1) as a trimmer potentiometer  to the outputs of all the filters so that I can match all of their amplifications before they output signal gets to the LED drivers
      • This way I can sure all the filters have unity amplification at their midpoint frequency's
    • Add test-points
    • Prototype each filter on a breadboard, and possibly PCB beforehand
      • Seems that the issue with the sub-bass filter outputting a 343Hz signal is due to low gain margin which is exploited by the PCB
      • Should be done for all sub-circuits to be honest
    • For through hole devices, make sure there is enough room between holes for their footprints so there would be little to no chance of a short circuit between the terminals
      • had this problem with the +5V inverter

  • Complete

    Ghani Lawal11/03/2023 at 03:12 0 comments

    • Removed Driver for sub-bass filter, the rest of the filters work very well, close to the ideal response
    • Used the snipped legs of the LEDs as pins to allow oscilloscope probes to measure the outputs of the filters
    • Example shown here
    • No input:
    • Playing a song:
    • Check "Frequency Response" excel file for filter analysis

  • Wrapping up

    Ghani Lawal11/02/2023 at 03:15 0 comments

    • Replaced Sub-Bass op-amps with one from the old PCB, still getting the same problem
      • According to online, this is possibly due to the third stage circuit being unstable to to a small phase margin, causing sustained oscillations
    • Will get metrics on accuracy of each filter tomorrow, taking how much attenuation exists at the midpoint, cut-off frequencies and 10 times/divide the cutoff frequencies
    • Will make notes on how improvements can be made (steeper cut-offs, individually controllable gains etc.)

  • Debugging

    Ghani Lawal11/01/2023 at 14:40 0 comments

    • Sub-Bass filter produces a 2V 343Hz output even when there is no signal input, that is why the LEDs are always activated
    • The Midrange filter only lights up a few of the blue LEDS for the same voltage that lights up all 10 LEDs for the other filters, that means it is attenuating the signal by at least 18dB, or at least 85%

  • Completed!!!

    Ghani Lawal10/28/2023 at 03:42 0 comments

    • Soldered remaining LED
    • Inserted remaining LED drivers
    • Both Jack and plug sources work
    • LED brightness control and Volume range control work
    • LEDs are responsive to inputs
    • Will provide more detailed analysis and improvements that can be made

  • Solder Update

    Ghani Lawal10/28/2023 at 03:38 0 comments

    • De-soldered +5V regulator with some difficulty
    • Soldered a new one, output was still ~1.0V
    • ***Found out there the +5V power and -5V power lines were shorted together
      • Location of the short circuit was at U18, the high precision op-amp in the Rhi-Control circuit that is being used as a voltage follower, removed it from the PCB, -5V regulator output is now -4.9V
      • Even when disconnected from external circuitry, the op amp power terminals are still shorted together
    • Soldered a new 5V regulator, now both +5V and -5V are delivered to the op amps
    • Took U18 from old PCB and soldered it onto the new one, ensured the power terminals were not shorted together
    • When I turned the device on, the power terminals of U18 shorted again...
    • Took it off the board
      • ****** I removed both + and - 5V regulators earlier because they were overheating due to the short, and I assumed they were broken, turns out they have internal circuitry that protects them from damage due to shorts... Which I knew that earlier, should have read the data sheets
    • I have spare 2N2222 NPN transistors, made a voltage follower (CE) circuit out of it
      • Diode doesn't "turn on" until Vi is >= 0.658V (as modelled in LTspice), therefore max voltage sent to Rhi terminals is 2.842, didn't need the full 3.5V range anyway
    • The base is connected to pin2 (the output) of the potentiometer, the collector is connected to 3.5V and the Emitter is connected to the the Rhi pins of the LED drivers, which collectively have an equivalent resistance of 2.5kohms
    • Soldered the voltage range and LED brightness potentiometers to the board, the Voltage range pot is working properly
    • Soldered LED driver holders to the breadboards, then inserted the drivers as well
    • Soldered the plug source terminal, Dot/Bar header pins and source switch
    • Soldered Sub-Bass LEDs

  • Solder Update

    Ghani Lawal10/18/2023 at 00:16 0 comments

    • Soldered all of the SMD resistors and capacitors
    • Soldered to LDO (U17)
    • Soldered the solo op-amp IC (U18) - this gave me trouble even with reflow soldering, nearly ripped off a pad
    • Soldered all of the power circuitry, -5V inverter regulator (U8) the 5V regulator (U9)
      • U9 footprint has terminals REALLY close together
      • The rocker switch isn't completely flush on the PCB
      • Noticed in the schematic that I had the polarized 1uF cap (C55) oriented the wrong way, will correct this
    • ISSUES:
      • When I powered the circuit on and flipped the switch, I wasn't getting 9Vfrom the drain of the pnp mosfet
      • I thought that maybe the reverse voltage polarity circuit (the mosfet  being between the power source and the circuit) just wasn't working for whatever reason (this was a dumb thought-process) I bypassed it and removed the mosfet
      • After I bypassed it I measured the output of the -5V inverter and regulator and 5V regulator, I was only getting about +1.1V, turns out the terminals for the 9V and ground of the -5V reg and inverter were short circuited, and both IC's were getting really hot
      • I removed the -5V reg and inv, going the remove the 5V regulator since it is obviously broken as well
    • Going to check for any more shorts in the circuit
    • Need to by proper wire cutters

  • Decided to Move Forward with Unbuffered PCB

    Ghani Lawal10/02/2023 at 21:11 0 comments

    • The PCB has in input resistance of [19.4kohm : 6.0kohm] and an input capacitive reactance of [4.2kohm : 499] over the audio range of 20 to 20kHZ
      • At DC, the input resistance is about 21kohm
      • The equivalent capacitance is [2.11uF : 6.17nF]
    • No issues with drawing too much current:
      • The audio jack was measured to have an output impedance of about 73 ohms << than the PCB input impedance
        • In worst case scenario, over 98% of vsig will still be maintained
      • Also, the headphones I have been used mere measured to have 0 ohms (resistance) headphones typically no more than 600 ohms
    • No issue with signal reflections
      • One only needs to worry with transmission line effects if the distance the signal will propagate is comparable to the wavelength, using c = 3x10^8, the wavelength of 20khz is 15km
      • Distance from audio output to furthest frequency filter = 26cm (cable) + 30cm (width of pcb) + 10cm (account not taking straightest path) = 66 cm
    • Negative instantaneous power i.e. power being delivered from PCB to the audio jack to to phase shift between 
      • Worst case scenario, it will deliver under 100 uW to the audio jack, should be fine
    • Source - ChatGPT
      • In typical audio systems and applications, an audio source is not at risk of being damaged solely because it delivers a current out of phase with its voltage. In fact, phase shifts between voltage and current are quite common in audio circuits due to the presence of reactive components like capacitors and inductors in speakers and crossovers
      • Audio signals fall within the human audible range, typically from 20 Hz to 20 kHz. At these frequencies, the phase shifts introduced by typical audio components are small and generally do not result in damaging conditions
      • Audio sources, such as amplifiers, are designed to handle a range of loads, including those with phase shifts. They are typically equipped with protection circuits to prevent overcurrent and overheating, which are more common causes of damage
      • In many audio applications, phase shifts of less than 30 degrees are often negligible. These small phase shifts usually do not noticeably affect sound quality or system behavior.
      • Many audio devices incorporate protection circuits that prevent overcurrent or overvoltage conditions that could potentially damage the equipment. These circuits can handle variations in power flow due to phase shifts

    • Buffered Filter Test

      Ghani Lawal09/14/2023 at 03:07 0 comments

      • Made version of each spectrum filter prepended with a voltage follower (buffer), then made a file with buffed filters connected to the same signal, another with all the non-buffed filters connected to the same signal, and finally one with both versions connected to equivalent signals
      • Then I compared their input impedances (measured between Vsig and ground)
        • The one with input buffers (green) had an input impedance of [28Mohms : 1.213Gohms]
        • The one with no input buffers (red) had an input impedance of [6kohms : 20 kohms ]
          • This was measured over the audio range - 20Hz : 20kHz
      • Compared the difference of the outputs of each spectrum filter
      • The differences grew from ~40uV (Sub-bass filter) to ~7.4mV (Presence filter), this is way less than I expected

    View all 60 project logs

    Enjoy this project?



    Ghani Lawal wrote 08/02/2023 at 01:02 point

    ahahah yeah I underestimated how hard they would be to solder

      Are you sure? yes | no

    qtron wrote 04/17/2023 at 18:31 point

    0201's ??? why? not as tho the pcb is tiny!!

    0603's are bad enuf!

      Are you sure? yes | no

    Similar Projects

    Does this project spark your interest?

    Become a member to follow this project and never miss any updates