# analog switch

• posted

How can design analog SPDT switch which switches VCC between +3.3V and

5V depending on application? I've an available pin on micro which can select the VCC. There are some ICs available to do this job but I would prefer to do it FET or Transistor. Anybody has idea or circuit?

Thanks

• posted

I wold use an adjustable regulator like an LM317 and use the FET switch to add a second resistor in parallel for the lower voltage so that the voltage will never exceed the higher of the two selections. The resistor calculation is slightly more complicated but you can handle it.

G=B2

• posted

```--
The problem with that approach, if the OP is trying to switch between
a 5V and a 3.3V supply, is the LM 317's dropout voltage, which will```
• posted

Must easier than you might think! A simple mosfet will do the trick.

VL---MOSFET---+---Vout | R | VH

If the gate of the mosfet is off then Vout = VH. If the mosfet is on then Vout = VL.

If VL = 3.3V and VH = 5V then applying 0V to the gate will give Vout = 5V and supplying 5V to the gate will hopefully give you Vout = 3.3V.

There are some issues with this as the mosfet R_DSON and R form a voltage divider. If you cannot get a low enough turn on voltage then Vout may be significantly degraded. Also if you need to source appreciable current then R may end up being to low. R can be replaced with a p-ch mosfet with similar effect.

VL---MOSFET1---+---Vout | VH---MOSFET2---+

looks very similar to a SPDT switch.

You can do similar things with BJT's.

• posted

You want a 'high-side switch'; either a PNP or PMOS switch device will do it. This assumes that your intent is to create a voltage source to a load (the load always draws current), not an analog switch.

Two sources, so two PMOS devices; they'll work better if you can bias 'em with -5V on the gate to turn them fully ON, otherwise you'll have to spend extra money (or use PNP and expect 0.1V drop).

• posted

Unless you're switching between regulating down from a higher voltage, then the LN317 approach is useful. But OP asked to switch between two voltages, not control a regulator. So obviously an SDPT switch is either two p-channel or pnp devices forming high side switch, or perhaps an 'hc405{2,3} if the load is in the mA range.

Grant.

• posted

Feed the 5V through a couple or 3 diodes for the low side and bridge this link with a PMOS high side to deliver the full 5? Depending on the selected diodes, they can drop your voltage on the average of .3 to .6 volts each.

I don't know how stable your circuit must be but, its a simple solution and the diodes will give you some kind of reg over a R net work. How ever, if you know your load is constant, then use a R inplace of the Diodes..

etc..

Just a thought..

• posted

Is the application the availability of two different supplies and something makes it desirable to have the ability to switch between them, or a necessity to HAVE two different supplies?

• posted

```--
Except that it won't work because of the MOSFET's body diode.```
• posted

```--
Snip...

Even better:```
• posted

Huh? The body diode is in cutoff as it is reversed biased in both cases. Maybe you are getting the orientation backwards.

Small signal mosfets are almost entirely symmeterical so one can reverse the drain and source at will excluding the body diode polarity. Since the maximum of 5V is well within the any maximum voltage requirements there should be no problems.

In any case one simply has to choose the right combinations of p-ch and n-ch to get the right combination of body diode orientations to prevent forward conduction.

One can use two n-ch mosfets or two p-ch, etc...

If you have m branches such as

V1---Mosfet1---+ | V2---Mosfet2---+ ....... | Vm---Mosfetm---+---Load

Then as long as the mosfet's body diode are forward conducting from the to the load they will block all over branches. e.g., looks something like

Vk--|>|---+

Current can't flow into any source. It won't work with diodes but does with mosfets. The biggest problem with a 5V or less system is driving the gates enough to reduce R_dson.

• posted

Proper selection of components out of the junk box makes a nice 3.3 to 5 switch.. V2 would be the uC line to select voltage. The current source is just a test load. PMOS selected to have its turn on Gate voltage in range of this voltage window.. Op-amp selected where there is no rail output and thus gives you the resulting drive voltage that is needed. Run the sim, you'll see using these components, it comes close for what I found in the libs.

Version 4 SHEET 1 892 680 WIRE 80 32 0 32 WIRE 192 32 80 32 WIRE 448 32 288 32 WIRE 0 48 0 32 WIRE 448 96 448 32 WIRE 208 112 208 80 WIRE 208 112 160 112 WIRE 80 144 80 32 WIRE 192 144 80 144 WIRE 288 144 288 32 WIRE 128 192 16 192 WIRE 80 208 80 144 WIRE 160 208 160 192 WIRE 240 208 160 208 WIRE 448 208 448 160 WIRE 16 224 16 192 WIRE 48 224 16 224 WIRE 128 240 128 192 WIRE 128 240 112 240 WIRE 240 240 240 208 WIRE 240 240 128 240 WIRE 48 256 -96 256 WIRE 80 288 80 272 FLAG 0 128 0 FLAG 448 208 0 FLAG 80 288 0 FLAG -96 336 0 SYMBOL voltage 0 32 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL pmos 288 80 M270 SYMATTR InstName M1 SYMATTR Value FQB11P06 SYMBOL npn 192 208 R270 WINDOW 0 48 54 Left 0 WINDOW 3 -8 122 Left 0 SYMATTR InstName Q1 SYMATTR Value 2N2222 SYMBOL load 432 96 R0 WINDOW 3 48 56 Invisible 0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName I1 SYMATTR Value PULSE(.010 .050 0 500us 500us 20ms 20ms 60) SYMBOL Opamps\\LT1006 80 176 R0 SYMATTR InstName U1 SYMBOL voltage -96 240 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V2 SYMATTR Value PULSE(0 5 0 1ms 1ms .100 .200) SYMBOL res 144 96 R0 WINDOW 0 -7 -23 Left 0 WINDOW 3 -9 4 Left 0 SYMATTR InstName R1 SYMATTR Value 47 TEXT 326 302 Left 0 !.tran 1 startup

• posted

```--
Good point.

This seems to work quite well:```
• posted

What program to you use to view the circuit?

• posted

```--
Not only just view, but also draw and simulate.

A beautiful piece of work available free from Linear Technologies at:```
• posted

I tried to use it once but it's interface is so 60's...

• posted

Well, stop using the 60's version then!

• posted

What SPICE program were you using in the '60s, 'Pencil & Paper 1.0'?

• posted

Well, if you want to read the stuff JF posts that way (always highly recommended reading, by the way) it's the solution. The content/capability is worth overcoming whatever negative(s) you think about the interface.

Ed

• posted

```--
Thanks Ed, that's very kind of you! :-)```

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.