Pre-amp to connect microphone to speakers - Page 1
Forum section: electronics / beginners

author: SoundFan
author_rank: Contributor
timestamp: November 23, 2018, 01:24:52 pm
content: Hello,I am trying since a few days to make a good microphone pre-amp to connect my electret microphones to a speaker or headphones. I have tried some Arduino modules like the MAX9814 from Adafruit and a cheap chinese module that uses a transistor and a LM393 comparator. My project will be powered by Li-Po batteries and needs a very good audio quality. These Arduino modules do work but the sound quality isn't good enough. I have tried to make my own pre-amp using some op-amps but none of these worked well (I can only hear some distorted sound when I blow directly into the mic, but I can't hear my voice when I talk).The mic itself should have enough quality: I have tried connecting it directly to the mic input of my laptop and it sounds great.Could someone please help me ? I really would like to improve my results.

author: Zero999
author_rank: Super Contributor
timestamp: November 23, 2018, 01:46:00 pm
content: A power amplifier is required to drive a speaker or headphones.There's nothing wrong with the MAX9814. It's a perfectly good IC and includes an AGC (Automatic Gain Control) which means it adjusts the volume level automatically to match the sound picked up by the microphone.The LM393 is not an audio amplifier and is probably one of the worst things you can use. An op-amp won't be able to drive a speaker. It will current limit and give a distorted output. A common IC is the LM386, but it's fairly low powered.What are your output power requirements? How big is the speaker?

author: SoundFan
author_rank: Contributor
timestamp: November 23, 2018, 04:53:59 pm
content: @Hero999 First of all, thanks for your quick reply!I'm driving a very small 0.5W and 8 ohm speaker.You are right, the LM393 is totally inappropriate for the job but unfortunately the max9814 also doesn't work well in my project somehow (it is almost as bad as the transistor preamp with LM393).I won't be needing much energy at all. This 0.5W speaker and headphones are the only things I want to connect to the output. And even those won't be connected simultaneously.

author: IanB
author_rank: Super Contributor
timestamp: November 23, 2018, 05:08:32 pm
content: I have this page in my bookmarks list:http://www.techlib.com/electronics/audioamps.htmlYou may find something useful here?

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 23, 2018, 05:20:17 pm
content: Remember that electret condenser microphones require power (some call it "bias" but that is improper).Your computer provided the ~5V "plug-in power" when you tested it there.Here are a few examples of circuits which provide the power supply to the electret mic....Those circuits will work with most modern op-amps, so the specific numbers on the above schematic diagrams are only suggestions.

author: SoundFan
author_rank: Contributor
timestamp: November 23, 2018, 09:09:39 pm
content: @Richard CrowleyThanks for your fast replyYes I found out about that power consumption a few days ago. Can I use the first op-amp diagram you sent me and simply replace the LM741 by an OPA134 please ?

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 23, 2018, 09:34:58 pm
content: Yes, you can use almost any op-amp.The important part is the resistor that supplies power to the microphone,and the capacitor that blocks the DC power, but passes the AC audio signal.

author: commongrounder
author_rank: Frequent Contributor
timestamp: November 24, 2018, 12:06:42 am
content: I don’t believe the OPA134 will work with a single ended power supply. It needs at least +/- 2.5 volt rails. Of course the circuit can be modified for a split supply.

author: spec
author_rank: Frequent Contributor
timestamp: November 24, 2018, 03:18:28 am
content: Reply #4, schematic 3, has a few problems. It is probably an outline circuit just to show how to power the mic.Attached is the schematic for a practical circuit that should work.

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 24, 2018, 03:01:25 pm
content: Quote from: commongrounder on November 24, 2018, 12:06:42 amANY op-amp will work with a single-ended power supply:1) If you provide proper "virtual ground" (V/2) reference for the circuit.2) If the total voltage is adequate when "split in half".Quote from: spec on November 24, 2018, 03:18:28 amYes, that circuit does NOT show the proper "virtual ground" (V/2) as mentioned above.The circuit that @spec posted shows the proper V/2 voltage divider (R3/R3) that creates the "virtual ground"

author: Audioguru
author_rank: Super Contributor
timestamp: November 24, 2018, 11:49:40 pm
content: I think the electret mic preamp should be like this:

