Help: Amplify AC microphone, output DC 5v

Hello. I have a project at work where I’m trying to connect a microphone to our chassis dyno so we can record sound output along with the regular torque and horsepower outputs. Analog input at the dyno breakout box is 0-5v dc. The microphone puts out around 30mV AC when “excited” by a 114db test source. So, my issue is how to amplify 30ish mV AC to 5ish volts DC. Tried using a LM386 chip along w/ suggested caps/resistors but doesn’t seem to work correctly. I have a cheapy microphone that looks like it’s meant for an Arduino project that kinda works, but it isn’t consistent in how it “measures” different frequencies. The microphone I want to use seems pretty consistent in that respect. It is powered by a 9v battery.

Any info you can send my way would be appreciated. Marty

What power do you have available for the amplifier?

What sort of microphone do you have?

Do you want a linear or logarithmic response?

What dynamic range do you need?

Allan

Hi, Allan. Please see below:

allanhurst:
What power do you have available for the amplifier?

Would prefer to use 5VDC, but we can probably rig anything. Handy to use “wall wart” type power supplies.

What sort of microphone do you have?

Don’t know the make. Doesn’t seem to have any markings on it. Looks rather “homemade”. But fits perfectly into tone generator deal that we have, so they may go together. And generator is definite not homemade. I can look at it more carefully, but not until Monday.

Do you want a linear or logarithmic response?

Guessing this has to do w/ output? I guess linear would be better, seeing that the way it will be used will be linear. The way the dyno input/software works i can see where i can adjust the “slope” of the input, but it is linear.

What dynamic range do you need?

Do you mean what db? We’re most interested in sound at max RPM, which i believe is around 112db. But, a range of 90-130(?) would be good.

Thx.
Marty

[u]Here[/u] are your basic op-amp circuits. They can be used as a starting-point for making a microphone preamplifier.

If you build a non-inverting amplifier you should add a resistance between the input and ground to keep it from floating when no microphone is connected, or in case the mic is AC coupled. Most microphones are low-impedance and you can use a 1K resistor.

If you build an inverting amplifier, the impedance of the mic gets added to Rin to determine the gain and since the microphone impedance is not generally constant over the frequency range, you can get frequency response variations. To minimize that, Rin should be much greater than the mic impedance.

If you have an electret mic element it has to be powered. R1 on the [u]SparkFun Microphone Breakout Board[/u] powers the electret condenser and C1 isolates the microphone power from the amplifier.

If you copy that schematic, leave-out R2, R3, and C3. These components bias the output at 2.5V, which means silence is 2.5V and AC audio swings above and below that bias.

With a single-ended power supply (no negative supply) the op-amp won’t swing negative (OK in your application) but it also won’t go quite down to zero. And with a +5V supply you wont quite get 5V out. There are rail-to-rail op-amps but I don’t know if they go exactly to the power supply limits or just very-close.

A [u]Peak Detector Circuit[/u] will give you a varying DC voltage that “follows” the audio peaks. The decay time is determined by the C1 RL time constant.

Normally with SPL readings you wouldn’t necessarily want to use the peaks but most of your engines should have similar sound characteristics so you should be able to get reasonable calibration (as long as you have a real SPL meter for calibration).

I have a cheapy microphone that looks like it’s meant for an Arduino project that kinda works, but it isn’t consistent in how it “measures” different frequencies.

Again, if the sound characteristics are similar you should be able to get reasonable calibration/accuracy.

But, it’s tricky to make “real” SPL meter. SPL measurements are usually [u]weighted[/u] and averaged, and SPL meters are calibrated with known sound levels.

Something like the enclosed might do.

DC offset a few mV

Linear.

+ve peak detect.

Unweighted

12v isolated supply eg wallwart required.

About 1mS attack, 1S decay time.

Suitable to drive a high-impedance input. If < 1M, need a buffer.

Opamps - a LM358 might do at a pinch, but a NE5532 would be much better.

If you want log response - ie in dB’s/V , -ve and +ve peak detection, averaging and eg A-weighting, I’ll have to think about it. A bit more complicated. That’s getting to be a proper SPL meter. This isn’t.

Or you could buy something like this, which has all the features, is calibrated, and has a USB data output.

https://www.ebay.co.uk/itm/Omnitronic-SLM-600-SPL-Sound-Level-Meter/222610706875?epid=2096986867&hash=item33d4a1d1bb:g:~MUAAOSwrfVZXfH-

Not cheap, but if you reckon your time in building a gadget, perhaps not unreasonable. Talk to your boss.

Allan

spl.pdf (22.6 KB)

