Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LED Audio Spectrum Analyzer

Status
Not open for further replies.

ciruit

New Member
Hello guys I'm trying to replicate this project https://makezine.com/projects/audio-spectrum-analyzer/ since I have quite a few LM324 laying around gathering dust. I've trying simulating it first via multisim before actually building and I keep getting an error. This is how one of the bandpass filters look like 20-250hz
 

Attachments

  • BP1.PNG
    BP1.PNG
    42.9 KB · Views: 367
Attached is a IC that has 7 audio filters and does much of the work. Just a thought.
 

Attachments

  • MSGEQ7.pdf
    145.5 KB · Views: 253
Attached is a IC that has 7 audio filters and does much of the work. Just a thought.
thanks but I do not have that IC and I'd rather just use what I have available. I got two LM3916's which im thinking of adding later if the schematic with the lm324n works.
 
What you have in post #1 is linear. About 0.6 volts / LED. That is fine for measuring voltage. For audio we normally use a log meter. (3bd/LED)
This IC is what your are building. (I know you don't have the part but...) The LM3914 is linear and the LM3015 in audio log. The data sheet is a good read and you might see some ideas there.
upload_2018-4-19_17-4-19.png
 
As above, there are two basic options for the display response, linear and logarithmic. A log display looks better, but you need many more resistor values. Separate from that is the front end.

If you search for 'color organ project' or 'color organ schematic', you will find many examples of how to separate an audio input into three frequency bands. The better systems use multi-pole active filters. Since you have lotsa 324's, use them. There are many active filter calculator websites to make things less painful, but with one circuit parameter change the math becomes very simple.

Start with a basic 2-pole Butterworth lowpass filter. My favorite is a variation of the Sallen-Key topology that has a gain of 2. This is the change from the traditional S-K filter with a gain of 1. At a gain of 2, all of the R's and C's that set the filter's corner frequency are equal-value, making the circuit fairly easy to configure for your application. The passband gain is not perfectly flat; it peaks a bit at the corner frequency. Since this is not a critical listening application, I think that is a reasonable tradeoff for overall circuit simplicity. Next, a highpass version of the same circuit. One lowpass creates the bass range; one highpass followed by one lowpass sets the midrange; one highpass sets the treble range. The midrange will have a through gain of 4 rather than 2, but that is easy enough to attenuate before the output sections.

Toward the middle of the page, example #2:
**broken link removed**

Mouser has low cost 1% tolerance film capacitors that are excellent for this circuit.

ak
 
The article shows an LM386 power amplifier with lots of gain but it has an attenuator at its input. Why?
The filters are passive and since opamps are used they should be active.
It is too bad that the LM3915 logarithmic display driver IC is obsolete.
I have no clue where that EQ IC in post #2 is sold, Digikey has never had it.
 
SO i decided to build it from scratch with my LM3916 as the display to make it easier, Multisim doesn't have the lm3916 in its library's and I wasnt able to find out how to add it. In any case how does this look?
 

Attachments

  • audio1.jpg
    audio1.jpg
    467.6 KB · Views: 244
Your opamp probably will not work because it is not powered and is not biased.
You did not read the datasheet for the LM3916 to see that its LED outputs have regulated current so the 500 ohm resistor is not needed, 500 ohms is much too high anyway. But I cannot read your writing for the resistors in series from pin 7 to ground, their total value sets the LED current.

You have a huge expensive 0.68uF capacitor and a 1k resistor on the input when you could use a small less expensive 0.068uF (68nF) capacitor and a 10k resistor, or a very small 6.8nF capacitor and a 100k resistor. They cut frequencies gradually below 235Hz, no bass. Then the opamp feeds a 1k resistor that overloads it and a 0.039uf capacitor that cut frequencies gradually above 4100Hz, no highs.

The rectifier is passive and does nothing at low levels, the datasheet shows active rectifiers using an opamp so they rectify all levels.
Since you did not read the datasheet then the LM3916 might melt when many LEDs are turned on and are bright because the 12V supply voltage is much too high.

Your calculations show a passive gradual highpass and a passive gradual lowpass that together make a very poor bandpass filter. You should make an active filter in an opamp bandpass filter circuit.
Your calculations show a huge expensive 0.51uF capacitor and a 100k resistor but your schematic shows 0.051uF, which is it?
 
Your opamp probably will not work because it is not powered and is not biased.
You did not read the datasheet for the LM3916 to see that its LED outputs have regulated current so the 500 ohm resistor is not needed, 500 ohms is much too high anyway. But I cannot read your writing for the resistors in series from pin 7 to ground, their total value sets the LED current.

You have a huge expensive 0.68uF capacitor and a 1k resistor on the input when you could use a small less expensive 0.068uF (68nF) capacitor and a 10k resistor, or a very small 6.8nF capacitor and a 100k resistor. They cut frequencies gradually below 235Hz, no bass. Then the opamp feeds a 1k resistor that overloads it and a 0.039uf capacitor that cut frequencies gradually above 4100Hz, no highs.

The rectifier is passive and does nothing at low levels, the datasheet shows active rectifiers using an opamp so they rectify all levels.
Since you did not read the datasheet then the LM3916 might melt when many LEDs are turned on and are bright because the 12V supply voltage is much too high.

Your calculations show a passive gradual highpass and a passive gradual lowpass that together make a very poor bandpass filter. You should make an active filter in an opamp bandpass filter circuit.
Your calculations show a huge expensive 0.51uF capacitor and a 100k resistor but your schematic shows 0.051uF, which is it?
Ah alright I thought I need the 500 ohm resistors as a dropping resistor. Anyways the LM3916 part pf my schematic is exactly the same as the one show in the data sheet except I connected pin 3 with pin 9. I'll modify my resistors/capicitor values to use more cheaper parts, as for the rectifiers- i need to read up more on that as i'm current not sure of what their purpose is for this project. I'm a bit confused and what you mean by making an "active filter in the opamp bandpass filter circuit". Is my bandpass filter not an active filter already? Or do you mean to make an active lowpass filter and connecting that to an active highpass filter? Its a 0.51uF capicitor, on my design I added an extra 0 by accident and tried to cross it out.
 

Attachments

  • lm3916.PNG
    lm3916.PNG
    80.8 KB · Views: 238
Audio is AC that alternates positive and negative over and over. But the LM3916 is active only for the positive parts of the input signal so the LEDs would be turned off for each half-wave of the input signal and at low frequencies they would flicker and at higher frequencies the LEDs would appear dimmed because they are turned on only half the total time.

The rectifier passes only the positive parts of the signal and its filter capacitor holds the peak voltage long enough for our vision to see its brightness and to avoid flickering on and off. But the diode needs about 0.65V for it to work which is near the signal level required to light the lowest LEDs of the LM3916 so they might not light with low levels. An active rectifier using an opamp is shown in the datasheet and it rectifies very low levels perfectly.

Your "filter" is a simple passive RC highpass filter amplified by an opamp and it feeds a simple passive RC lowpass filter. It is not an active bandpass filter. It is very simple so its slopes are gradual and not sharp. Its highpass and lowpass cross and reduce frequencies that both are reducing. An active bandpass filter has the RC parts inside its negative feedback loop and some active filters even use positive feedback to make sharp slopes or a narrow bandpass. active filters can use multiple RC networks and they have "orders":
With one RC it is a first order very gradual sloped first order filter.
With two RCs it is a second order filter that has sharper slopes.
With three RCs it is a third order filter etc.

An active highpass filter feeds an active lowpass filter to make a wide bandpass with sharp slopes. An active bandpass filter using one opamp makes a narrow bandpass.
 
Audio is AC that alternates positive and negative over and over. But the LM3916 is active only for the positive parts of the input signal so the LEDs would be turned off for each half-wave of the input signal and at low frequencies they would flicker and at higher frequencies the LEDs would appear dimmed because they are turned on only half the total time.

The rectifier passes only the positive parts of the signal and its filter capacitor holds the peak voltage long enough for our vision to see its brightness and to avoid flickering on and off. But the diode needs about 0.65V for it to work which is near the signal level required to light the lowest LEDs of the LM3916 so they might not light with low levels. An active rectifier using an opamp is shown in the datasheet and it rectifies very low levels perfectly.

Your "filter" is a simple passive RC highpass filter amplified by an opamp and it feeds a simple passive RC lowpass filter. It is not an active bandpass filter. It is very simple so its slopes are gradual and not sharp. Its highpass and lowpass cross and reduce frequencies that both are reducing. An active bandpass filter has the RC parts inside its negative feedback loop and some active filters even use positive feedback to make sharp slopes or a narrow bandpass. active filters can use multiple RC networks and they have "orders":
With one RC it is a first order very gradual sloped first order filter.
With two RCs it is a second order filter that has sharper slopes.
With three RCs it is a third order filter etc.

An active highpass filter feeds an active lowpass filter to make a wide bandpass with sharp slopes. An active bandpass filter using one opamp makes a narrow bandpass.
Ok I've remade my circuit how does it look like now? Also Is this the rectifier circuit you're talking about, its figure 22 in the data sheet. If so, since im thinking of only doing 3 filters for now( 20-250hz, 250-4000hz, 4000hz-20khz) would I be able to use the same rectifier for all three filters or would I need to change the R and C values? The data sheet also uses a different op amp than then ones I have would it still work with the lm324? And lastly, this rectifier circuit would replace my "peak detector" correct? Sorry for all the questions really trying to understand how all of this works.
 
im thinking of only doing 3 filters for now( 20-250hz, 250-4000hz, 4000hz-20khz)
Since these are not "brickwall" filters (vertical attenuation slopes, zero overlap), I recommend designing them so that there are gaps between the three passbands. This will increase the amount of time that all three outputs look different.

ak
 
Since these are not "brickwall" filters (vertical attenuation slopes, zero overlap), I recommend designing them so that there are gaps between the three passbands. This will increase the amount of time that all three outputs look different.

ak
ah ok so something more like 20-250, 300-4k, 5k-20k? And is figure 20 the recitifier you were talking about earlier? And how did the filters I made look?
 
You show second order active filters with opamps that are not powered, are not biased properly and the grounds are missing. Why do you use resistor values as low as 1k which need HUGE capacitor values?? Most opamps cannot drive a load as low as 1k.
The peak detector shown in the datasheet is fairly complicated and needs a positive and negative power supply. My peak detector uses an IC that has inputs and outputs that go all the way down to ground so a negative supply is not needed and the circuit is simple:
 

Attachments

  • peak detector.png
    peak detector.png
    14.3 KB · Views: 248
You show second order active filters with opamps that are not powered, are not biased properly and the grounds are missing. Why do you use resistor values as low as 1k which need HUGE capacitor values?? Most opamps cannot drive a load as low as 1k.
The peak detector shown in the datasheet is fairly complicated and needs a positive and negative power supply. My peak detector uses an IC that has inputs and outputs that go all the way down to ground so a negative supply is not needed and the circuit is simple:
ok i did not know that amps couldnt drive 1k loads. Anyways I made some quick modifications the Capacitors are more than likely not standard values as I change them quickly since I did not have much time at the moment. Would I be able to use the half way peak detector show in the data sheet? I'd rather not have to buy parts. Also how do I properly biased my filters? The only biasing I have ever done involve diodes operating in specific regions
 

Attachments

  • FILTER256hzTO4080hz.jpg
    FILTER256hzTO4080hz.jpg
    214.6 KB · Views: 242
The datasheet for the LM324 opamp and most other opamps shows that its voltage gain and output voltage swing are spec'd with a load of 2k ohms or more. There are a few opamps that can drive a load as low as 600 ohms.
Here is a short description of how the circuit should be designed:

The lowpass filter must be fed from a low impedance like the output of another opamp.
The input of the filters must be able to swing up and down but since you do not have an additional negative supply then the new added opamp's (+) input must be biased at half the supply voltage with 2 series resistors and a capacitor. Then its input and output can swing up and down with the signal. Since the lowpass filter opamp is DC-coupled on its input then it will also have its input and output swing up and down.

The highpass filter also must have its input and output swing up and down then the resistor to ground on its (+) input must be disconnected from ground and connected to the half-supply voltage resistors added for the lowpass filter. The resistor to ground on its (-) input must be disconnected from ground and connected to a capacitor to ground
The simple half-wave peak detector also must have its input swing up and down but must have an input that swings positive and negative. Then all the previous opamps need an added negative supply. Use my peak detector circuit instead since its input has a capacitor that blocks the DC from the highpass filter opamp.

Your half-wave peak detector has its transistor upside down but you should use my peak detector circuit instead.
 

Attachments

  • half-wave peak detector error.png
    half-wave peak detector error.png
    81.2 KB · Views: 230
The datasheet for the LM324 opamp and most other opamps shows that its voltage gain and output voltage swing are spec'd with a load of 2k ohms or more. There are a few opamps that can drive a load as low as 600 ohms.
Here is a short description of how the circuit should be designed:

The lowpass filter must be fed from a low impedance like the output of another opamp.
The input of the filters must be able to swing up and down but since you do not have an additional negative supply then the new added opamp's (+) input must be biased at half the supply voltage with 2 series resistors and a capacitor. Then its input and output can swing up and down with the signal. Since the lowpass filter opamp is DC-coupled on its input then it will also have its input and output swing up and down.

The highpass filter also must have its input and output swing up and down then the resistor to ground on its (+) input must be disconnected from ground and connected to the half-supply voltage resistors added for the lowpass filter. The resistor to ground on its (-) input must be disconnected from ground and connected to a capacitor to ground
The simple half-wave peak detector also must have its input swing up and down but must have an input that swings positive and negative. Then all the previous opamps need an added negative supply. Use my peak detector circuit instead since its input has a capacitor that blocks the DC from the highpass filter opamp.

Your half-wave peak detector has its transistor upside down but you should use my peak detector circuit instead.
Ok so i found the schematic of this color organ. Would you recommend adding the part I circle which I believe its an audio amplifier circuit? Also I made a triangle around 2 resistors in series and a capacitor which seems to be what you're telling me to add. Did I do it correctly? Also just making sure, I'm going to need a second power supply since your peak detector circuit runs on 5V instead of 12V correct?

EDIT: i just realized my i forgot to change my Vee from 5v to 12v, ignore that part
 

Attachments

  • colororgan.jpg
    colororgan.jpg
    691.7 KB · Views: 260
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top