author: spec
author_rank: Frequent Contributor
timestamp: November 25, 2018, 05:29:44 am
content: Hi AG,Fancy seeing you in these parts.Nice mods- I didn't do any optimization on that circuit, so it was really an outline.I would suggest changing the opamp to a TSX711 or OPA191 as part of the improvements. As you say the OPA134 is not all that happy with a low Vcc.

author: Audioguru
author_rank: Super Contributor
timestamp: November 25, 2018, 03:49:01 pm
content: Hi again, Spec.I goofed on making changes to the schematic, this one is best:

author: SoundFan
author_rank: Contributor
timestamp: November 25, 2018, 04:59:41 pm
content: HelloThanks for all your great replies !I'm sorry that I didn't reply until now, I've been quite busy these days with my studies and meetings as well as some research project.I will try to test out these circuits and use 9V instead of 5, maybe this will finally make my project work.

author: spec
author_rank: Frequent Contributor
timestamp: November 26, 2018, 05:49:56 am
content: Quote from: Audioguru on November 25, 2018, 03:49:01 pmI goof all the time

author: Zero999
author_rank: Super Contributor
timestamp: November 26, 2018, 10:01:30 am
content: Quote from: SoundFan on November 23, 2018, 04:53:59 pmThe MAX9814 won't drive a speaker directly, if you attempt to, it will current limit and give lots of distortion.Quote from: SoundFan on November 23, 2018, 09:09:39 pmThe OPA134 will not drive a speaker directly either.You need to connect the output of the MAX9814 or OPA134 to a power amplifier such as the LM386 to drive a speaker.

author: Audioguru
author_rank: Super Contributor
timestamp: November 26, 2018, 04:27:07 pm
content: Most opamps have a minimum allowed load of 2 thousand ohms. It has a peak output current of only about 20mA which will produce a power output of about 0.0016W into an 8 ohm speaker.A cheap clock radio produces only 0.5W. Without any clipping distortion and an 8 ohm speaker, an LM386 little power amplifier produces 0.2W with a 6V supply or 0.45W with a 9V supply.If the microphone can hear the speaker then you will have acoustical feedback howling.

author: spec
author_rank: Frequent Contributor
timestamp: November 27, 2018, 05:47:18 am
content: Quote from: Audioguru on November 26, 2018, 04:27:07 pmI am not arguing- just interested. Where does that requirement come from?

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 27, 2018, 06:47:17 am
content: Quote from: spec on November 27, 2018, 05:47:18 amMost op-amps are used for internal circuit configurations where impedances are designed around optimal power consumption and/or signal-to-noise ratio. So there is no need to drive particularly low-impedance loads.However, there are some kinds of op-amps which ARE designed with lower output impedances because SOME circuits require driving lower impedances. For example op-amps designed to drive audio outputs where you might want impedances in the low 100s of ohms. And, of course some circuits which are designed to drive speakers where impedances are around 10 ohms.

author: SoundFan
author_rank: Contributor
timestamp: November 27, 2018, 08:41:41 am
content: Hello,I have tried out the circuit from AudioGuru and unfortunately it still doesn't work.Quote from: Hero999 on November 26, 2018, 10:01:30 amOK, I will be ordering some LM386s. I think using the LM386 directly won't be possible because of its low gain (x20), right ? I have found a post of someone using the LM386 to connect an electret mic to a speaker :https://circuitdigest.com/electronic-circuits/lm386-audio-amplifier-circuitIt seems like this works but I think the gain is really low here. If I connect the LM386 to the OPA134, which changes should I make to the circuits please ? Would the one I've attached work pleas ?

author: Zero999
author_rank: Super Contributor
timestamp: November 27, 2018, 09:41:07 am
content: Quote from: spec on November 27, 2018, 05:47:18 amData sheets typically show 2k when specifying the output drive. In reality there is no set minimum load impedance requirement. It's determined by the op-amp's maximum output current and the desired voltage swing. If the op-amp can drive 10mA peak, then it'll be able drive a 600Ohm load with a peak voltage of 6V.Quote from: SoundFan on November 27, 2018, 08:41:41 amHow much gain do you want? The LM368 configuration you linked to has a gain of 200, not 20, because C1 bypasses an emitter resistor inside the IC. The data sheet provides lots of information about configuring the LM386 for different gains.http://www.ti.com/lit/ds/sbos869/sbos869.pdfThe circuit you've posted with the op-amp and LM386 stages cascaded has a total gain of 200 000, which is far too high.The single stage LM386 circuit, with a gain of 200, will probably have enough gain to drive a small speaker, form an electrect mic.

