Need some help here - I need to light up about 20 different LEDs based on the frequency input(200 Hz-20,000 Hz)


The circuit should light up the 1'st LED when the input frequency is between 200 Hz and 300 Hz


The circuit should light up the 2'nd LED when the input frequency is between 500 Hz and 600 Hz

And so on...

I thought about using a band pass filter, but I don't think it would work with frequency ranges tight as these.

Below is the band filter I used to try out filtering 11,000 Hz - 15,900 Hz

but the LED lights up even on 9,000 Hz.


Band Pass Filter Graph Band Pass Filter Graph

What can I do to get this done?

  • 6
    \$\begingroup\$ Why don't you digitize the input, run an FFT, and use the result to choose which LED to light? Can you explain why you don't think you can use a bandpass filter; including your circuit schematics and calculated component values? \$\endgroup\$ – Elliot Alderson Jan 1 at 14:47
  • \$\begingroup\$ I will try out your suggestion and post the results. As for the band pass filter, I tried using one but the the roll out voltage was unbearable, the LED was being activated by frequencies way above and below the cutoff frequency. \$\endgroup\$ – Kratos Jan 1 at 15:21
  • 2
    \$\begingroup\$ You could use a comparator (possibly using an ideal rectifier) after the filter so the LED only lights for frequencies within the passband by setting a threshold. \$\endgroup\$ – Peter Smith Jan 1 at 15:28
  • 1
    \$\begingroup\$ You need to specify the minimum amplitude of a signal that must cause an LED to light up and the maximum amplitude of the signals that you will see. Yes, you are going to need high rolloff rates. A processor running an FFT is sounding better. \$\endgroup\$ – Elliot Alderson Jan 1 at 15:52

There are two issues here, I think. Well, three, but I'll save that for last.

First, R2 should be at least 10 times R1. When the output frequency is high enough, the impedance of C2 will be very low, and the combination of R1/R2/C2 will basically look like R1 and R2 in parallel, which is not what you want.

Second, since your last element is C2, the output to the LED will look (more or less) like a voltage source, and you don't want to drive an LED from a voltage source. All else ignored, once you reach the forward threshold voltage of the LED, any further increase will produce a very large increase in brightness.

Finally, and this is harder to explain, a bare LED is what's called a non-linear load. That is, it provides a very large apparent resistance when reverse-biased, and a very small apparent resistance when forward-biased above its threshold. This changing resistance will feed back into your filter and affect your results.

Finally finally (and yes, that's 4 out of 3), this is not a good approach for what you are trying to do. Most importantly, your expected output curve is very inaccurate. It might do for a 100 Hz to 10kHz, but single RC sections simply don't have the selectivity you want. For instance, your low-pass section, R2/C2, when taken by itself, has a gain of .822 at 11 kHz, .705 at 16 kHz, and .623 at 20 kHz, so you can see that it's not doing much over this frequency range. The filter as a whole has a peak response at about 16 kHz, but its -3dB point is a bit below 3 kHz. So it's no wonder you're not getting the results your figure led you to expect.

TLDR: Your filter is working just about as it should. If you what better selectivity, you'll need to use a much more sophisticated (multipole with a better LED section) circuit.

  • \$\begingroup\$ A fifth issue :) is that standard leds need very little current to light up, and because of various factors (both in the LED and the human eye) they don't look much different from around 5 mA to 20 mA (the usual maximum). You may well be fairly far down on your filter's response slope but the LED can still look about the same. \$\endgroup\$ – Jamie Hanrahan Jan 1 at 23:24

A set of MFB filters could be used. For example, something like this:


simulate this circuit – Schematic created using CircuitLab

Design equations for an MFB filter are in this AD paper. I used a Q of ~10.

The input amplitude has to be about 1V or so to cause the LED to turn on, and without some kind of signal processing before the input the width of the band that turns the LED on will vary somewhat with the input amplitude.

If you have a suitable micro such as a MIPS PIC32 or an ARM Cortex M4 you could do this with basically one chip vs. 5 quad amplifiers and 100 passives for the filters, doing it the analog way.


If you truly want isolation between the filters, such that there is no bleeding of energy between adjacent-frequency-bands, then you need infinite-Quality-factor ("Q").

Unfortunately, infinite-Q requires infinite time to response.

I doubt you are that patient.


We hear frequencies on log scale or octaves log base 2.

So in order to accomplish 20 bands how many half octaves does this make?

20 Hz-20,000 Hz is 3 decades or 10 octaves or 20 half octaves.

THen you must define your dynamic range.

Let's say range = 0 to -30 dB has a BW of 1/2 octave. So the BPF must be very high Q around 100.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.