Instructables
loading
loading

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.
actually I'm new to electronics so I don't know how to go about it..sorry for that...

The LEDs do not vary with the volume of the source...
also 12 V is to be given always, right ?
and 9v reference is of our choosing ?
BooRan (author)  Aridaman SinghT24 days ago
The key to this circuit is the voltage tree created with the resistors R1 - R4. Look at "voltage dividers" online a little bit to get a better idea of theae. In this example if all four resistors are the same value whatever voltage is supplied at the top will be divided by four with each multiple at each resistor going up the tree.
hey, I made the circuit. All the LEDs glow as soon as I power all the Opamps with 12V . I'm using 5 UA 741s. Also, the audio voltage I am giving is about 0.316 Volts. so how do I select an appropriate reference voltage ?
BooRan (author)  Aridaman SinghT24 days ago
R1, R2, R3, and R4 are used to select the comparison voltage. if you measure or calculate the voltage along that tree each op amp will switch on or off relative to the voltage measured at its input pin from that tree.
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
BooRan (author)  steveastrouk2 years 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.
BooRan (author)  steveastrouk2 years ago
I'm just saying the logarithmic is a common implementation. But nowhere is it a requirement