Basically, it doesn't work. It's cribbed off the internet. When I connect a battery,( lipo) the output ( TP5) is always on. R3/D2 is supposed to guarantee a switch off when the switch is pressed whilst the circuit is on. This is a dropbox link but I'm not sure if it can be accessed by anyone
Can anyone help with this?
Jun 02, 2026
Last reply: 1 month ago
43 Replies
formatting link
With a PFET, the source-drain diode conducts when the source is more positive. You need to exchange drain and source.
Cheers
Phil Hobbs
Belay that—I shouldn’t post after two G&Ts.
"TTman" snipped-for-privacy@gmail.com wrote in message news:10vnl0a$38eli$ snipped-for-privacy@dont-email.me...
A 3.3v variation on the circuit optimised by piglet some time ago may work better for that if pushbutton on/off is what you want.
Version 4.1 SHEET 1 2776 2100 WIRE -128 -128 -704 -128 WIRE 64 -128 -128 -128 WIRE 608 -128 64 -128 WIRE 704 -128 608 -128 WIRE 752 -128 704 -128 WIRE 912 -128 848 -128 WIRE 944 -128 912 -128 WIRE -128 -96 -128 -128 WIRE 64 -96 64 -128 WIRE 608 -96 608 -128 WIRE 608 16 608 -16 WIRE 704 16 608 16 WIRE 768 16 768 -80 WIRE 768 16 704 16 WIRE 608 48 608 16 WIRE -128 80 -128 -16 WIRE -64 80 -128 80 WIRE 336 80 16 80 WIRE 64 160 64 -16 WIRE 112 160 64 160 WIRE 224 160 192 160 WIRE 256 160 224 160 WIRE 336 160 336 80 WIRE 336 160 320 160 WIRE 352 160 336 160 WIRE 448 160 416 160 WIRE 480 160 448 160 WIRE 608 160 608 128 WIRE 608 160 560 160 WIRE 224 192 224 160 WIRE 448 192 448 160 WIRE 944 192 944 -128 WIRE -704 256 -704 -128 WIRE -304 288 -400 288 WIRE -224 288 -304 288 WIRE -128 288 -128 80 WIRE -128 288 -224 288 WIRE 224 288 448 192 WIRE 448 288 224 192 WIRE 224 304 224 288 WIRE 448 304 448 288 WIRE -400 352 -400 288 WIRE -448 368 -544 368 WIRE 64 384 64 160 WIRE 112 384 64 384 WIRE 224 384 224 368 WIRE 224 384 192 384 WIRE 448 384 448 368 WIRE 480 384 448 384 WIRE 608 384 608 160 WIRE 608 384 560 384 WIRE -448 416 -464 416 WIRE 64 432 64 384 WIRE 608 432 608 384 WIRE -544 448 -544 368 WIRE 224 480 448 384 WIRE 224 480 128 480 WIRE 448 480 224 384 WIRE 544 480 448 480 WIRE -128 496 -128 288 WIRE 224 528 224 480 WIRE 448 528 448 480 WIRE -704 624 -704 336 WIRE -544 624 -544 528 WIRE -544 624 -704 624 WIRE -464 624 -464 416 WIRE -464 624 -544 624 WIRE -400 624 -400 432 WIRE -400 624 -464 624 WIRE -128 624 -128 576 WIRE -128 624 -400 624 WIRE 64 624 64 528 WIRE 64 624 -128 624 WIRE 224 624 224 592 WIRE 224 624 64 624 WIRE 448 624 448 592 WIRE 448 624 224 624 WIRE 608 624 608 528 WIRE 608 624 448 624 WIRE 944 624 944 272 WIRE 944 624 608 624 WIRE -704 672 -704 624 WIRE -304 832 -304 288 WIRE -304 832 -416 832 WIRE -416 896 -416 832 WIRE -464 912 -480 912 WIRE -464 960 -560 960 WIRE -560 992 -560 960 WIRE -560 1104 -560 1072 WIRE -480 1104 -480 912 WIRE -480 1104 -560 1104 WIRE -416 1104 -416 976 WIRE -416 1104 -480 1104 WIRE -560 1152 -560 1104 WIRE -304 1184 -304 832 WIRE -352 1200 -368 1200 WIRE -352 1248 -448 1248 WIRE -448 1280 -448 1248 WIRE -448 1424 -448 1360 WIRE -368 1424 -368 1200 WIRE -368 1424 -448 1424 WIRE -304 1424 -304 1264 WIRE -304 1424 -368 1424 WIRE -448 1472 -448 1424 FLAG -704 672 0 FLAG -560 1152 0 FLAG -448 1472 0 FLAG -224 288 PUSHBUTTON FLAG 704 16 gate FLAG 704 -128 v48 FLAG 912 -128 sw SYMBOL sw -400 448 M180 SYMATTR InstName S1 SYMATTR Value SWCH SYMBOL voltage -544 432 R0 WINDOW 3 -366 360 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {1/4/F} 10u 10u {1/4/F} {1/F} 5) SYMATTR InstName V1 SYMBOL voltage -704 240 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V2 SYMATTR Value 3.3 SYMBOL sw -416 880 R0 SYMATTR InstName S2 SYMATTR Value SWCH SYMBOL voltage -560 976 M0 WINDOW 3 43 129 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {.245/F} 1u 1u 1m 2m 5) SYMATTR InstName V3 SYMBOL sw -304 1168 R0 SYMATTR InstName S3 SYMATTR Value SWCH SYMBOL voltage -448 1264 M0 WINDOW 3 59 141 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {.501/F} 1u 1u 1m 2m 5) SYMATTR InstName V4 SYMBOL npn 128 432 M0 SYMATTR InstName Q3 SYMATTR Value BC846B SYMBOL res 48 -112 R0 SYMATTR InstName R11 SYMATTR Value 150k SYMBOL npn 544 432 R0 SYMATTR InstName Q4 SYMATTR Value BC846B SYMBOL res 208 368 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R15 SYMATTR Value 470k SYMBOL res 576 368 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R16 SYMATTR Value 470k SYMBOL cap 320 144 R90 WINDOW 0 0 32 VBottom 2 WINDOW 3 32 32 VTop 2 SYMATTR InstName C1 SYMATTR Value 100n SYMBOL cap 416 176 M270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName C2 SYMATTR Value 100n SYMBOL res 592 -112 R0 SYMATTR InstName R17 SYMATTR Value 100k SYMBOL res 592 32 R0 SYMATTR InstName R18 SYMATTR Value 10k SYMBOL diode 208 368 M180 WINDOW 0 42 50 Left 2 WINDOW 3 -97 51 Left 2 SYMATTR InstName D5 SYMATTR Value 1N4148 SYMBOL res 576 144 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R20 SYMATTR Value 470k SYMBOL diode 464 368 R180 WINDOW 0 42 50 Left 2 WINDOW 3 -96 52 Left 2 SYMATTR InstName D6 SYMATTR Value 1N4148 SYMBOL res 96 144 M90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R21 SYMATTR Value 470k SYMBOL diode 208 592 M180 WINDOW 0 42 34 Left 2 WINDOW 3 -96 35 Left 2 SYMATTR InstName D8 SYMATTR Value 1N4148 SYMBOL diode 464 592 R180 WINDOW 0 43 30 Left 2 WINDOW 3 -98 34 Left 2 SYMATTR InstName D9 SYMATTR Value 1N4148 SYMBOL res -112 -112 M0 SYMATTR InstName R13 SYMATTR Value 470k SYMBOL res -112 480 M0 SYMATTR InstName R22 SYMATTR Value 470k SYMBOL res 32 64 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R23 SYMATTR Value 220 SYMBOL pmos 848 -80 M270 WINDOW 0 -19 56 VLeft 2 WINDOW 3 76 99 VLeft 2 SYMATTR InstName M3 SYMATTR Value AO3423 SYMBOL res 928 176 R0 SYMATTR InstName RLOAD SYMATTR Value 1k TEXT -912 584 Left 2 !.tran 10 startup TEXT -912 704 Left 2 !.param F=0.5 TEXT -912 744 Left 2 !.MODEL SWCH SW(Ron=.1 Roff=100Meg Vt=1) TEXT 696 816 Left 2 ;EPW SED OCT 2025 TEXT 576 880 Left 2 ;INSPIRED BY EDWARD RAWDE TEXT 544 944 Left 2 ;TOGGLE POWER ON PUSH BUTTON TEXT -280 936 Left 2 ;BOUNCE ON MAKE TEXT -240 1216 Left 2 ;BOUNCE ON BREAK
You were right the first time.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
Might be tricky. Most FETs are symmetrical, and for a P-FET the source is whichever of the source and drain connections that happens to be more positive.
"TTman" snipped-for-privacy@gmail.com wrote in message news:10vnl0a$38eli$ snipped-for-privacy@dont-email.me...
Phil was right first time and it won't work without a load (R4 in the simulation below).
This site has various variations of it.
formatting link
Version 4.1 SHEET 1 2776 2100 WIRE -1008 -480 -1168 -480 WIRE -896 -480 -1008 -480 WIRE -720 -480 -800 -480 WIRE -640 -480 -720 -480 WIRE -528 -480 -640 -480 WIRE -448 -480 -528 -480 WIRE -448 -448 -448 -480 WIRE -448 -320 -448 -368 WIRE -1008 -304 -1008 -480 WIRE -720 -304 -720 -480 WIRE -640 -288 -640 -480 WIRE -1008 -160 -1008 -224 WIRE -880 -160 -880 -432 WIRE -880 -160 -1008 -160 WIRE -1008 -96 -1008 -160 WIRE -880 48 -880 -160 WIRE -720 128 -720 -224 WIRE -720 128 -832 128 WIRE -640 128 -640 -224 WIRE -640 128 -720 128 WIRE -576 128 -640 128 WIRE -208 128 -576 128 WIRE -1168 256 -1168 -480 WIRE -1008 288 -1008 -16 WIRE -608 288 -1008 288 WIRE -560 288 -608 288 WIRE -512 288 -560 288 WIRE -608 352 -608 288 WIRE -720 368 -752 368 WIRE -656 368 -720 368 WIRE -1008 416 -1008 288 WIRE -656 416 -672 416 WIRE -752 448 -752 368 WIRE -1168 624 -1168 336 WIRE -1008 624 -1008 480 WIRE -1008 624 -1168 624 WIRE -880 624 -880 144 WIRE -880 624 -1008 624 WIRE -752 624 -752 528 WIRE -752 624 -880 624 WIRE -672 624 -672 416 WIRE -672 624 -752 624 WIRE -608 624 -608 432 WIRE -208 624 -208 128 WIRE -208 624 -608 624 WIRE -1168 672 -1168 624 WIRE -512 832 -512 288 WIRE -512 832 -624 832 WIRE -624 896 -624 832 WIRE -672 912 -688 912 WIRE -672 960 -768 960 WIRE -768 992 -768 960 WIRE -768 1104 -768 1072 WIRE -688 1104 -688 912 WIRE -688 1104 -768 1104 WIRE -624 1104 -624 976 WIRE -208 1104 -208 624 WIRE -208 1104 -624 1104 WIRE -768 1152 -768 1104 WIRE -512 1184 -512 832 WIRE -560 1200 -576 1200 WIRE -560 1248 -656 1248 WIRE -656 1280 -656 1248 WIRE -656 1424 -656 1360 WIRE -576 1424 -576 1200 WIRE -576 1424 -656 1424 WIRE -512 1424 -512 1264 WIRE -208 1424 -208 1104 WIRE -208 1424 -512 1424 WIRE -656 1472 -656 1424 FLAG -1168 672 0 FLAG -768 1152 0 FLAG -656 1472 0 FLAG -528 -480 sw FLAG -448 -320 0 FLAG -576 128 button1 FLAG -560 288 button2 FLAG -720 368 pb SYMBOL sw -608 448 M180 SYMATTR InstName S1 SYMATTR Value SWCH SYMBOL voltage -752 432 R0 WINDOW 3 -366 360 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {1/4/F} 10u 10u {1/4/F} {1/F} 5) SYMATTR InstName V1 SYMBOL voltage -1168 240 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V2 SYMATTR Value 4 SYMBOL sw -624 880 R0 SYMATTR InstName S2 SYMATTR Value SWCH SYMBOL voltage -768 976 M0 WINDOW 3 43 129 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {.245/F} 1u 1u 1m 2m 5) SYMATTR InstName V3 SYMBOL sw -512 1168 R0 SYMATTR InstName S3 SYMATTR Value SWCH SYMBOL voltage -656 1264 M0 WINDOW 3 59 141 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR Value PULSE(0 2 {.501/F} 1u 1u 1m 2m 5) SYMATTR InstName V4 SYMBOL res -992 -320 M0 SYMATTR InstName R1 SYMATTR Value 10k SYMBOL res -992 -112 M0 SYMATTR InstName R2 SYMATTR Value 100k SYMBOL cap -992 480 R180 WINDOW 0 24 56 Left 2 WINDOW 3 24 8 Left 2 SYMATTR InstName C1 SYMATTR Value 1000n SYMBOL nmos -832 48 M0 SYMATTR InstName TR2 SYMATTR Value IRF7309N SYMBOL res -704 -320 M0 SYMATTR InstName R3 SYMATTR Value 10k SYMBOL pmos -800 -432 M270 WINDOW 0 73 1 VRight 2 WINDOW 3 -21 -49 VRight 2 SYMATTR InstName TR1 SYMATTR Value IRF7309P SYMBOL schottky -656 -224 M180 WINDOW 0 24 64 Left 2 WINDOW 3 24 0 Left 2 SYMATTR InstName D2 SYMATTR Value BAT54 SYMATTR Description Diode SYMATTR Type diode SYMBOL res -464 -464 R0 SYMATTR InstName R4 SYMATTR Value 1k TEXT -1376 584 Left 2 !.tran 10 startup TEXT -1120 704 Left 2 !.param F=0.5 TEXT -1120 744 Left 2 !.MODEL SWCH SW(Ron=.1 Roff=100Meg Vt=1) TEXT -1160 -576 Left 2 ;TOGGLE POWER ON PUSH BUTTON TEXT -488 936 Left 2 ;BOUNCE ON MAKE TEXT -448 1216 Left 2 ;BOUNCE ON BREAK
If you are going to drive a microprocessor then let that do the on-off thing: Like this one:
formatting link
press once -> on press 3 times: off If you program those PICs right then off-current is in the nano nano amp region. Still working 100% on same Lipo after more than 10 years.
Circuit diagram:
formatting link
Code for the PIC 18F14k22: see line 1000:
formatting link
asm is fun :-)
formatting link
Yes, I already did that years ago with a tiny 25. But this is a 'discrete' design. No micro
But my 'load' side can never be more positive than the battery side...
So I need to flip source and drain? I'll try that...
Yes but you forgot the parasitic body diode.
piglet
As Phil pointed out the parasitic body diode in the PFET was letting current flow.
Also beware that to switch off reliably the R3 * cap 1uF time constanr needs to be longer than the load capacitance TC takes to decay - so either increase that cap or decrease the amount of capacitance across the load.
piglet
Thanks, I have no recollection of that! I think unsuitable for battery use as the standby current is high. Looks like an excercise in Eccles-Jordan maximal complexity!
pigley
Thanks, that mosaic industries website provoked some ideas, here is my take on the "press-on, hold-off" circuit
formatting link
piglet
Don't bother. The FET decides which terminal is source or drain on the basis of the voltage at each connection.
Even asymmetrical FETs work that way, but the performance can vary a bit if the areas playing the role are bigger or smaller.
In that case please explain why reversing the source and drain in the simulation I posted results in a circuit which no longer works.
Yes I know the explanation is obvious but you seem to be implying that the FET will work either way in that circuit. This is incorrect so telling the OP not to bother doing that is nonsense.
Phil gave the correct solution . The only other thing I would note is the way the load characteristics may affect operation but this is explained on the web page I posted.
He forgot about substrate diodes.
John Larkin Highland Tech Glen Canyon Design Center Lunatic Fringe Electronics
You want to use a microprocessor for a push on/off power switch? I'd have to admit I know people who might. And if there's already a processor in the system then maybe sometimes it makes sense. The usual process is:
- Connect the switch to an input port with a pull up resistor if necessary.
- Write software which logically will work perfectly.
- Have trouble understanding what is going wrong.
- Discover switch bounce.
The simulation uses a defective model for the FET
Why do you think that it is incorrect? The simulation isn't evidence of what the actual part will do.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required