I have this circuit:


simulate this circuit – Schematic created using CircuitLab

The idea is that a high at Vcharge will charge the capacitor and then a high at Vdischarge will discharge it. However, a high at Vcharge creates about 3.22V across the capacitor, which then discharges as soon as Vcharge goes low again. Why is this happening?

  • \$\begingroup\$ Is V_discharge remaining low in all times? \$\endgroup\$
    – Eugene Sh.
    Jul 31, 2015 at 17:33
  • \$\begingroup\$ The M1 part of your circuit is a 'source follower' configuration (the MOSFET version of a BJT emitter-follower). As such, your capacitor will never charge to more than Vsupply-Vgth, where Vgth is the threshold voltage of your MOSFET. \$\endgroup\$
    – brhans
    Jul 31, 2015 at 17:37
  • \$\begingroup\$ @brhans How can I change the circuit to fix that? \$\endgroup\$
    – imulsion
    Jul 31, 2015 at 17:52

2 Answers 2


...probably because Vdischarge is not low, e.g. just floating!?

BTW: You don't have any current limitation for discharging the capacitor.

EDIT: I guess actually your problem is that C1 is much to small for what you expect.
47pF is a incredible small capacitance and it discharges even with a 10MOhm resistor within some 1/10s of a Millisecond (47pF * 10MΩ = 0.47ms).
I don't know how you measure the voltage across C1 but I guess the instument (and the PCB or bread board) has a resistance that is in that order or even much less.

  • \$\begingroup\$ Why don't I have a current limitation? I get the impression that more than 0.2A will damage the MOSFET \$\endgroup\$
    – imulsion
    Jul 31, 2015 at 17:51
  • \$\begingroup\$ R1 affects only charging. Discharging C1 via M2 will be without any series resistor (though for such a small capacitor it probably isn't a problem as the total amount of energy is very small). \$\endgroup\$
    – Curd
    Jul 31, 2015 at 17:55
  • \$\begingroup\$ I was thinking in terms of charging. Imagine there's no resistor. When M1 is switched on about 1A of current will flow, which could damage the mosfet \$\endgroup\$
    – imulsion
    Jul 31, 2015 at 17:57
  • \$\begingroup\$ If you think you need current limitation for charging, why do you think you don't need it for discharging? \$\endgroup\$
    – Curd
    Jul 31, 2015 at 17:59
  • 1
    \$\begingroup\$ thats what I guessed: 47pF --> 1000µF just a slight magnification of capacitance by factor 21000000 works wonders. \$\endgroup\$
    – Curd
    Jul 31, 2015 at 19:53

Use a P-channel MOSFET to charge the capacitor and you can then tie the gates together (low = charge, high = discharge). The source follower configuration you currently have would require more like a 10V gate drive to work properly.

No resistor is necessary with 47pF, however there is significant capacitance in the MOSFETs (even the smallest ones you can find) that will cause the voltage across the 47pF to behave differently than you might expect.

There is a lot of literature out there on making analog switches that have minimum coupling. If you don't feel like re-inventing it all, search on "charge injection" and switch. Also consider the source-to-drain capacitances.

  • \$\begingroup\$ Any idea why it discharges as soon as Vcharge goes low? The gate input of Vdischarge is grounded through a 10k resistor \$\endgroup\$
    – imulsion
    Jul 31, 2015 at 18:11
  • \$\begingroup\$ Gate to drain capacitance is ~20pF so a 5V change at the gate will bring you down close to zero from 3V. \$\endgroup\$ Jul 31, 2015 at 18:17
  • \$\begingroup\$ Any way to fix this? \$\endgroup\$
    – imulsion
    Jul 31, 2015 at 18:19
  • \$\begingroup\$ Not easily, I'm afraid. Try RF BJTs or more exotic species. Or increase the capacitor 1000:1 if you can. \$\endgroup\$ Jul 31, 2015 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.