Amplifying audio signal before ADC

I want to measure an audio level at the Arduino analog input, and I've breadboarded up the basic idea using the 'envelope follower' circuit described in this thread.

Problem is, if I connect a headphone out of the laptop and send a test tone, I don't start seeing values above 0 until my test tone gets to about -15db. I really need it to register all the way down to -60db or thereabouts.

So obviously, I need a way to preamplify the signal. I would also like to experiment with measuring a microphone level with a variation of the circuit, so I'd need lots of amplification range.

Most circuits around here or other places involve using an opamp like TL072 or TL082, but they require a symmetrical power supply which isn't really an option.

I've seen other circuits using audio amplifier chips like LM386, but the circuits I can see always have this at the output, usually driving a speaker.

So what's the recommended way to amplify an audio signal before it gets to the Arduino analog input pin? (preferably still using common and breadboardable components)

You could find a cheap ‘pre amplifier,’ on ebay - suited to the input and output levels you are matching, or it’s not too many components, but it’s a separate project to design and build your own.

Your choice, in most cases,it’ll cost less than $10 to do it properly.

Thanks for the reply. Yes I'm aware of the plethora of ebay/aliexpress premade bits and bobs, but as I said, I'd like the breadboard this for learning.

Ok, so you need to get from ‘headphone’ level to a nominal 5V peak…
Basically like a small amplifier used with those cheap & nasty plastic speakers.

Line-level as you found already is too low to excite your 5V ADC needs, you need to kick out something more substantial!

Even if the amplifier output swings around 12V, you can use a resistor divider to bring it back in to 0-5V range for the analog input,

Remember, whatever source you’re using should operate at around 60% gain, otherwise any more, and you’ll introduce ‘clipping’ and unwanted distortion on the signal.

Ok thanks again. So basically I could stick with the LM386 for simplicity and feed that into a voltage divider to bring it back down?

I figure I can avoid some complexity around noise levels, frequency response, distortion etc usually employed in an audio preamplifier, as all I want to measure is an approximate 'volume' level of a sound source. Sound quality doesnt matter.

Yeah, i’d breadboard that to get it working, then finalise it once you’re happy.

Good luck.

Possibly the worst choice you could ever make for a preamplifier. Just use an op amp. You can often find simple signal amplifier circuits using them, in their data sheets or application notes.

I don't know everything about your application, but it's also possible that a one-transistor amp circuit could work.

Possibly the worst choice you could ever make for a preamplifier. Just use an op amp. You can often find simple signal amplifier circuits using them, in their data sheets or application notes.

Any suggestions that are well known and dont require symmetrical power supply?

It's relatively easy to bias an op amp from a single supply - just do some research. Thousands of musical instrument stomp boxes do it from a 9V supply.

If you plan to run it from 5V, get a "rail-to-rail" amp. Actually there are a good number of those available now, so many applications demand 5V operation...

Ok thanks. I'd already kinda figured from googling around that what I really needed was a 0-5V rail-to-ail opamp. But googling that is a minefield of wierd and wonderful unknown, usually SMD, sometimes expensive devices who's data sheets are beyond my full comprehension at this stage of my journey. Was hoping there might by something common that people could recommend that comes in a dip package, and that I might find other example circuit schematics to study. I guess I'll just buy random stuff from Ali and have a play.

The LM386 might "work" but it's a "power amplifier" for driving a speaker.

Here is a schematic for a microphone amplifier.

Of course you can leave-out the microphone and you can leave out R1 which powers an electret mic.

The gain is the ratio of R5/R4, = 82 = 38dB as-designed, but you can change those.

R2 & R3 make a 1/2 voltage divider to bias the output at Vcc/2 (so you can read the negative half of the audio signal).

The OPA344 is a "rail-to-rail" op-amp so the output can go from ground to Vcc. You'll want a rail-to-rail op-amp if you don't use higher and/or dual power supplies for your op-amp.

Decibels are relative... For example 0dBV is a reference where 0dB = 1V RMS. Or a voltage gain of 10 is 20dB of amplification. The amplification or change can be measured without a reference but the dB level is meaningless without a reference.

The basic Arduino has almost exactly a 60dB range... -60dB is 1/1000th so if 0dB is an ADC reading of 1023 (the maximum 10-bit count) then a reading of 1 is about -60dB. In order to read -60dB, 0dB will to be 5V peak-to-peak = 1.76V RMS (unless you don't need to go all the way to 0dB).

Also, with high gain noise usually becomes a problem. You are amplifying any electrical noise and -60dB can be "difficult" without careful design and a solid-quiet power supply,

Well, for an audio signal amp application using an op amp at a low voltage, you mainly need to look at the output swing, so first you need to understand what your output signal level requirement actually is. Have you considered limiting the range of the ADC to a lower voltage? You can often do it by changing the ADC reference voltage, which you can do with an Arduino command that I forget the name of right now. But if you set your ADC ref to 1.1V, it will more than quadruple the input sensitivity, therefore increasing the effective gain by more than 4. Maybe you don't need an amp.

OP probably means dBm. Or equivalent dBV into a standard resistive load of 600(?) ohms. It's been a while. :upside_down_face: :upside_down_face:

Ok great, I'll have a look into the OPA344, it's probably what I need.

Yep dbs are relative, I was just giving an example that my signal is far too low at the ADC.

In reality, the 'swing' doesnt need to be huge as all I require is an approximation.
E.g, if all I get at the ADC is values between 0-100 instead of the full 10 bit range, I can just amplify(multiply) in software. Its only to roughly measure signal level.

Also, with high gain noise usually becomes a problem. You are amplifying any electrical noise and -60dB can be "difficult" without careful design and a solid-quiet power supply,

Well I was thinking a simple passive Lowpass RC filter would help me. Again, the 'sound' of the audio doesnt matter, it's just to drive an envelope follower.

Why not just use the 1.1V ADC range? It's mentioned in the links you provided.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.