# Making a “voltage switch”

I'm an electronics newbie. I have a circuit in which I have two input voltages, Vin and Vflag, and one output, Vout. Basically I want the following: If Vflag =0, Vout =0. If Vflag = 1, Vout = Vin. My friend told me I can do it with a MOSFET, but from what I understood, a mosfet either lets current pass through or acts like an open circuit. Basically, a gate for current, while I want a gate for voltage.

Any help will be greatly appreciated.

• I would use a relay - simple, non-electronic, and no voltage drop when the contact is closed. – Peter Bennett May 25 '16 at 23:46
• Your friend is correct, a MOSFET is perfectly suitable for your needs. Although I'm not sure I understand how you're differentiating between a "voltage switch" and "current switch". – Dan Laks May 25 '16 at 23:52
• @DanLaks I apologize if this question is stupid but: If a mosfet is ON, there is current passing through the mosfet. How do I regulate the out voltage based on this current. In other words, how do I make Vout = Vin, when there is current going through the mosfet? – tsuo euoy May 26 '16 at 0:06
• Get a MOSFET with minimal on resistance. – Ignacio Vazquez-Abrams May 26 '16 at 0:10

You want a gate for voltage ...but at zero current? Is there any current through the Vout connection? What connects to Vout, just a DMM voltmeter?

A simple way to perform your task is to connect a resistor "R" between Vin and Vout. This makes Vin=Vout, but only as long as Vout isn't loaded down with an external resistor to gnd. Next, connect your mosfet from Vout to gnd (Drain connects to Vout, Source connects to gnd.) When turned on, the mosfet will "short out" or "pull down" the Vout terminal, giving Vout=zero volts. Now go find a "logic level" mosfet which will turn on when Vgs = 1.0V. Connect Vflag to the mosfet gate.

On the other hand, if you're connecting Vout to an LED or motor or something, then Vout must supply significant current, and your "R" resistance would have to be fairly low, and when the mosfet turns on, the resistor gets hot.

Other solutions: use a mechanical SPDT relay, with a sensitive coil which turns on at 1.0V. The COM relay terminal becomes Vout, the N.C. terminal goes to gnd, and the N.O. terminal goes to Vin.

Or, the professional version: use mosfet-based "analog switches" which can connect two signals together, or short a signal to ground. For example, here's a Digikey search.

I use this to control a 3.3v output. The mosfet acts as a switch.

This is not tested for a high current system. My maximum load on the Vout side is around 500mA on 3.3v