author: Audioguru
author_rank: Super Contributor
timestamp: November 27, 2018, 04:19:19 pm
content: I think either the electret mic is connected backwards or it is not an electret mic, maybe it is a dynamic mic and the bias voltage is causing it to work poorly.EDIT: I think the tiny speaker (squeaker) is fried.

author: SoundFan
author_rank: Contributor
timestamp: November 28, 2018, 09:29:07 am
content: Quote from: Hero999 on November 27, 2018, 09:41:07 amI'm sorry, I thought I've read somewhere that the LM386 has a fixed gain of 20. I'll try that when the LM386s arrive.

author: SoundFan
author_rank: Contributor
timestamp: November 28, 2018, 09:31:24 am
content: Quote from: Audioguru on November 27, 2018, 04:19:19 pmI've tried different mics and they work fine if connected directly to the PC. They are unpolarized but I have tried them in both directions already. The "squeaker" (I like that name) might be fried but the headphones work well.

author: Zero999
author_rank: Super Contributor
timestamp: November 28, 2018, 09:59:31 am
content: Quote from: SoundFan on November 28, 2018, 09:29:07 amWhoops, I posted a link to the OPA196, when I meant to post a link to the LM386.http://www.ti.com/lit/ds/symlink/lm386.pdfThe LM386 can be configured for any gain between 20 and 200. Adding a 10µF capacitor between pins 1 & 8 increases the gain from 20 to 200. Including an additional resistor in series with the capacitor, enables the gain to be set to other values between 20 and 200. Page 8 of the data sheet shows a 1k2 resistor in series with the 10µF capacitor, gives a gain of 50.

author: Audioguru
author_rank: Super Contributor
timestamp: November 28, 2018, 01:49:02 pm
content: Quote from: SoundFan on November 28, 2018, 09:31:24 amYou did not read about the LM386 gain and did not read about the electret mic that isdefinitely polarized. It will produce no output if it is connected backwards. Its metal case is connected to its "ground" pin (if it has only 2 pins) and the Jfet inside needs a positive current.Why do you have such a tiny low power speaker? Headphones are tiny low power speakers.

author: SoundFan
author_rank: Contributor
timestamp: November 29, 2018, 02:22:21 pm
content: Quote from: Audioguru on November 28, 2018, 01:49:02 pmI do not really understand the purpose of your comment.I have read about the LM386 gain but must have mixed up that "fixed gain" part with another IC. I have read about so many op-amps in the last few weeks to try to find one that works for my project and I am quite busy with my medical studies, so it isn't surprising that I mix up some stuff. Where do you think did I get the number 20 ( which is correct if there is nothing connected to pins 1 and 8 ) from ?If the mic is polarized, how comes it has no marking on the pins to differentiate between the Gnd pin and the Vcc/Output pin ? And how comes it works on my PC and the LM393 circuit in either directions. I have seen many different electret mics online where both pins were clearly different since they were polarized but the ones I use don't have any such feature.I am really bad with Op-amps but I know how headphones work, thank you. My project simply requires a speaker of around the same diameter as the mic.

author: chemelec
author_rank: Contributor
timestamp: November 29, 2018, 03:02:13 pm
content: If your Speaker is THAT SMALL, It must be Really Low Power.Depending on its Impedance, the LM386 can Burn it out.You might consider Adding a Series Resistor, to Limit the current into it.

author: Audioguru
author_rank: Super Contributor
timestamp: November 29, 2018, 04:54:01 pm
content: An electret mic has a diameter of 6mm or 9.7mm. In old cell phones they were half that and in new cell phones they are a tiny little spec. I have a very small speaker (squeaker) that is 25mm in diameter that was in over-the-ears headphones.My very small speaker also works as a microphone but has no Jfet in it like an electret mic has so it has no polarity and works both ways like yours. Then you do not have an electret mic, yours is a dynamic mic that is a little speaker with a magnet on the back of it.A dynamic mic does not need and does not want the resistor used to power the Jfet in an electret mic. Try removing the resistor that powers your mic to see if it works much better without it.Here are some photos of electret mics:

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 29, 2018, 05:35:49 pm
content: It might be time for some photos. There are literally hundreds (perhaps thousands?) of different small microphone capsules. We really have no clue what you have there.

