Connect with us

MSGEQ7 analog circuit?

Discussion in 'General Electronics Discussion' started by elementcollector1, Jun 27, 2015.

  1. elementcollector1

    elementcollector1

    24
    0
    Feb 23, 2014
    Hello,

    I would like to wire up a MSGEQ7 IC to output a signal to LEDs (depending on frequency) without use of a microcontroller. Is this possible with a simple setup? I don't have much on hand at the moment...
     
  2. davenn

    davenn Moderator

    13,328
    1,769
    Sep 5, 2009
    what is a MSGEQ7 IC ?
     
  3. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    It's almost certainly one of these.

    I'm sure you could get the output of one of these with a CMOS oscillator, a 4017 and a bit of glue logic. I'd guess that you'd be able to do it with 10 or fewer chips. You's get one LED per frequency band that would vary in intensity in response to the intensity of sound in the associated band.

    Check the datasheet. The diagram on the last page tells you pretty much everything you need to know.
     
  4. elementcollector1

    elementcollector1

    24
    0
    Feb 23, 2014
    Okay, so what I'm reading is that the chip switches very fast between different frequencies. I looked up a 4017, and that seems suitable for my application - and I happen to have one on hand, fortunately enough. Now, how do I hook up the output of the MSGEQ7 to the decade counter appropriately?
     
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    Ok, the rough idea is to clock the 4017 from the same source as the clock for the MSGEQ7, and then AND the data out with outputs of the 4017.

    The tricky bits involve enduring that the 4017 is correctly reset so that it remains in sync with the M7.

    The output of the and gates will only be high for a short period and it would be beneficial to latch that output until the next output for that band is returned. That would require (at least) a single independent latch for each output.
     
  6. hevans1944

    hevans1944 Hop - AC8NS

    4,250
    2,001
    Jun 21, 2012
    @(*steve*), if I understand this doobie correctly, it is a bunch of analog bandpass filters whose outputs drive peak detectors that are read in sequence with the analog multiplexor. Apparently the act of reading the mux also causes a 10% decay in the peak-detector output for that channel. To drive an LED more or less continuously with its brightness a function of the peak output of each channel, it seems to me you need to sample-and-hold the analog mux output and use those held samples to drive the LEDs, updating the results each time the mux cycles through the channel again. There are integrated circuit analog switches that will perform the sample-and-hold function and it is only necessary to keep them in synchronism with the mux, easy to do if you program in a reset after a complete cycle. Since there are seven channels, a 3-bit decoded counter clocked off the strobe could be used to select the analog switches, resetting the mux each time the counter oveflowed to keep everything in sync.

    The usual sample-and-hold requires two analog switches: one to charge up the hold capacitor and another to connect the capacitor to a high-impedance buffer for readout, the idea being to minimize decay in between samples. For lighting up LEDs, you might be able to just get by with one switch to charge the hold capacitor. The high-impedance buffer would drive the LED all the time.

    Now, what is this thing really used for? It is touted as a graphic equalizer, which I envision as a row of sliders I can move up and down to change the amplification in each narrow audio band the slider is associated with. How does this chip help do that? Or maybe it just displays visually on a bar-graph display, driven by the DC output, what the real graphic equalizer is doing. That would be semi-cool and maybe useful, but I just make the equalizer adjustments to suit my hearing without reference to what the actual settings are. At my age, that means plenty of boost on the low and high ends, not so much in the middle. Drives people with normal hearing nuts, but it sounds okay to me.
     
    Last edited: Jun 28, 2015
  7. elementcollector1

    elementcollector1

    24
    0
    Feb 23, 2014
    The chip does the second thing (gives a visual display of audio frequencies), and is normally used for this kind of thing (LED visualizers).

    Kind of new to analog circuitry, but I'll give understanding your post a go: I hook up a 4017 counter's strobe pin to the clock pin on the MSGEQ7, and then hook this up to two analog switches to drive the LEDs accordingly. Would a quad bilateral switch 4066 work?

    Also, how would I get the 4017 to output multiple frequencies as separate outputs (or does it already do that)?
     
  8. hevans1944

    hevans1944 Hop - AC8NS

    4,250
    2,001
    Jun 21, 2012
    You want to use a 3-bit Johnson counter, the CD4022B, rather than the CD4017B, which is a decade (4-bit) counter. Since the counter outputs are already decoded, you just need to connect each decoded counter output to one analog switch control input so that switch turns on and charges a "sample-and-hold" capacitor each time that channel comes around in the sequence. Also, connect the "0" decoded output to the reset input of the MSGEQ7 to keep the counter in sync with the MSGEQ7. The eight switch inputs from two quad bilateral switches, the CD4066B, are all wired in parallel to the single DC output of the MSGEQ7. The outputs of each switch will be connected to a capacitor that "samples and holds" the DC voltage supplied by the MSGEQ7. To prevent the charge stored on this capacitor from "leaking off" in between samples, a non-inverting op-amp buffer should be used to provide a high-impedance connection to the sample-and-hold capacitor. Obviously you will need eight buffers, so a quad op-amp is indicated here.

    When you are done wiring all that together, the op-amp buffer outputs will provide the intensity control signals for your LEDs. Unfortunately, most analog op-amps are ill-suited for driving LEDs directly (insufficient current capability). Depending on the size of your LED display (you may want several LEDs per channel), a constant-current driver for the LEDs will be required. Or you may want to implement a PWM (pulse width modulator) driver. Google is your friend here for finding LED drivers. There is also a resource here on Electronics Point. I hope you enjoy your venture into analog circuitry. Combining analog techniques with digital logic is a very powerful solution set to many problems.

    If you do a little research on sample-and-hold circuits, you will find that they are most often used as "front ends" to a multiplexed analog-to-digital converter, allowing the A/D to digitize several analog inputs in rapid succession. For that application, there is only one sampling capacitor, and it is usually isolated from the A/D input by a second analog switch. The input switches alternate with the output switch without overlapping conduction of the two switches. This is often called a "flying capacitor" circuit and is quite useful for suppressing common mode noise and ground loops that often plague low signal level analog circuits. For your application, I don't think a flying capacitor is needed because each channel has its own capacitor and buffer. Choose a capacitor small enough to be easily charged by the MSGEQ7 output, but large enough to retain most of its charge between samples. I think I would start out with about 0.1 μF and work up and down from there. The "optimum" value will depend on the output impedance of the MSGEQ7, the bias currents of the op-amp buffers, and how fast you cycle through the seven channels. Quad JFET-input op-amps such as the TL074 from Texas Instruments are recommended for buffers.

    There may be some cross-talk between adjacent channels as the analog switch from one channel opens while the switch for the next channel closes. This can be solved in many ways, but typically it requires the generation of non-overlapping enabling control signals to the switches. This can be as simple as an RC delay driving a Schmitt trigger logic gate, but I will leave this as an exercise for you to solve if it comes up. If it does, and you are unsuccessful in eliminating the cross-talk, we can discuss how to generate non-overlapping control signals for the switches.

    There are of course other ways to create a audio spectral display. If this were to be a commercial product, I would investigate digitizing the audio signal and using FFT processing in a DSP chip to obtain the spectral density function. The DSP chip would then provide suitable PWM outputs for each spectral segment. But, I have neither experience with DSPs nor interest in pursuing this particular application.
     
    KJ6EAD likes this.
  9. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    A 4017 will also work. You just need to reset it correctly. If these are analog outputs, then a couple of 4066's could be used.

    If you connect them to a series of peak and hold circuits with an inbuilt decay you'll probably get something like what you want.

    Another idea is to connect the output of the M7 chip to something like an LM3914/3915 (as appropriate) and use the 4017 (or whatever) outputs to drive a series of latches to hold the position of the display for each band.
     
  10. elementcollector1

    elementcollector1

    24
    0
    Feb 23, 2014
    Alright, so what are the strobe and reset pins in the M7 chip connected to? From the datasheet, they don't seem to be connected to anything...
     
  11. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,192
    2,694
    Jan 21, 2010
    looks to me that strobe is used to clock the data out and reset is used to ensure that the next data read is the first band.
     
  12. elementcollector1

    elementcollector1

    24
    0
    Feb 23, 2014
    So I should just connect those to the Reset and Clock pins on the 4017?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-