# PMOS unexpectedly passing current with capacitor on drain

I am designing a circuit to get a pulse when a switch opens. When the voltage source V1 is connected, the switch SW1 starts closed. I want Vout to briefly go high when SW1 opens. The circuit I designed looks like this:

simulate this circuit – Schematic created using CircuitLab

However, I get the opposite behaviour to what I expected when the circuit is turned on. When SW1 is closed, I would expect the drain of the MOSFET to be at 0V and pass no current. Instead, it charges the capacitor up to 2V. Then when the switch opens, the capacitor is already charged, and I don't get a pulse. According to the theory I read, when the MOSFET vSG = 0V then iD = 0A. Why is current flowing; do I need a more sophisticated model?

• You need to add a pull-down resistor from the MOSFET drain to Ground. Jan 20, 2020 at 19:16
• 1. How is the capacitor ever supposed to discharge? 2. While SW1 is open, the capacitor charges up to 2V. Then when you close the switch the current indeed does go to 0A, but the capacitor is already charged, and without any way to discharge it it stays charged. Jan 20, 2020 at 19:16
• @DKNguyen after the capacitor delivers the pulse, the device is shut down so V1 is disconnected. After it is shut down it has at least 12 hours to self-discharge. Jan 20, 2020 at 20:59
• @bobbob Oh, this is only meant to run "once"? Jan 20, 2020 at 21:36

Is this a simulation?

The leakage current from the MOSFET will charge the capacitor - it is probable that the simulator waits for conditions to stabilize before you get to time zero.

I suggest putting a resistor from the drain to ground. It can be fairly high, eg 1 megohm, to bypass the leakage current. You will also need the resistor to discharge the capacitor and allow the circuit to produce a pulse the second time the switch opens.

Also, many simulators will not function correctly if any nodes do not have a DC path to ground.

• The capacitor charges anyways when the switch is open. Jan 20, 2020 at 19:18
• @DKNguyen - the simulation starts with the switch closed. Jan 20, 2020 at 19:19
• @KevinWhite unfortunately it's not a simulation, it is happening on a physical PCB. I didn't catch this while simulating. I'll try a 10M pulldown (every uA is important) to see if it's strong enough. Jan 20, 2020 at 21:08
• Remember that the larger that pulldown is, the longer it will be until you can get another pulse, since the capacitor has to discharge through the pulldown. Jan 20, 2020 at 21:16
• @CristobolPolychronopolis That is not critical since the time between pulses should exceed the capacitor's self-discharge rate. Jan 20, 2020 at 21:29