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:
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?