author: SoundFan
author_rank: Contributor
timestamp: November 30, 2018, 09:01:49 am
content: Quote from: Audioguru on November 29, 2018, 04:54:01 pmThose are electret mics, and I do also have an electret mic. I will use one like in your photos with polarity, then it will be easier to assure it to be working with the same circuits. Until now changing the direction of the mics didn't seem to have helped though unfortunately.

author: Audioguru
author_rank: Super Contributor
timestamp: November 30, 2018, 05:50:34 pm
content: You said that your electret mic works on your pc and on the LM393 circuit so it must be fine and the problem is with your opamp preamp and LM386 power amp circuit. Do you see on your mic where one pin connects to its metal case? Measure it with an ohm meter if you can't see it. That is the ground pin.

author: Zero999
author_rank: Super Contributor
timestamp: December 01, 2018, 02:29:47 pm
content: Quote from: SoundFan on November 30, 2018, 09:01:49 amDo yo have a schematic for the LM393 amplifier circuit? I've never seen an audio amplifier based on that IC before. I wonder if it's class D? Or perhaps you've got the part numbers mixed up or there's a printing error and it's really the LM386?

author: Audioguru
author_rank: Super Contributor
timestamp: December 01, 2018, 02:39:03 pm
content: I think there is another website forum about this circuit or it was in a "conversation" with me. I saw the schematic with the LM393 and I commented that it was probably a "hands clap detector".

author: Audioguru
author_rank: Super Contributor
timestamp: December 01, 2018, 03:08:33 pm
content: I found this in Google:

author: SoundFan
author_rank: Contributor
timestamp: December 01, 2018, 03:16:42 pm
content: I will use the electret mics with polarity from now on.The LM393 circuit is a clap module but not the one that AudioGuru is referring to (mine has only 3 pins). I do also have the 4 pin version but that doesn't work with headphones. And oddly enough, its quality is quite good for a clap sensor (but still not good enough)

author: Zero999
author_rank: Super Contributor
timestamp: December 01, 2018, 07:50:38 pm
content: Quote from: Audioguru on December 01, 2018, 02:39:03 pmQuote from: Audioguru on December 01, 2018, 03:08:33 pmThen the LM393 is not being used as an amplifier, but a comparator. It will not drive a speaker, unless you just want it to make a click, when it picks up a sound.

author: Audioguru
author_rank: Super Contributor
timestamp: December 01, 2018, 08:10:24 pm
content: The LM393 plays audio with lots of "overdrive" (because it has very high gain and no negative feedback) producing severely distorted squarewaves. Like acid rock "music".I think the transistor preamp had a lowpass filter to cut high audio frequencies letting the clipping from the LM393 produce the severe distortion.

author: Teledog
author_rank: Regular Contributor
timestamp: December 02, 2018, 01:23:49 am
content: Was looking for the same sort of schematic.A real PITA to build.Do an eBay search for "DC 3.7V-6V MIC AMP MAX9812L+TDA1308 Stereo Microphone Headphone Amplifier Module"Works like a charm! (only used cheap earbuds, but can go to an extremely high volume)There is already a DC bias on the electret mic input.Just plug in your electret mic, battery & headphones (small speaker?) & good to go.An AC->DC wall wart DOES cause a hum though..battery power is quiet.

author: SoundFan
author_rank: Contributor
timestamp: December 02, 2018, 06:53:27 am
content: Quote from: Hero999 on December 01, 2018, 07:50:38 pmIn my case it seems to be working as an amplifier, it really does output sound. I can even hear my voice with it.Quote from: Audioguru on December 01, 2018, 08:10:24 pmThat will probably be a problem, I really wish to get a good sound quality.Quote from: Teledog on December 02, 2018, 01:23:49 amThis module seems to be exactly what I've been looking for ! I just bought it and will give feedback about it when it arrives.

author: Zero999
author_rank: Super Contributor
timestamp: December 02, 2018, 09:52:30 am
content: That module looks good for small headphones, but its output, with low distortion, is only specified as 80mW into 8Ω, so won't be very loud if you use it to drive speakers.

author: Audioguru
author_rank: Super Contributor
timestamp: December 03, 2018, 02:04:00 am
content: The MAX9812L is a mono mic preamp and the TDA1308 not made anymore was a stereo headphones amplifier. Maybe ebay is selling old ones or a Chinese knock-off. The TDA1308 has its output power (typically only 40mW) spec'd with a 5V supply and 32 ohm headphones. Its output power is much less into 8 ohms.

