MOSFET As Analog Switch? - Page 1
Forum section: electronics / beginners

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: February 01, 2017, 06:44:48 pm
content: Hey everyone,I have a microcontroller with only a single ADC input and have three analog sources (potentiometers set up in a voltage divider configuration). I was considering the different options for a simple, low resistance and cheap analog switching method.I only need to sample these three potentiometer voltages every 10ms or so and was trying to choose between an off-the-shelf I2C quad-input ADC, a 4051 multiplexer and a solution with MOSFETs only. Would something like the circuit below work if I were to use MOSFETs only?

author: 8086
author_rank: Super Contributor
timestamp: February 01, 2017, 06:52:12 pm
content: You would need to consider the followingIs the analog output going to always be below the logic voltage minus the mosfet VGS threshold (at the desired current)? If not, the MOSFETs won't turn on.Will the value of the potentiometers be in the range that the MOSFET's RDSon is also? i.e. will the MOSFET's resistance affect your analog output significantly?

author: Benta
author_rank: Super Contributor
timestamp: February 01, 2017, 06:55:45 pm
content: 74HC4051 or 74HC4052.It can't be done simpler or cheaper.

author: Zero999
author_rank: Super Contributor
timestamp: February 01, 2017, 07:21:17 pm
content: Quote from: Benta on February 01, 2017, 06:55:45 pmYes, I agree. Much easier than messing around with MOSFETs and possibly cheaper too.

author: hughes_k
author_rank: Contributor
timestamp: February 01, 2017, 07:36:16 pm
content: You stated a need for "low resistance." The multiplexers provided will have ~80 ohms resistance per channel, which, though higher than the typical MOSFETs, is still probably fine for your application.Whether this series resistance affects your readings could be determined by comparing it to the input impedance of your MCU ADC input. In particular, the equivalent input resistance and the capacitance on that input and the traces connected to it. Those will affect your accuracy and the settling time.

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: February 01, 2017, 07:37:16 pm
content: Ah, of course; since the potentiometer would swing full-scale between 0 and 5V, I don't think it would be suitable. If I adjusted the circuit such that the MOSFET's gate voltage is at a much higher voltage (e.g. 12V) would that allow for switching given that VGS is relatively low?In terms of the RDSon, the 4051 datasheet claims an approximate figure of 80 ohms, an order of magnitude greater than a single MOSFET device but would this make a considerable difference at such low currents (due to high impedance ADC input)? Would I be better off using an analog switch (e.g. a CD4066) rather than a multiplexer due to their lower on-resistance?EDIT: Oops hughes_k looks like I was writing as you posted! How can I prevent issues with capacitance on the input lines? Also, I am a bit wary of temperature dependency given the 4051 datasheet - can this affect reading accuracy/repeatability of the readings or is it too low of a resistance change?

author: Kleinstein
author_rank: Super Contributor
timestamp: February 01, 2017, 07:51:39 pm
content: The typical µC internal ADC have an input impedance in the 1 M range, and work well with source impedance in the 1 K-50k range. So there is little need to worry about the on resistance in the 100 Ohms range.There are a few MOSFETs with separate substrate pin that might work, but they are usually more expensive than an HC4053 or similar.If you prefer single switches or an MUX depends on the application. The MUX only needs 2 lines to chose the channel.Many modern µC have several input pins. So a slightly larger µC might be an option too.

author: Ian.M
author_rank: Super Contributor
timestamp: February 01, 2017, 07:59:10 pm
content: No. Your discrete MOSFET circuit is FUBARED as drawn, no mater what voltage you drive the gates with. Consider the MOSFET body diodes and the case where one potentiometer is set to a voltage more than 0.6V higher than the lowest one.Kleinstein has pointed out that you need MOSFETs with a separate substrate pin to avoid this issue, but you then have to bias the substrate pin, and if you take it too far negative of the Source the substrate-channel junction acts as a JFET gate, taking the channel towards cutoff, increasing the On resistance.

author: Benta
author_rank: Super Contributor
timestamp: February 01, 2017, 08:58:00 pm
content: Thane, you're overthinking this.The multiplexers exhibit a series resistance looking into a high-impedance load (I hope, you are very secretive about microcontroller type and potentiometer resistance).Whether each switch has 100 ohms or 1 kohm of resistance is not going to make difference worth caring about.

author: Zero999
author_rank: Super Contributor
timestamp: February 01, 2017, 11:18:39 pm
content: Quote from: Thane of Cawdor on February 01, 2017, 07:37:16 pmThe resistance of the of the 74HC4051 is negligible at such low currents.The CD4066 has an even higher on resistance than the 74HC4051.http://www.ti.com/lit/ds/symlink/cd4066b.pdfSince you only need a three way switch, you could use the 74HC4052, dual channel four way multiplexer and connect both channels in parallel, which will halve the on resistance.http://www.nxp.com/documents/data_sheet/74HC_HCT4052.pdf

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: February 02, 2017, 06:01:43 am
content: Sounds good, are there any drawbacks to analog multiplexers I should be wary of before designing them in?Also, would you mind explaining the issue with having a potentiometer at 0.6V higher than another with only one MOSFET being on at a time and would it make any difference if a BJT were to be used instead?

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2017, 06:37:20 am
content: You need to keep *ALL* analog pins on an analog multiplexer at a voltage in-between its supply rails, as they will all have normally reverse biassed diode junctions between the pin and the Vdd and Vss supply pins. The On resistance is usually lower when the switch's analog pins are at a voltage near one of the supply tails and higher at half supply. The ON resistance varies with supply voltage, temperature and from part to part - design to the datasheet worst case figures, not the typical ones.MOSFETs generally freely conduct current if the normal Drain source polarity is reversed, because the substrate is oppositely doped to the source and drain, forming a PN a junction with each. If the substrate is left floating it could act as the base of a parasitic bipolar transistor and Drain-Substrate leakage could turn it on leading to uncontrolled conduction. Therefore an ohmic contact is made with it so it can be tied to a bias voltage to keep the Drain-Substrate reverse biassed. Its normally tied to the Source, except in four terminal MOSFETs with a separate substrate pin. Therefore the Substrate-Source junction is shorted out, removing any current leaked into the parasitic base. However this leaves an active reverse biassed PN jubction between Drain and Substrate, which is tied to Source. The resulting anti-parallel diode is known as the body diode.If you redraw your circuit with a diode across each MOSFET, cathode to drain to represent the body diodes, you'll see why it wont work. . . .A BJT also wont work well, if at all, as you can no longer readily obtain symmetrical analog switching BJTs with nearly equal reverse and forward gains, designed and fabricated so that the collector and emitter are interchangeable. You'll also have to contend with a voltage shift caused by the injected base current.

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: February 03, 2017, 02:14:08 pm
content: Ok, thanks! Will look further into analog multiplexing for my project

author: T3sl4co1l
author_rank: Super Contributor
timestamp: February 03, 2017, 05:12:21 pm
content: Quote from: Ian.M on February 02, 2017, 06:37:20 amWhat do you mean redraw? It's already there -- that's precisely the meaning of the arrow in the center. The arrow is the diode triangle body part, and the channel is the cathode.Tim

author: Ian.M
author_rank: Super Contributor
timestamp: February 03, 2017, 05:18:08 pm
content: Yep, hence ""