Spectrum Analyzer (Using LM3915)

Discussion in 'The Projects Forum' started by rbxslvr, Nov 30, 2008.

  1. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    I'm trying to build a spectrum analyzer using an LM3915 IC as a VU Meter. How can I seperate bands of audio to be measured individually, each by its own vu meter?
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You'll need to build several bandpass filters. Active filters will be easier than passive filters.

    Did you have frequency ranges in mind?
     
  3. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    I don't yet know what frequencies I plan on using. I'm still looking into it. Any recommendations?
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, my stereo has a 7-band equalizer on it.
    Frequency ranges are:
    63 Hz
    160 Hz
    400 Hz
    1 kHz
    2.5 kHz
    6.3 kHz
    16 kHz
    It's a '93 vintage Technics that was the best bang for the buck in it's day.
    You could use that as a basic guideline for your spectrum display. You'll need to design wide bandpass filters for each frequency range. For example, for the 63Hz filter, you might go from 20Hz to 100Hz, for the 160 you might go from 105Hz to 220 Hz or so, etc.

    TI's Filter Pro will help you a great deal in designing the filters. You can download it for free here:
    http://focus.ti.com/docs/toolsw/folders/print/filterpro.html
    Use Wide Band-pass, MFB Single Ended or Sallen-Key, Chebychev. 2 poles for both the low-pass and high-pass. Allow up to 1dB ripple in the passband.

    The filters will be very sensitive to values of RC. You'll need a good cap meter to verify your caps before installing them.
     
  5. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
  6. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    Both very good recommendations. I haven't really described what I'm planning on yet. So, here goes.

    I'm going for aesthetics with this project. I'm hoping for something about the size of a standard piece of printer paper, about 1"-1.5" deep that I can mount on my wall. I'll put it in a picture frame of some sort. The front of the board, instead of just LEDs, will be offset from the top of the LEDs by about 1/4". The front will consist of a sheet of plexiglass with white paper beneath it (to diffuse each LED's color). I'll use 14 bands and 10 LEDs for each band. Each LED will be seperated by little cubbie-like dividers (almost like in a fishing tackel box) so that the color doesn't bleed through into other squares on the front. Each LED will be centered in a .795" square. I'm probably not going to start with the hardware for about a month, but maybe if I create a schematic, you guys could give it a quick lookover to make sure everything checks out? (I haven't taken on a project like this before. I can't wait to see the finished product)

    What about the WMP visualization, "Bars". It uses 50 different bands. Is there any way to tell what frequency ranges they are?

    Could I run my audio through this in a parallel circuit, and measure only a fraction of the input? I know that the chip runs in 3dB intervals, and I don't want to use more than 10 LEDs, and don't want to cascade chips.
     
    Last edited: Nov 30, 2008
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You might consider using "eggcrate" type fluorescent light diffusers, like on this page:
    http://www.goodmart.com/products/1111767.htm
    (just an example, I've never bought anything from them)
    Those are silver, but you might find them in plain white or black elsewhere. You could spraypaint the "crate" flat black to help keep the light from bleeding over into the next section.

    Most of those "eggcrate" diffusers are 1/2" x 1/2", which would be a good size for 10mm LEDs.

    Most LEDs you'll find nowadays have a pretty narrow focus. You might wind up using something like "top hat" LEDs that have a wide dispersion pattern

    Sure. You might use Cadsoft's Eagle Layout Editor to work it up. Unfortunately, the freeware version is limited to 3"x4" boards, but your circuit is basically going to be many repetitions of the same thing.

    You could create a single schematic, and then a board layout for a single frequency range, and just use the same design for however many frequency bands you decide on. Just the resistor and capacitor values will change for the various passband filters.

    You could record a .wav file with various known frequencies in it, then play it back in WMP to find out.

    Every 3db is a half power point. That means when each successive LED lights, the power level has doubled.

    You could probably measure the output from your sound card, if that's what you're talking about. If you have a bandpass filter properly configured on the front end, you'll see only the audio levels passed by your filter.
     
  8. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    I like the eggcrate idea. That's much easier than what I was planning.

    I've worked out a schematic that I believe will work. It doesn't look very nice because I got frusterated and just used MSPaint, adding to the existing diagram on the chip's datasheet page. How does this look for 20.1 Hz to 100.1 Hz? I didn't number the resistors at the bottom, nor did I use the Ω symbol... but that should be pretty clear.

    [​IMG]

    I realize that I may have made a really stupid mistake in there somewhere, but I haven't really created many of my own schematics before. Physically building it will be a breeze.
     
  9. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Yes you did! You have connected the ground of the filter to the signal input and the output of the filter to ground. Change them and it will work fine.
     
  10. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Well, I noticed something else. You filter circuit works with a dual supply. Are you going to use a dual supply for the filter? If yes then you will need to use a clamp circuit on its output to add a dc voltage to the signal as it does not go below zero volts. The LM3915 can't read negative signals.

    If you are going to a single power supply for the filter, then you have to modify the circuit a bit. You will need to apply a bias voltage on the non-inverting input with a value of half the power supply voltage. You can do it with a voltage divider formed by two resistors.

    Also, in both cases you need an input coupling capacitor on the input of the filter. Use a 470uF as not to attenuate low frequencies.
     
  11. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    See... I called it.:D

    So, do you mean I need to horizontally flip the entire filter portion?
     
  12. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Change the two wires, the wire which goes to pin 5 must go to ground and the wire which goes to ground must go to pin 5. Did you understand what I told you about the supply voltage of the filter?
     
  13. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    I somewhat understand what you meant about the voltage of the filter. I think I need to read up a little bit on some of this stuff. I'm going to do some googling. I'd ask you to just fix it if you would, but I want to understand what I've done wrong.

    When you say that the input can't be negitive, do you mean it needs to be 0, or inverted?
     
  14. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    I mean that it has to vary between 0 and a positive value voltage.
     
  15. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    Okay. I'll fix my diagram and post it again (probably not until tomorrow). Granted, it will probably be 800% more screwed up.:eek:

    This is a learning experience for me.

    But, one more quick question. Will the values calculated by the javascript calculator I used earlier work for this:
    [​IMG]
     
    Last edited: Dec 1, 2008
  16. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Use the other band pass filter you posted initially, its better. To make it work with single supply voltage connect another resistor equal to R2 between the positive supply voltage and the top of R2.
     
  17. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The input of the LM3915 does not need a clamp. It is safe with an input as high as + 35V or -35V.

    The datasheet for the LM3915 (and I) recommend using a peak detector circuit to hold the display reading for a moment so that you can see a peak. The datasheet has a few peak detector circuits. Without a peak detector then the LEDs will appear as a dim blur.
     
  18. rbxslvr

    Thread Starter Member

    Nov 30, 2008
    14
    0
    What is the difference between a full-wave peak detector and a half-wave peak detector. Which would I want to use for this? (Looking at the diagrams, I'd like to use the half-wave peak detector. Not as much overall work)
     
  19. KL7AJ

    AAC Fanatic!

    Nov 4, 2008
    2,040
    287

    Or if you really want to get hi-falutin' fancy, you can build a parametric equalizer...you can then scoot your bandpass centers around at will.

    eric
     
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well, it would be good to keep things more focused on a novice level - after all, he wants to build the beast ;)
     
Loading...