author: SoundFan
author_rank: Contributor
timestamp: December 03, 2018, 04:15:01 am
content: I've also noticed the low-power output of this module. I won't keep this module for the final version of my project anyway but I would like to reverse-engineer it to get a better understanding of why it works. Afterwards, I would like to modify the circuit to use some better suited ICs.

author: Zero999
author_rank: Super Contributor
timestamp: December 03, 2018, 09:14:26 am
content: Quote from: Audioguru on December 03, 2018, 02:04:00 amNo, the output is higher in to 8 Ohms than 32 Ohms.EDIT: You were right. It's current limited, so reducing the load impedance below 16 Ohm will reduce the output voltage when clipping occurs, see my post below.Quote from: SoundFan on December 03, 2018, 04:15:01 amTry searching for the data sheets for he ICs used on Google. I doubt you'll be able to replace them with other ICs because they'll be specifically designed around them.There isn't that much which can be learned from looking at these modules because all the ICs are black boxes. If you want to learn you're better off looking at older discrete audio amplifier schematics.

author: SoundFan
author_rank: Contributor
timestamp: December 03, 2018, 10:12:48 am
content: Quote from: Hero999 on December 03, 2018, 09:14:26 amYes, since power (W) = U²/RQuote from: Hero999 on December 03, 2018, 09:14:26 amI don't just want to look at them (you're right, that would be totally pointless), I would like to look at the gain range used and at the circuit in general, I just want to find the difference between the method described in this topic and the way the board is designed, so that I can try to make a better working circuit.

author: Zero999
author_rank: Super Contributor
timestamp: December 03, 2018, 03:07:25 pm
content: Quote from: SoundFan on December 03, 2018, 10:12:48 amYes, that's what I initially thought but I was wrong. Audioguru was right. The output is current limited, so the output power will be higher into a 32 Ohm load an highest into a 16 Ohm load. P = I2R.In real life it will probably make little difference because a typical 8 Ohm speakers actually have a higher impedance than 8 Ohms at the frequencies they work best at. I don't know whether the same is true for headphones.QuoteNo doubt the modules will be similar, if not identical to the example schematics on the data sheets. I doubt you'll learn much by studying them.https://datasheets.maximintegrated.com/en/ds/MAX9812-MAX9813L.pdfhttps://www.nxp.com/docs/en/data-sheet/TDA1308.pdf

author: SoundFan
author_rank: Contributor
timestamp: December 06, 2018, 04:16:45 am
content: Thank you very much ! The module works well.I just have a few more questions please, I don't know whether I should open a new thread or not:Which are the biggest electret mic capsules out there please ? I have seen 26mm ones but they are hard to get in my location. Ideally, I would like to find one with a diameter of around 40mm to experiment with but I don't think that there are any. It doesn't actually need to be an electret mic, any 40mm mic would be really great.I had once read a post on another forum where someone said he's sometimes making his own electret capsules in his free time. I know it probably won't be easy, but do you know how it is possible to do that please ? Which materials would I need ? Is there any tutorial out there for that please ?

author: Richard Crowley
author_rank: Super Contributor
timestamp: December 06, 2018, 05:51:49 am
content: There are many sources of large-diameter condenser ("LDC") microphone capsules. When you start getting up into those sizes, they are no longer electret (permanently-charged).You will have to provide a rather high-voltage to "charge-up" the condenser, and then provide an extremely high-impedance first-stage amplifier. This is quite esoteric circuit design and construction. It requires extraordinary cleanliness and isolation to avoid leakage of the high voltage, the very miniscule audio signal and the very high impedance.There are LDC microphone kits available to help with the very tricky bits. A "scratch-built" condenser microphone (of any size) is not the kind of circuit most people find they can accomplish before they have a good amount of experience.Primo is a popular source of mic capsules for people making their own mics.https://www.primomic.com/Dynamic and electret capsules up to around 14mmLarger capsules are available from places likehttps://microphone-parts.com/collections/capsulesMany of those run to rather expensive, so be prepared.OTOH there are many offers on Ebay from vendors in China selling LDC capsules for < US$20https://www.ebay.com/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=large+diaphragm+condenser+microphone+capsule