7
\$\begingroup\$

I was wondering which component is better for using as voltage controlled switch for audio signals (e.g. music signal from mp3 player). Should I use MOSFETs or BJTs? The max rail voltage is approximately 6 V?

I cannot use any components other than BF199 BJT, IRF3205 MOSFETs, or STP16NF06L MOSFETs. My audio signal is DC biased so it does not go into the negative region.

Edit: You stated that the transmission gate chip is made out of MOSFETs, so will MOSFETs be better for minimizing distortions?

\$\endgroup\$
6
  • 3
    \$\begingroup\$ -1 for this lame nonsense about being limited to several very specific models of transistors. \$\endgroup\$
    – Kaz
    Apr 21, 2013 at 7:21
  • 8
    \$\begingroup\$ @Kaz: I have three theories: homework (?), "what I have at home," and "what RadioShack sells" \$\endgroup\$ Apr 21, 2013 at 7:23
  • 3
    \$\begingroup\$ @angelatlarge Also: "those are the only transistor names in the schematic program I downloaded." \$\endgroup\$
    – Kaz
    Apr 21, 2013 at 7:33
  • 3
    \$\begingroup\$ To be pedantic, a MOSFET is a transistor: Metal Oxide Semiconductor Field Effect Transistor. \$\endgroup\$ Apr 21, 2013 at 8:40
  • 1
    \$\begingroup\$ Is your audio signal DC biased approximately midway to the 6 Volt rail, or is it ground referenced, i.e. going both positive and negative? \$\endgroup\$ Apr 21, 2013 at 8:42

6 Answers 6

16
\$\begingroup\$

The super quick answer is: None of the parts that you have selected are appropriate for switching line-level (headphone level) audio signals.

Off Topic Rant: It is often ill-advised to restrict the parts or techniques used in the answers. I covered this briefly in an answer on meta.EE.SE: Does EE.SE have a problem with the treatment of newbies? The old saying goes, "If all you have is a hammer, then everything looks like a nail." Currently, you only have a hammer. But you have no nail. Get the right parts and you will be much happier.

Long Answer:

The main issue that you have is that you want to switch a bipolar signal (a signal that has voltages that can be positive or negative), and you have limited power rails to use (+6v).

The Bipolar Junction Transistor, in this case the BF199, is not going to work. Ok, if you used enough of them, in a particular configuration, then maybe. But I wouldn't wish that on an EE with 20+ years of experience, and certainly wouldn't suggest that for a novice.

The MOSFET approach could be made to work (as Dave Tweed) suggests. But, there is a catch. Let's say that your audio signal can vary from +2 to -2 volts and Vgs(th) Max of your MOSFET is 4 volts. Then the gate voltage that you put on your MOSFETs must switch to +6 and -6v. The reason for this is when your switch is ON, you do not want the reverse body diode of the MOSFET to be conducting any current. And for that to happen, you need to have your MOSFET to stay on for any possible voltage of the audio signal.

If your gate voltage is less, the MOSFET might be turning on and off and causing the diode to conduct. Because the switching time of the diode is not zero, and the diodes are really crappy diodes, there will be some distortion added. The amount of distortion will depend on the MOSFETs used, and is really hard to estimate. The resulting audio could be "telephone quality", or might be reasonable for the average listener. In general, the smaller and faster the MOSFET the less distortion you will have. The two MOSFETs you selected are not small or fast.

So, you could get the MOSFETs to work, but you will need + and - power rails that are probably different than what you have available right now.

The other issue with your MOSFETs is that they are just huge. Physically. You will need four of them to switch one stereo signal. If you are muxing several channels together then you will need 8 or more. That's a lot of MOSFETs.

If we consider solutions that are outside of your selected MOSFETs or BJTs: Then an analog switch chip such as what Dave Tweed suggested, or similar ones by Maxim Semi, are good solutions. Pay attention to the On Resistance of these parts because that could be relatively high (30+ ohms for the cheaper ones). But otherwise, these chips are easy to use and effective. Relays are also good, especially when audio quality or a low on resistance is required. Latching relays could decrease power requirements by a lot. Another solution is to use a J-FET. J-FETs are the cheapest solution and have good to excellent audio quality, but are difficult to control because they require a huge voltage swing on their gates in order to turn on/off correctly.

