Instructables

LED Comparator Display - Audio Volume Level

Picture of LED Comparator Display - Audio Volume Level
photo_2.JPG
photo_3.JPG
How to make Comparators, simple explanation from an op amp circuit

Comparator circuits are very handy when you need a visual representation of an adjusting voltage level.  My most common application is a volume indicator on an audio source.  The output can be shown through a few LED's and give the user a quick and easy to understand volume representation

When using the op amp, if you apply a voltage to the negative input pin, and no feedback loop (the output is not connected to the input), the output will only go high when the positive input pin has a higher voltage than the negative input pin.

We can use a voltage tree to create the negative pin's input voltages.
Example : We have a tree set up with +9 Volts at the top and ground at the bottom
using 4 x 100 ohm resistors in series along the tree we get the following tap-voltages from a "tree":
9 V, 6.75V, 4.5V, 2.25V, and 0V
(see more detail on voltage trees in my other tutorial: http://www.instructables.com/id/Voltage-Tree/)

We can make each one of those an input to a negative input of an op amp (5 op amps total).  We will then connect our output of our audio device to all of the positive inputs of the op amps.

Finally connect a simple resistor and LED from the output of each op amp to ground.

Now what will happen is as the output of the audio device (simulated here as a function generator +-9 V sin wave) rises to and above each of the tree tap voltages, that op amp will go high and turn on the LED at the output.  Putting these LED's in a row will show that they will turn on in order as the audio gets louder.

And that is a simple way to use Op-amps as comparators for visual representation of an output. This was just one example, but you can use Op-amps almost anywhere.  You can replicate this for any voltage-taps you want along the tree, and any max or min voltages.

I have images here of one example where i implemented it into an audio device.  The voltage values are different, but it is the exact same technique.  As the music plays louder, the LED's along the side of the board each light up.
This can also be done with an LM3915 or 3916 - all the amps in one package.

For audio, the scale needs to be logarithmic BTW
DrNicker (author)  steveastrouk1 year ago
There are a ton of op-amp options you can use.

also, the logarithmic scale isnt necessary for the LED levels. It depends on your application and what you really want out of it.
"I have images here of one example where i implemented it into an audio device. "
Well you said Audio for your example, so you need logs there for the best result.
DrNicker (author)  steveastrouk1 year ago
I'm just saying the logarithmic is a common implementation. But nowhere is it a requirement