1
\$\begingroup\$

I'm working on a small-scale audio spectrum analyzer. I take an aux cord L/R inputs into two amplifiers that output to a speaker. Say I pass the output that goes into the speaker into 3 bandpass filters for low,mid, and high ranges.

If I then rectify that output to a DC voltage, how would I configure a "bar" of LEDs to light up based on that voltage? Say I had 6 LEDs per bar. When there's little to no bass I want only the first 1-2 LEDs to light up, and when there's a lot of bass all 6 LEDs to light up.

I'm trying to this project with only analog components, as I realize this is a trivial task with a microcontroller.

I'm not sure if it's important or not in this type of circuit, but other than the signal output I have access to a 5V DC source that I've mainly used to bias the amplifier.

I can't quite figure out how to configure the LEDs in such a way that it matches the behavior I desire. I've searched around online and see some circuits use zener diodes to achieve this sort of effect. I think I want to turn the LEDs on through current and not voltage but am unsure how this works. I breadboarded some LEDs and played around and I couldnt get the right behavior.

EDIT:

As duskwuff pointed out below, the LM3914 is a great and pretty easy solution to this problem. But I hate easy. I've been messing around more and here's what I've been trying to do:

1) Rectify my signal output using a full wave rectifier. There's a problem with this though, my amplifier output signal has a minimum p-p of around 200mV. This means that at lower volumes, no signal will be rectified because the diodes will not allow current through. Could I possibly solve with with an amplifier stage between the output and the rectifier input? I have a 5V DC source available.

2) At this point I'm trying to figure out a way to use NPN transistors as switches that turn on at different rectified output levels. My success with this has been, well, very limited. At first I tried using Zener Diode's taking advantage of their zener voltage, but I looked around and I can't find any with a low enough Zener voltage that would work here. I could put an amplifier between the rectifier stage and the NPN stage, but I'm not sure thats the best solution.

I've included a picture of my entire circuit schematic so anyone can see what I'm working with here.

enter image description here

Starting at the far left I have a balance control, followed by a 3-stage amplifier, followed by a rectifier.

Any help would be appreciated.

\$\endgroup\$
  • \$\begingroup\$ Are you aware that our ears work like Spectrum Analyzers in log scale not linear. You may want to think about specs. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 26 '17 at 3:23
  • \$\begingroup\$ Thanks, and yes I'm aware. I'll happily spend time fine-tuning values to get the log-approach that I want once I get SOMETHING working, but that hasn't happened yet. \$\endgroup\$ – Zearia Feb 26 '17 at 5:17
  • \$\begingroup\$ you don't fine tune a linear detector into a log amp. Can U imagine the response, define the measurable response specs then find a design to do it. Bandwidth, log detector , attack time, decay time, thresholds. In-Out block diagram. etc \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 26 '17 at 5:47
  • \$\begingroup\$ Wouldn't the detector work the same with in both the linear and log cases, but just detect different values though? I can't picture how I'm going to do something if I don't even have a proof of concept. Sure, I have a general idea of how I want it to behave, but I don't even have a detection system in place, so how can I calibrate what it detects and how? To me it's like trying to plan out exactly how large a room should be when you have no idea what you need to put in the room in the first place. \$\endgroup\$ – Zearia Feb 26 '17 at 5:52
  • \$\begingroup\$ then you need to study harder on how Spectrum Analyzers work, start with studio Graphic Equalizers indicators, look at Audio Spectrum Visualizations for WMP, iTunes , etc. The envelope of a log signal with attack decay times is quite different than the envelope of a linear signal with same attack decay times. You do the math. Once you understand all the different things that can be done with spectrum signals, design the room to fit it in with a block diagram and interface specs. This is how design is done. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 26 '17 at 14:11
1
\$\begingroup\$

The standard part for this task is the LM3914 ("Dot/Bar Display Driver"). It functions as a multitap voltage divider, and compares the signal with the value at each tap:

LM3914 schematic

The easiest way to build this will be to simply use a LM3914 for each graph. The pinout of this part is such that you can directly drive a 10-segment bar graph LED from the chip. If this is too easy for you, you can try building an equivalent circuit yourself, but you'll need a lot of comparators to make it work.