If you can get away with a relay, I would go for that. Easy to use, super high audio quality, and mostly bullet proof. The down side is higher power consumption and not suitable for mobile applications (shock and vibration). My second choice for you would be an analog switch. Good audio quality and easy to use. A distant third choice are the J-FETs. Hard to work with, good audio quality, and inexpensive. MOSFETs are fourth. And BJTs are a super distant fifth choice.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Wait now, "max rail 6V" could mean that the device being built works on 0 to 6V, and the audio is cap coupled in to a 3V DC level. \$\endgroup\$
    – Kaz
    Apr 21, 2013 at 7:27
  • \$\begingroup\$ @Kaz Yes, it could mean that. But it could also mean a bunch of other things that the OP hasn't told us. But let's say that the audio signal goes from +1v to +5v and Vgs(th)=4v. Then the gate drive of the MOSFETs needs to be at least -3v to +9v. In this scenario, you might get away with a single MOSFET, but your power rails and MOSFET driving doesn't get much easier. \$\endgroup\$
    – user3624
    Apr 21, 2013 at 15:01
9
\$\begingroup\$

For bipolar AC audio signals, your best choice would be a "transmission gate" chip such as CD4016 or CD4066, or an analog multiplexer chip, which is an array of such gates with a common connection.

These devices have the most symmetrical characteristics, minimizing distortion of audio signals.

Internally, they are a pair of back-to-back MOSFETs driven by complementary control signals.

\$\endgroup\$
4
  • \$\begingroup\$ So no need for a negative voltage on these? \$\endgroup\$
    – user2497
    Aug 14, 2020 at 10:51
  • \$\begingroup\$ @user2497: I never said that. The audio signal must remain between the rails, so you have a choice of either adding a DC bias of Vcc/2 to the audio signal for a unipolar supply, or using positive and negative supplies on the gates. \$\endgroup\$
    – Dave Tweed
    Aug 14, 2020 at 13:43
  • \$\begingroup\$ That sounds interesting, how would you go about doing that? \$\endgroup\$
    – user2497
    Aug 14, 2020 at 14:03
  • \$\begingroup\$ @user2497: See the application notes in the datasheet. \$\endgroup\$
    – Dave Tweed
    Aug 14, 2020 at 14:11
5
\$\begingroup\$

If you really want to switch audio with little more than a simple transistor, consider a circuit like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Basically what you do is short the input to ground by enabling the transistor. Disadvantage is that the output level will be at least 6dB lower than the input level. If you want to keep the signal level the same, you'll need an output amplifier.

\$\endgroup\$
5
  • 7
    \$\begingroup\$ And then if you get an output amplifier, the simplest thing will be an op-amp. In which case, you might as well find an op-amp that has a shutdown pin that puts its output into a high-Z state, and route the !enable logic there. \$\endgroup\$
    – Kaz
    Apr 21, 2013 at 7:36
  • 4
    \$\begingroup\$ This circuit will create a very loud pop every time the audio is switched on/off. If the audio is enabled, then the DC level at the collector of the NPN is +6v. If "muted" then the collector voltage will be 0v. When you switch between enabled and muted you will have a 6-ish volt spike on the output. The polarity of the spike will depend on if you are enabling or disabling the audio. This spike is likely several times bigger than the typical audio level, and will happen even if the audio is "silent". \$\endgroup\$
    – user3624
    Apr 21, 2013 at 15:07
  • 3
    \$\begingroup\$ Oh, and you MUST used a buffer on the output. Without the buffer, you have an output impedance of 20+ K ohms. Any capacitance on the output (downstream from this device) will cause some high-frequency attenuation. A buffer will give you a low output impedance, and much better frequency response. \$\endgroup\$
    – user3624
    Apr 21, 2013 at 15:13
  • \$\begingroup\$ @DavidKessner true. Of course best solution is using a bilateral switch, a relay or something similar, but those component's aren't on the list. To suppress the pop I could add an extra capacitor between base and emitter, but it is improving a circuit that is defect by design. Of course lowering the 6V power supply will improve behaviour quite a bit, probably enough to keep the cones in the loudspeaker. \$\endgroup\$
    – jippie
    Apr 21, 2013 at 15:13
  • \$\begingroup\$ You should eliminate the +6 V altogether and connect R1 and R10 to ground. Q1 Q4 should be specialized muting transistors that have high reverse hFE. R2 R11 can typically be 1 kΩ, R1 R10 can be 100 kΩ, and R9 R13 can be eliminated, so output impedance is 1 kΩ. \$\endgroup\$
    – endolith
    Jul 19, 2016 at 17:30
5
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

The stock el cheapo way of doing this that you find in Japanese cassette decks turns the bjt upside down so it is operating in reverse mode. This is not good for a headphone out, but works well for line out at consumer levels. Note that the output impedance is 2.2k, not good if you need to run long wires. This is pretty pop-free and effective at muting power-on glitches. You have to use a transistor that has good reverse beta to get a really low VCEsat for good muting. The drawing shows 2n3904 but that is just because the drawing editor would not accept the exotic transistor specs. If you use 2N3904 or similar you will not get complete muting. With good symmetrical transistors with high reverse beta you can get VCEsat in the sub-millivolt range.

