I want to carry background audio over a mic channel, and on top of it I'd like to inject some DTMF tones coming from a line-out connector.
Let's assume the mic pre-amp expects a signal in the 10s of mV peak-to-peak range, and I already have attenuated the line-out signal to these levels (using a pad):
|--------- Mic (environment sound)
|
Mic input <-------|
|
|--------- Attenuator pad <- DTMF generator line out
How can I mix those two signals into a single channel?
I could use a splitter, but then the (attenuated) DTMF tones might propagate to the mic and make it vibrate. Would this be harmful, or produce sound?
Normally the input resistors are equal__*__, but it's certainly possible to have unequal gains for the line & mic signal If you want a microphone-level signal out of the circuit you can have a gain of less than one (attenuation) for the line-level input, or unity gain for the line-input and amplification on the mic input.
I could use a splitter, but then the (attenuated) DTMF tones might propagate to the mic and make it vibrate. Would this be harmful, or produce sound?
There's a "rule" that you should never connect two outputs together. i.e., You shouldn't connect two CD players to the same amplifier. However, it's generally OK to connect two inputs together, such as connecting a CD player to two amplifiers.
* In an audio mixer there are usually faders (volume controls) on each input, and a mic preamp for any mic-preamp, and all of this is (plus usually a master volume control) in front of a unity-gain summing amplifier.
P.S.
Just FYI - Your drawing is clear but it's traditional for signal flow to go from left to right (with inputs on the left and outputs on the right).
Run the two signals thru two 10K resistors, feed the junction into the LM386 input.
LM386 is basically a power amp, not an op-amp where you would use negative feedback from the output to create a gain stage for example.
CrossRoads:
Run the two signals thru two 10K resistors, feed the junction into the LM386 input.
LM386 is basically a power amp, not an op-amp where you would use negative feedback from the output to create a gain stage for example.
Ok, no problem , I also have some 5532s. Are they good for the job? Do I need to use the inverting configuration?
And about the summing amp output: What I actually need is to mix the signals, not to add them. If I pick resistors with the same value, then the output would be -(V1 + V2). That's twice the expected amplitude of the signal. I could select the offset resistor to be 1/2 the input resistors, and then I'd get an output in the order of -((V1 + V2)/2). But then again if there is sound in only one of the inputs, the output would be half the expected amplitude!
Another possibility would be to give one of the input channels preference over the other one. For instance, if there are DTMF tones, then pick that channel and mute the mic. The rest of the time, output the mic. Is there a circuit for that?
But there's something I don't understand. If there's this rule of not connecting 2 outputs together, then why is it allowed at the resistor junction?
As you suspected, one signal goes back-into the other output... i.e. The DTMF signal will go back into the mic and move the diaphragm.
But it gets worse... Most solid state circuits have a source impedance much lower than the impedance they are intended to drive. When one circuit tries to drive another output, you get excessive current.
In the case of the microphone and DTMF circuit, the low impedance of the DTMF circuit will probably kill the microphone signal. (But, the mic probably won't get permanently damaged.)
The resistors will prevent this from happening. (Some signal will get back into the mic, but it will be attenuated.)
You will loose about half the signal (with two equal outputs and two equal resistors) but you should still have enough signal to drive an amplifier, etc. If the input impedance of whatever you're connecting to is low (compared to the resistors) you can loose more than half your signal.
For example.... An audio amplifier that's designed to drive an 8-Ohm speaker usually has an output impedance (source impedance) of less than one Ohm. If you connect two amplifier outputs together, each amplifier sees the other as a low-impedance load and poof!
Or if you connect two digital outputs together, one output can be trying to go high while the other is trying to go low. The two outputs will be "fighting each other", you'll have an undefined state, and again excess current and poof! (There are some open-collector digital outputs that are designed to be "or-ed" together.)
Depending on the microphone, it could damage it. A dynamic microphone is prone to damage.
An LM386 won't isolate the signals much. An Op Amp in the Summing configuration will absolutely isolate the inputs, as long as you don't overdrive the output.
Do you really mean you wish to mix them? As in, the frequencies of the DTMF and the microphone mix to form sum and difference frequencies?
Or do you just wish to be able to hear both the microphone and DTMF tones? If so, that is summing, not mixing.
I did a test wiring both outputs. When the DTMF signal was null, the mic could be heard. But when the DTMF tones kicked in, odd "electronic" noises were heard in the phone mic, and the volume of the signals dropped.
I'll try the summing amp, and I hope the signals can be heard.
Do you mean that you could hear noises coming from the microphone itself? Not good. You can quickly destroy a microphone that way.
A dynamic microphone is built the same way as a magnetic coil speaker. Except extremely fragile, light, and not suited to having any kind of voltage applied to it.
I have built a summing amplifier, and it works fine. This is what I've done:
Electrect mic (V1) -----> ------------
| |
| | -----> Vout -------> Phone mic
| |
Line out (V2) -----> ------------
Although not depicted, R1 is 100 Ohm, R2 is 6.7 kOhm, and Rf (from the opamp virtual earth to Vout) is about 100 Ohm.
I've tested it with only V2, and it gets correctly attenuated to 40mV peak to peak centered at 0V.
I assume V1 will get correctly mixed as well. However, I now have two additional problems:
Problem #1: when wiring an electrect mic in V1, nothing from this mic is heard in Vout.
I've never worked with electrect mics, so I'm probably doing something wrong.
I've found that when connected directly directly to a phone, the mic DC offset is between 1.2V and 1.5V. Does an electrect mic does need external power to work? I thought it was just like a speaker but inverted, transforming air vibration into a very small voltage. My mic at V1 does not have power, and although I think it might generate a small amplitude signal when approached to a loud sound source, it probably is about 10mV in amplitude and my scope is not able to show it as it gets mixed with its own electrical noise. Do I need to add external power to this V1 mic to get a strong enough signal added to Vout??
Problem #2: Vout is correct but when connected to the phone mic, nothing can be heard
This is probably the same problem as the above one. Remember that my Vout signal is centered at 0V. I plugged it directly to a phone mic input, and I was able to hear it briefly, but then the phone switched to its own mic ignoring the audio jack input. To begin with, I don't know if it is a good idea to connect the output of an opamp to a DC source like the phone mic input. Can this DC offset get into the opamp and cause trouble? Or should I add my own offset to Vout before connecting it to the phone mic input?
buffer_overfly:
I have built a summing amplifier, and it works fine. This is what I've done:
Electrect mic (V1) -----> ------------
| |
| | -----> Vout -------> Phone mic
| |
Line out (V2) -----> ------------
Although not depicted, R1 is 100 Ohm, R2 is 6.7 kOhm, and Rf (from the opamp virtual earth to Vout) is about 100 Ohm.
I've tested it with only V2, and it gets correctly attenuated to 40mV peak to peak centered at 0V.
I assume V1 will get correctly mixed as well. However, I now have two additional problems:
**Problem #1: when wiring an electrect mic in V1, nothing from this mic is heard in Vout.**
I've never worked with electrect mics, so I'm probably doing something wrong.
I've found that when connected directly directly to a phone, the mic DC offset is between 1.2V and 1.5V. Does an electrect mic does need external power to work? I thought it was just like a speaker but inverted, transforming air vibration into a very small voltage. My mic at V1 does not have power, and although I think it might generate a small amplitude signal when approached to a loud sound source, it probably is about 10mV in amplitude and my scope is not able to show it as it gets mixed with its own electrical noise. Do I need to add external power to this V1 mic to get a strong enough signal added to Vout??
**Problem #2: Vout is correct but when connected to the phone mic, nothing can be heard**
This is probably the same problem as the above one. Remember that my Vout signal is centered at 0V. I plugged it directly to a phone mic input, and I was able to hear it briefly, but then the phone switched to its own mic ignoring the audio jack input. To begin with, I don't know if it is a good idea to connect the output of an opamp to a DC source like the phone mic input. Can this DC offset get into the opamp and cause trouble? Or should I add my own offset to Vout before connecting it to the phone mic input?
How can I solve these two problems?
I've somehow solved problem #2 adding a voltage bias of +1V to my Vout. So now the V2 signal is audible in the phone mic.
Problem #1 still unsolved. The V1 mic is one of those PC mics you might use for skype or gaming. It has an on/off switch and a volume knob. When connected to the phone directly, the L channel connector is at 2V, and it works. I've tried powering the L channel with 1V through 1K resistor and nothing. Tried with 1V and no resistor and still nothing heard. I think the phone gaves it 2V, but at 1V it should be heard a little.
[u]Here[/u] 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.)
Then, you add capacitor in series with the audio output to block the DC power from feeding-into the audio circuitry.
(If your DTMF circuit puts-out DC, you may need a capacitor in series with that signal too.)
A computer soundcard has this circuitry is built-in.
USB mics essentially have a soundcard built-into the mic.
Battery powered stage/PA electret condenser mics have the resistor & capacitor built into the mic.
Studio condenser mics (usually not electret condensers) also have circuitry built-into the mic with "phantom power" supplied by the preamp, mixer, or interface.
Finally managed to get decent audio mixing!!!!! I was about to become crazy, but then I realized that:
The audio jack connector I was using for the V1 mic was broken and only the right channel worked. I was powering the left (broken) pin. Changed the power to the right channel and now its fine (does not matter at all because the mic is mono)
The -5V wire for the opamp was loose
Also I opened the damn mic with an screwdriver and it is just an electret mic after all with nothing else inside (except the volume knob and the mute button). The positive terminal is soldered to L and R and the negative to ground (sleeve). It needs exactly 2V and needs 100x amplification to be heard loud and clear in Vout. However this amplification is not needed when connected directly to the phone (does it have an adaptive amplifier or something?)
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.)
You are right and every schematics I've seen so far are as you say. However I tried that and it does not work. This mic needs exactly 2V directly on the positive pin. Any resistor in between and the sound is muted, no matter how small. From that pin I have added a capacitor in series to remove DC, and finally the R2 resistor that goes to the opamp virtual ground.
To achieve 100x amplification, I needed to change resistors for R1 and Rf in the summing amplifier circuit. R1 is a 100 Ohm resistor and Rf is a 1K one. That forced me to change R2 as well, so now it is 100K to attenuate the DTMF tones to 1/100 (to 60mV amplitude).
And this is all for now. Probably I'm still doing bad things but the audio is heard, the phone is not damaged, and the rule of not wiring two inputs together is observed. I've yet to solder the actual circuit in the perfboard, but I'll wait until the 8PIN sockets arrive (I don't want to burn those opamps).
DVDdoug: [u]Here[/u] 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:
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.
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 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.
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.)
polymorph:
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 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.