Latching power switch with momentary pushbutton - Page 1
Forum section: electronics / projects

author: aharry
author_rank: Newbie
timestamp: October 19, 2017, 04:50:10 pm
content: I needed an on/off power switch that uses a single momentary pushbutton. I came across this circuit:https://www.edn.com/design/power-management/4427218/Latching-power-switch-uses-momentary-pushbuttonI simulated it in LTSpice using a BSS84 MOSFET and 2N2222 transistor, everything worked as expected.(Note: V2 is a voltage controlled switch that simulates pressing the pushbutton. It is configured to make a 100 ms pulse every 15 seconds, and the sim runs for 60 seconds giving two complete toggles of the MOSFET on/off. V3 is just an anomaly of the Fairchild BSS84 model that inputs a voltage as an ambient temperature reference ie 25V = 25 degrees C)I built the circuit on a PCB and it does not work. If I press the pushbutton I get this:The yellow trace is the gate of the MOSFET and the blue trace is the drain of the MOSFETThe gate voltage never latches high, it goes high and turns off the MOSFET (the output on drain begins to decay) but then it begins to decay also and eventually turns the MOSFET back on.If I momentarily apply the input voltage (5V) directly to the gate (i.e. not using the charge on the capacitor) I get this:Which is exactly what it should do if the button is pushed. So the circuit can be toggled by applying a high directly to the gate but fails using the pushbutton. Any ideas on why it does this and suggestions to make it work correctly?

author: aharry
author_rank: Newbie
timestamp: October 20, 2017, 12:45:41 am
content: I should also note that this is going from the on state to the off state. It always works with the pushbutton going from off to on.

author: Ian.M
author_rank: Super Contributor
timestamp: October 20, 2017, 01:27:49 am
content: Post your .asc sim file here.It looks like Q1 doesn't turn off quickly enough - a 22K pulldown on its base may help, but I think its a fundamental problem with latching power switch circuits that try to be too mimimalist and clever, using feedback from the load circuit to latch. In this case I suspect reverse current through the LT1117 from C2 is holding the rail up.

author: v81
author_rank: Regular Contributor
timestamp: October 20, 2017, 06:12:12 am
content: Disclaimer, i love electronics but my theory sucks, but i recall a vid Dave did on latching power circuits.Not sure if it meets your needs or not buthere it is...

author: aharry
author_rank: Newbie
timestamp: October 20, 2017, 02:26:01 pm
content: Here is the ASC files.. the BSS84.asy file is from the LTSpice lib\AutoGenerated folder.

author: Leo Bodnar
author_rank: Frequent Contributor
timestamp: October 20, 2017, 07:21:08 pm
content: Quote from: aharry on October 19, 2017, 04:50:10 pmMaybeLTC2950can help?You can drive PFET or LDO with EN(-EN) pin.Leo

author: Cerebus
author_rank: Super Contributor
timestamp: October 20, 2017, 07:49:24 pm
content: Try your simulation with .OPTION GMIN=0 and see if it still works.

author: Ian.M
author_rank: Super Contributor
timestamp: October 20, 2017, 08:50:22 pm
content: That removes the default conductance of 1e-12 mho added to every PN junction to aid convergence. The equivalent shunt resistance is one Teraohm. As real-world board leakage is extremely unlikely to be be better than one Gigaohm between adjacent pads, even with thorough multi-stage cleaning and oven drying, removing it wont help determine if the sim is physically realisable.Adding 1.2uF to ground on the switched 5V rail causes failure. After adding the 22K base pulldown I suggested, it will tolerate >10uF on the 5V rail. (latch2)A more robust approach is to use separate MOSFETs for the latch circuit and for the load to isolate the latch circuit from the load capacitance. The MOSFETs don't have to be the same type. e.g. the load circuit one could be a power device. (latch3)However the complexity is now up to the point where using a CD4013 or 74HC74 flipflop to drive the MOSFET may be preferable.Sims attached. Use with model + symbol from reply#4 above. I've redrawn it to add the temperature voltage as a SPICE command rather than as a visible source on the schematic, and to use a current controlled switch - again for schematic cleanup.

author: Cerebus
author_rank: Super Contributor
timestamp: October 20, 2017, 09:09:09 pm
content: Quote from: Ian.M on October 20, 2017, 08:50:22 pmPrexactly. I've known the added conductance to produce phantom drive to MOSFETs in SPICE; not often, it requires an edge case but it does happen. Once caused me to spend a good hour or two chasing this down. Remember, this is SPICE, not the real world, itwilllie to you.

author: aharry
author_rank: Newbie
timestamp: October 21, 2017, 01:40:41 pm
content: Quote from: Ian.M on October 20, 2017, 08:50:22 pmThe 22k on the base of the transistor did the trick. It now works as expected. Thank you for your sharing your knowledge and expertise.

author: Ian.M
author_rank: Super Contributor
timestamp: October 21, 2017, 01:43:39 pm
content: Be aware it can still be marginal. 0.1uF in series with 10K across the 100K resistor will help.