Please note, the transistor is intentionally connected backwards, it is not a drawing error!

\$\endgroup\$
4
  • 1
    \$\begingroup\$ It doesn't matter which way you connect the transistor. The muting transistors are designed to have high gain in both forward and reverse bias, since they need to mute both positive and negative signal voltages. \$\endgroup\$
    – endolith
    Jul 19, 2016 at 17:34
  • \$\begingroup\$ why would it ever be drawn backwards / upside down then? \$\endgroup\$
    – Frederick
    Mar 20, 2023 at 1:26
  • 1
    \$\begingroup\$ In this situation the transistor is always connected "upside down" (collector to ground) because this gives the best muting, lowest DC offset in the on state. To understand this better you need to study up on bipolar transistor geometry, a subject which is pretty much dead in modern-day electronics. In the old days (70s) we used to use 2N3638 in this situation, many audio circuits use the obsolete 2SC2878, today we would tend to use MOSFET switches or Just Go Digital. \$\endgroup\$
    – audioTech
    Mar 27, 2023 at 18:07
  • \$\begingroup\$ @audiotech I love and upvote your solution. It is nice to enhance our know-how. BTW, I am buying a CD player and I am reading a lot of articles. This one shows the "mute reverse transistor" is still used... but for the author it isn't reliable (at least in this specific product design): diyaudio.com/community/threads/… \$\endgroup\$
    – Massimo
    Oct 12, 2023 at 12:49
2
\$\begingroup\$

Assumption: Audio signal is a +4 dBU line level signal DC-biased to not go into negative region. Audio source has a low output impedance.

Assumed signal voltage, as per above:

  • Vsignal = 1.737 Volts peak + 1.8 Volts DC bias

The STP16NF06L N-channel MOSFET can be used as a voltage controlled switch, thus:

schematic

simulate this circuit – Schematic created using CircuitLab

Note that the signal will be clipped when the signal voltage approaches the linear portion of the MOSFET's VGS, which runs typically quite a bit higher than the VGS(th). While the datasheet states a minimum VGS(th) of 1 Volts, no maximum is given.

For a 6 Volt control input to the Gate, and the assumed signal voltages above, the MOSFET should show a low on-resistance RDSON at VGS not greater than 2.463 Volts.

The Line_out signal will require a buffer, to avoid attenuation due to loading.

A simulation in Falstad is available here.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ This circuit will suffer from pops in the audio when muting and unmuting. Using your assumptions, Line_In will be 1.8v if silence is coming in. But when muted, the output will be 0v. Switching between muted and silence will cause Line_Out to switch between 0v and 1.8v-- which is a pop that is louder than the loudest audio signal allowed by this circuit. \$\endgroup\$
    – user3624
    Apr 21, 2013 at 16:57
  • \$\begingroup\$ @DavidKessner Agreed, but the problem statement didn't allude to such concerns, so they're not addressed in the answer. If you'd like to add a solution to my answer or your own, that'd be nice. My stance for this question is that somewhere down the chain there'll be an audio output device with its AC coupling and pop-click filter. \$\endgroup\$ Apr 21, 2013 at 17:03
  • \$\begingroup\$ One solution is to have your own local "DC Bias Rail". Use a DC blocking cap on the input, and a 10K resistor to the bias rail, to force the audio to be biased at an appropriate level for your circuit. Then, instead of having the 1K resistor to GND, make it a 10K resistor to the bias rail. And while you are at it, put an RC filter on the gate of the MOSFET to slow down the switching speeds. But, I fear that while this is not a difficult thing to do, it might be too much for the OP. Oh, there is no such thing as a "pop-click filter" that can remove this kind of pop. \$\endgroup\$
    – user3624
    Apr 21, 2013 at 17:17
  • \$\begingroup\$ Yup, it's going to be overkill for this question, going by question level. \$\endgroup\$ Apr 21, 2013 at 17:24
0
\$\begingroup\$

The only component that you can use as a voltage-controlled switch is a MOSFET. A BJT (bipolar junction transistor) is a current-controlled switch. The collector–emitter is controlled by the base–emitter current. If you want a voltage-controlled switch, you should use a FET/MOSFET.

The model of the MOSFET depends on the voltage and power dissipation. In this case, you could probably use either one.

\$\endgroup\$
1
  • \$\begingroup\$ This answer is slightly misleading - you can use a BJT as a voltage controlled switch providing you limit the current into the base. \$\endgroup\$
    – Andy aka
    Apr 21, 2013 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.