I am designing a two buttons soft latching power switch for a project involving a raspberry pi, li-ion cells I salvaged from the battery of a broken laptop, and a power booster from adafruit.

I wanted the circuit to be controlled by two momentary push buttons : one for ON and another for OFF (so this is NOT a regular one button soft latching switch).

I came up with this design :

First schematic

P1 is the battery input (5V currently regulated by a 7805, see details at the end) and P2 the output to the raspi (requires 5V).
I am beginning in electronics but this is how I understand it :
When you press SW1, Q1 gets activated, so current can pass through. The base of Q2 gets activated too, so that it is no longer required to hold down SW1. When pressing SW2, the base of Q2 gets pulled to ground, so the base of Q1 is no longer connected to ground, thus cutting off the circuit. Without the capacitor C1, noises can trigger the circuit making it unreliable.

I tested this circuit with a LED first, and everything was ok, but I had some doubts about getting it to work with a bigger load, like the pi.

As I thought, when testing with the pi, there is not enough current to power it fully : its power LED is very dim, and it cannot boot. Also, I have to hold down the OFF button for a few seconds, otherwise the circuit gets ON immediately after.

So I thought well, I don't have enough power coming out of there, but I could use this circuit to drive a single transistor as a switch.

So here is the revised design :

revised schematic

The result is way better now : The pi's power LED is very bright, and it tries to read the SD card and engage the booting process. But it's still not enough. The pi seems to loop into its first booting process, without getting completely ON.

To add more details not showing up on these schematics : As I wait for the power booster to ship (I just ordered it), for a quick and dirty alternative, I am using a 7805 to get the voltage of my 11.1V laptop battery down to 5V.

So my questions are :

Is my design correct considering what I want to achieve ?

I only have those BJT (547 and 557) at hand right now, they are rated 50V 100mA, are they really efficient ?

The resistors' values were chosen quite randomly, inspired from what I saw on some forums (there was one guy who retro-engineered a similar circuit from a chinese product, so I thought well, those values might be ok). Are the values of the resistors really well chosen ? (I still don't understand how to choose them well)

Finally, is it safe to keep that circuit connected to the battery when in OFF position ? Will it still draw current ?

  • \$\begingroup\$ Measure voltage across P2. I doubt it wont be 5. Measure Vce of Q1 also. 100 mA is maximum saturation current. But with 4k7 base current, it will not be pumping even 100 mA. How much current do pi need? \$\endgroup\$
    – User323693
    Jul 3, 2015 at 1:52
  • \$\begingroup\$ The first circuit should suffice if you changed Q1 for a higher-current device. I'd recommend picking a P-channel MOSFET to do the job, something with at least the current capacity of the voltage regulator. The second circuit is suffering from the same problem, except all the current passing through Q3 is going to the Pi, rather than some going to keep itself on, which is why you get a little further. \$\endgroup\$ Jul 3, 2015 at 1:54
  • \$\begingroup\$ Why not use simple on off switch? OR do you want to have shutdown feature from pi, turning off Q2 by pi? \$\endgroup\$
    – User323693
    Jul 3, 2015 at 1:56
  • \$\begingroup\$ The pi requires 700mA. Thank you @Umar for pointing out the 4k7 resistor, now I get why only a small amount of current is passing through Q1. If I replace this for a 27 ohm one, it should get to near saturation. Still it won't be enough because the BJT I'm using are not powerful enough, right ? I was afraid I had to get some MOSFET instead. Looks like I'll need to follow the advice of chaaarlie2. To answer the last comment : I can't use a simple switch because I am building this inside a specific case that already has two push buttons. \$\endgroup\$ Jul 3, 2015 at 2:14

1 Answer 1


The FETs can hog current upto 500 mA. For higher load, it is very easy to find FETs with low Vgs threshold. Before pressing the switch SW1, M1 will be off since Vgs is zero. Once switch is pressed, M3 turns on followed by M1 followed by M2. M2 holds the ground to gate of M1 there onwards. When SW2 is pressed, M2 releases the Gate of M1, making the Vgs of M1 zero again, thereby cutting out 5V_OUT. 7805_5V is regulator output. Needless to say, the switch section will consume significantly less current to be suitable for portable applications. I hope, power dissipation across 7805 is looked upon.

(Vin - 5V)/0.7 Watts


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Of course the inefficient and power consuming 7805 will be removed and replaced by a way better solution. Your design looks great! I will try it and see how it goes. Do you know if there are smaller equivalents to the IRF9530 ? TO220 packages are quite big and will hardly fit in my project.. \$\endgroup\$ Jul 3, 2015 at 4:14
  • 1
    \$\begingroup\$ @Jerome NMOS: link PMOS: link Note that, only PMOS carries huge current. NMOS can be any SOT with low Vgs. Current through NMOS is less than a mA Time consuming but play around here -Digikey: link \$\endgroup\$
    – User323693
    Jul 3, 2015 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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