# Circuit that can switch between Vcc and High-Z

I want to develop a switching circuit (for controlling power, rather than digitial signals) that is able to take an input and switch between Vcc and high impedance, rather than switching between Vcc and GND. An obvious solution would be a relay without a pull-up resistor, but that is far too bulky so I need solid-state component(s). I'm also after rapid switching, so a MOSFET is likely to be the best option.

Just to be clear, I'm after a MOSFET circuit that implements the following truth table:

| In  | Out |
| --- | --- |
|  0  |  1  |
|  1  |  Z  |


or something similar. I'm thinking of just using a single MOSFET (pMOS) placed aboved the output which can connect the output to ground (but any simulations I perform just don't toggle the output). Will this circuit be affected when a load is connected? Or is there a better way to implement this?

• Look for Tristate buffer. Nov 5, 2020 at 23:36
• What kind of voltage and current are you switching? If these are digital signals then @Fredled is right, a tri-state buffer would work fine. If you're switching say 12V at 10A then a PFET could work fine. Nov 5, 2020 at 23:39
• PMOS high side switch. Nov 5, 2020 at 23:39
• @Fredled I had considered a tristate buffer, but was kinda put off by the fact that it also can output a low voltage too. No point in having features that I can't use. Regardless, this is going to be used for switching power (I've updated the question to reflect this), so a tristate buffer may not be the best choice anyway Nov 6, 2020 at 0:09
• Post a schematic of your non-working circuit. Because a PMOS (or a PNP BJT if you want to go old school) is the way to go. Nov 6, 2020 at 0:23

## 3 Answers

These are used all the time in Cars and they are called High Side Power Switches with enable. There are hundreds of varieties of packages, voltages, currents and some with adjustable current outputs like for USB.

e.g. <=28V 22mOhm AOZ1360AIL SOIC-8 $2.15 Why re-invent the wheel? • Because$2.15... Nov 6, 2020 at 12:29
• @Brian Drummond LOL :) Nov 6, 2020 at 14:23

You're looking for the MOSFET version of an Open collector circuit.

A P channel MOSFET is a great way to go for this. But pick one based on your input signal, load current, and input signal frequency. The MOSFET input capacitance will limit how fast it can turn on. Ids is a rough figure for the maximum current it can handle (with heatsinks, good gate charge, etc.)

And the voltage of your input signal must exceed the "threshold voltage" in order for it to work. Look at the Vgs vs Rds graphs to get a good idea of how well your MOSFET will connect output to ground before you buy. The "on resistance" in the datasheet is usually for a high voltage applied to the gate, which your input signal may not be able to produce.

You may have to do a 2-stage approach if your input signal can't reach Vcc. This is because you have to put Vcc on the gate to turn it off. If your signal is small (e.g. 3.3V), you can put a pullup on the gate to Vcc (10K is fine) and a second, smaller N channel FET to pull the P channel gate to ground. This will invert the output, but allow a weak signal to control a large output voltage. See schematic for example.

simulate this circuit – Schematic created using CircuitLab

.

• that's still an open drain circuit, not open source. It's just the p-channel version. Nov 6, 2020 at 4:25
• Add a resistor from Q2 to gate and s gate to V+ zener if V+ is approaching or higher than Vgs_msx for upper FET. Nov 6, 2020 at 5:39
• @The Photon No it isn;t. But instead of "output", Schuyler Horky should have written "Load" and draw a return path to the - sign of the power supply. (See the schematic in my answer) Nov 6, 2020 at 14:22
• Also, this does not implement the OP's truth table. Assuming VCC = logic level (which may not be the case) that would be even simpler. Nov 6, 2020 at 14:33
• @Fredled, Q1 is in open drain configuration. If they had the source connected to the output then the body diode would conduct and the output would never be disconnected from VCC. Nov 6, 2020 at 17:17

In the case the load voltage is higher than the inverter (or NOT gate) voltage (Vcc), use two N-Mosfets to reverse the polarity and increase the voltage as in Schuyler Horky's answer.

simulate this circuit – Schematic created using CircuitLab