0
\$\begingroup\$

Background: I am currently using a SparkFun Electret Microphone and am needing to both filter and amplify the signal before turning it into a square wave to be interpreted by a FPGA. The mic itself has a ~1.65V DC offset and the signal amplitude is in the range of 200mV. The mic is powered off of 3.3V. For amplification I am utilizing a LM324 powered off +/-2.5V. For the conversion of the signal, I am using a LM339 comparator with a low pass "averaging" circuit and it is powered off of 3.3V.

Issue: Both of these circuits work just fine independently of each other. The active filter does a pretty good job of attenuating room noise below the 8kHz cutoff I had specified when I built it. The LM339 with the "averaging" filter works just fine to convert the sine wave from the mic to a square wave as well.

The problem I am encountering however is trying to integrate the two of them. When the output from the LM324 is fed into the comparator, I cannot seem to get any output out of the comparator.

I have simulated the circuit in LTSpice and the output is what I would be expecting to see in reality, but I cannot for the life of me get this to work. Images of the simulation are attached below.

  • Red trace is the simulated mic input

  • Green trace is the output from the active filter

  • Blue trace is the output from the comparator

Thanks in advance, any help is appreciated!

Schematic of Circuit

Output Traces

\$\endgroup\$
  • \$\begingroup\$ What output are you getting when you try to do it outside of simulation? Do you have an oscilloscope you can measure it with? That information would be helpful. \$\endgroup\$ – Hearth May 4 '17 at 3:08
  • \$\begingroup\$ Outside of the simulation I am getting the correct output from each of the circuits independently, but when I feed the output from the LM324 into the LM339 I get no output whatsoever from the comparator. Unfortunately I don't have any pictures of the traces right now... \$\endgroup\$ – chalsey May 4 '17 at 3:11
  • \$\begingroup\$ Where is your schematic? \$\endgroup\$ – Andy aka May 4 '17 at 7:39
0
\$\begingroup\$

If your op amp output in real life looks how it does in the Sim then I would bet that you are violating at least the single ended input voltage range of the comparator, if not the input common mode range as well. Your comparator negative supply voltage is 0V.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

First, I'm going to assume that you have verified that the output of the LM324 is operating between -1 and +1 volts.

With that said, look at the data sheet for the LM339, under absolute maximums. Note that the maximum input voltage range is -0.3 to Vcc - 1.5 volts. You are applying -1 volt to the - input.

Do you see a problem?

You need to level-shift the input to the 339. Make another high-pass network, something like

schematic

simulate this circuit – Schematic created using CircuitLab

This will bias your inputs to about 1 volt, and allow a voltage swing of about 0 to 2 volts. Notice that this will violate the max input of 1.8 volts, so you may want to decrease the gain of your LM324 stage.

Secondly, if all you're trying to do is convert a sine to a square, why do you have the phase-shift network R4/C2?

| improve this answer | |
\$\endgroup\$

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.