Go Down

Topic: How to mix mic and line out into a single chnnel (Read 5369 times) previous topic - next topic

buffer_overfly

Here is some information about powering electret mics.

You feed voltage to the mic through a resistor and the resistor allows the signal to ride on top of the voltage.   (If you connect the mic to power supply or battery without the resistor, the low impedance of the power supply will "short out" the audio signal.)
I said that the mic didn't work with a resistor, but actually I was providing power via a voltage divider, so there was 1 resistor and adding the second muted it. You were right after all.
I tried replacing the mic power source with a battery and no resistor and indeed it does not work as well.


Now I have a final problem.
I'm amplifying the electret mic by 250x (48dB) thanks to this opamp, and powering it with 2V (tested it with 3V and 1V and also works). The 2V are supplied through a voltage divider connected to Arduino's 5V pin. The divider is made of resistors of 220 Ohm. But there's an incredible noise coming from this resistor. The noise is a mix of hiss and a cyclic tone that comes from the Arduino's power regulator. When replacing the voltage divider with a battery, there's still a noise but it is mostly hiss. In either case I'm dissapointed with the result. Is there a way of getting rid of the noise? Please check my mic circuit:

Code: [Select]

5V----- 220 Ohm  ---------- 220 Ohm ------- GND
                   |                         |
                   |                         |
                   -----[ + ELECTRET - ]------
                   |                         |
                   |                         |
                   -------[ + 10uF  - ]-------
                   |                   
                   |------[ + 10uF  - ]----- 40 Ohm ------> To OPAMP
The competent programmer is fully aware of the strictly limited size of his own skull...(E.W.Dijkstra) (dammit only 140 chars?)

buffer_overfly

I have just discovered that the larger the mic resistor, the lower noise tone from the regulator. I've made it almost dissapear by replacing the 220 Ohm resistors with 10K ones. I hope the Arduino +5V can take this much.

So this is now my updated circuit:

Code: [Select]

5V----- 10K Ohm  ---------- 10K Ohm ------- GND
                   |                         |
                   |                         |
                   -----[ + ELECTRET - ]------
                   |                         |
                   |                         |
                   -------[ + 10uF  - ]-------
                   |                   
                   |------[ + 10uF  - ]----- 40 Ohm ------> To OPAMP


Still some background hiss, but sound is audible loud and clear.

If only there were a way of filtering out the hiss it would be perfect. I think it is coming from the opamp, even if the datasheet claims they are low noise. (I'm using NE5532 btw) 
The competent programmer is fully aware of the strictly limited size of his own skull...(E.W.Dijkstra) (dammit only 140 chars?)

polymorph

#17
Aug 06, 2015, 11:28 pm Last Edit: Aug 06, 2015, 11:30 pm by polymorph
What do you mean " I hope the Arduino +5V can take this much"?

Higher resistance means less current.

You are probably picking up digital noise that is present on the 5V line.


5V-----1k-------------10k----------10uF---Op Amp
            |      |          |
          0.1uF   10uF     Electret
            |      |          |
          Gnd     Gnd        Gnd


Why do you have a 10uF capacitor right across the microphone?
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

polymorph

Argh! Tough to get that to line up.

The 1k resistor and the 0.1uF and 10uF are to bypass noise to ground. You can run the electret from 5V with the resistor, so I've not bothered with a voltage divider. No capacitor across the microphone.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

buffer_overfly

Argh! Tough to get that to line up.
You can use the code tag, or a monospace font. That way all characters are of the same width, and whitespaces are easily aligned.
(I think the forum should allow to upload images, not only from URL but as an attachment, so that I could paste a proper schematic without having to upload it to a hosting service.)

The 1k resistor and the 0.1uF and 10uF are to bypass noise to ground. You can run the electret from 5V with the resistor, so I've not bothered with a voltage divider. No capacitor across the microphone.
Thanks man. My capacitor was actually across the second resistor in the voltage divider, and it was meant to filter the power noise  :smiley-lol: It proved to be pretty much useless.

I'll try your circuit. I'm skeptic about the 5V though (with my circuit, the higher the voltage in the mic, the greater the noise). It will be my third day with this mixer. The battery I was using for the arduino almost died (I ditched it just on time). Now the DC adaptor has yet more noise.

Audio is so hard.
The competent programmer is fully aware of the strictly limited size of his own skull...(E.W.Dijkstra) (dammit only 140 chars?)

buffer_overfly

@polymorph, i tested your circuit and most of the background hiss is gone. Audio quality is as good as a regular phone.

However this mic circuit has introduced a 100mV periodic noise ripple, that gets amplified and leaks to the output with 300mV amplitude. I think the +5V pin is the culprit, because the Arduino voltage regulator is the only periodic thing I can think of. This noise isn't hearable though.
The competent programmer is fully aware of the strictly limited size of his own skull...(E.W.Dijkstra) (dammit only 140 chars?)

polymorph

Code: [Select]

---------
   |
  R1


I can use the code tag, but it still shows it as proportional font in the window I'm typing into. So I have to keep hitting "preview" and moving things around.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Go Up