\$\endgroup\$
  • \$\begingroup\$ I'm a bit confused on how these chips work as I've always used single components (npn's,nmos's, etc..). Would this chip take a direct audio signal? The same signal that my speaker receives? What is V+ in this diagram? What are the positive terminals of the comparators actually hooked up to? I see it must have something to do with a reference voltage. How does choosing this voltage influence how the chip behaves? \$\endgroup\$ – Zearia Feb 26 '17 at 3:23
  • \$\begingroup\$ Read the datasheet for details. (Click the schematic!) The "functional description" section, starting on page 9, goes into extensive detail on how the part works. \$\endgroup\$ – duskwuff Feb 26 '17 at 3:28
  • \$\begingroup\$ Thanks! This is my go to plan B now. Half the fun of this is making things from square 1, but if I can't get it working I'll definitely use this. \$\endgroup\$ – Zearia Feb 26 '17 at 5:00
  • \$\begingroup\$ So after a couple hours of looking at other solutions I've come to agree with virtually everyone that I should use an IC rather than do it myself. I'm really, really bad at reading datasheets. Is V+ and V- for this IC its supply voltage and reference ground? As in I need to supply it 3V to V+ and then connect V- to ground? Also, how would I select my LEDs? Don't different LEDs have different voltage and current requirements? Could I mix-and-match? Does it only operate with certain uniform LEDs? I could have missed this in the datasheet, I'm re-reading it now. \$\endgroup\$ – Zearia Feb 26 '17 at 7:22
  • \$\begingroup\$ @Zearia Just follow the first schematic under "typical applications". You don't need to do anything special with the LEDs -- the current setting resistors on pin 7 will handle that. Note that the IC will probably need a supply of at least 5V. \$\endgroup\$ – duskwuff Feb 26 '17 at 8:01
0
\$\begingroup\$

There are chips that do this.

To do it discretely, you can use a few comparators for that.

A MCU would simplify this greatly.

\$\endgroup\$
  • \$\begingroup\$ As I said in the post I understand that a MCU would make this trivial, but I want to learn how to create a circuit like this. What do you mean by comparators? Would that involve transistors acting as a switch in some way? \$\endgroup\$ – Zearia Feb 26 '17 at 2:43
  • \$\begingroup\$ You would need A LOT OF comparators. Best off getting a linear LED driver IC \$\endgroup\$ – Bradman175 Feb 26 '17 at 3:01
  • \$\begingroup\$ The simplicity of a MCU is hardware, it would be fairly complicate code wise. A hardware ic implementation is the simplest. \$\endgroup\$ – Passerby Feb 26 '17 at 6:38
  • \$\begingroup\$ > What is the impedance of the input port when the input voltage is slightly over VDD? fairly simple: dannyelectronics.wordpress.com/2016/07/16/… \$\endgroup\$ – dannyf Feb 26 '17 at 11:40
0
\$\begingroup\$

just a few cents: i would NOT use a Fullwave rectifier to analyze the signal - meditate about comparators and how you can take huge advantages out of their mode of operation

second: if you want to do it right, you have to define specs. this is important. first: you choose a supply voltage, then you choose ways to split this voltage (it is the maximum available in your circuit) into 6 Parts (you mentioned 6 LEDs per Bar). After that, you rearrange these DC-Voltages for a logarithmic scale (it doesnt need to be fully accurate - say 6db per LED is okay or 3dB for finer resolution) - after that you can use these DC References and switch your NPNs.

To be honest: I would construct such a project entirely out of comparators. It is Cheap nowadays. It is also possible with discrete circuitry, but it is a lot of math, voltage division and brainfuck...Choose some quad-comparators with 20mA output and you should be able to drive your LEDs...they are cheap as crackers...

\$\endgroup\$
  • \$\begingroup\$ Can you go into a little more detail about why you would not use a rectifier? if I didn't rectify the signal and just sent it straight to some comparative or discrete equivalent, wouldnt the frequency of the signal cause it to flash on and off really fast instead of hold steady? \$\endgroup\$ – Zearia Feb 26 '17 at 6:47

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.