Skeeterweazel: Tried using a LM386 chip along w/ suggested caps/resistors but doesn’t seem to work correctly.

Actually, an LM386 should do quite a reasonable job of amplifying it, if you use the correct components. You will only get a 3 V range into the ADC, but for what you describe, that is way more than adequate.

But saying something "does not work" when you did not actually indicate what you did - "suggested caps/resistors" is quite meaningless :roll_eyes: - will get you exactly nowhere.

Paul__B: Actually, an LM386 should do quite a reasonable job of amplifying it, if you use the correct components. You will only get a 3 V range into the ADC, but for what you describe, that is way more than adequate.

But saying something "does not work" when you did not actually indicate what you did - "suggested caps/resistors" is quite meaningless :roll_eyes: - will get you exactly nowhere.

The LM386 is not a good choice for a microphone preamp, its input refered noise is something like 100nV/sqrt(Hz).

Try something with more plausible noise spec's like the NE5532 opamp. (Or if you want 5V operation rather than split-rail, the AD8656 has excellent spec's)

MarkT: The LM386 is not a good choice for a microphone preamp, its input referred noise is something like 100nV/sqrt(Hz).

But then, I read his original requirement. :grinning:

If the OP has 30mV rms ac signal, good noise performance is not essential, which is why I didn’t bother pointing out the LM386’s poor specs .

But a good idea to use a better device , all the same.

He still has to deal with dc offset and rectification.

Allan

Hi,

Analog input at the dyno breakout box is 0-5v dc

Don't know the make. Doesn't seem to have any markings on it. Looks rather "homemade". But fits perfectly into tone generator deal that we have, so they may go together. And generator is definite not homemade. I can look at it more carefully, but not until Monday.

What does its connection to a tone generator have to do with the setup. I assume the dyno is designed to record sound as well as the speed, torque and power readings.

Thanks.. Tom... :)

Guys, thx for your replies. This is over my head, but i'm trying to understand. I'll keep trying. Tom: I mentioned the tone generator to indicate that i think the microphone is of decent quality. If i could use the cheapy "arduino project" microphone that i have i'd be done, because it puts out a useful dc voltage that i can use. A little more backstory: The dyno isn't designed to record sound per se. We bought upgraded electronics for the dyno, and on the main "box" it has 4 analog inputs, 0-5v dc. One we configured for coolant temperature, one for cylinder head temp, one for detonation sensor. And the 4th will be for sound. For the 2 temp sensors, i stumbled across 2 different amplifier boards from Adafruit that work w/ Arduino. The knock sensor has an LED that indicates a knock, so i tapped into that.

Poking around last night i came across mention of a precision full wave rectifier (http://www.ti.com/lit/ug/tidu030/tidu030.pdf). Would that work for me? What do you think?

Allan: thx for taking time to make that schematic. I see diodes; assuming for rectification? Supply voltage: what would i use for the upper/lower "rails"(?) and for the chips? Thx again. Marty

About 12v from a wallwart would be fine.

If you want fullwave rectification ( don't think it would help a lot) you need one more opamp , as shown in the TI appnote you link.

Allan

Hi,

And the 4th will be for sound

Do you mean SOUND LEVEL? As in dB?

If you are just feeding the raw sound from a microphone into the analog input, I doubt that the input you are using will be able to resolve the level information. You need a circuit that will output a signal representing the audio LEVEL to input to the dyno.

The dyno input would be able to see a signal representing amplitude signal but not so frequency analysis.

What does the upgraded specs on the dyno say the input response is? Check with the installer/supplier/manufacturer of the upgrade with regard to sound level monitoring.

Tom.... :)

Allan, on your drawing on the lower mic rail you have a zero w/ arrow pointing down. What does that mean? I got all the components so am giving the circuit a try. Thx. Marty

Ground.

Allan

Circuit is putting out about 1.5 volts regardless of microphone input. Tomorrow i'll double check that i have everything correct. Marty

What circuit. A sound/microphone amplifier should output a DC bias voltage without sound. So the sound wave can swing positive and negative from that bias voltage/point. The code should measure positive and negative peaks, and subtract them to find peak/peak voltage. That way the code can eliminate that bias voltage. Leo..

Wawa, you can look back through the thread and find the attachment by Allan.

So you made the preamp with envelope detector from post#4. That indeed only outputs a positive voltage.

Should output 0volt without sound. How do you power the negative rail, and is it -5volt. Leo..

Leo, i'm using 12volt + for positive rail, and zero volts for the "negative" rail. I believe Allan said that would work. Thx. Marty