Author Topic: Latching power switch with momentary pushbutton  (Read 5558 times)

0 Members and 1 Guest are viewing this topic.

Offline aharryTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Latching power switch with momentary pushbutton
« on: October 19, 2017, 04:50:10 pm »
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-pushbutton

I 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 MOSFET

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



 

Offline aharryTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: Latching power switch with momentary pushbutton
« Reply #1 on: October 20, 2017, 12:45:41 am »
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.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14127
Re: Latching power switch with momentary pushbutton
« Reply #2 on: October 20, 2017, 01:27:49 am »
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.
 

Offline v81

  • Regular Contributor
  • *
  • Posts: 89
  • Country: au
Re: Latching power switch with momentary pushbutton
« Reply #3 on: October 20, 2017, 06:12:12 am »
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 but here it is...

 
The following users thanked this post: schmitt trigger

Offline aharryTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: Latching power switch with momentary pushbutton
« Reply #4 on: October 20, 2017, 02:26:01 pm »
Here is the ASC files.. the BSS84.asy file is from the LTSpice lib\AutoGenerated folder.
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 849
  • Country: gb
Re: Latching power switch with momentary pushbutton
« Reply #5 on: October 20, 2017, 07:21:08 pm »
I needed an on/off power switch that uses a single momentary pushbutton.
Maybe LTC2950 can help?
You can drive PFET or LDO with EN(-EN) pin.

Leo
« Last Edit: October 20, 2017, 07:25:43 pm by Leo Bodnar »
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Latching power switch with momentary pushbutton
« Reply #6 on: October 20, 2017, 07:49:24 pm »
Try your simulation with .OPTION GMIN=0 and see if it still works.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14127
Re: Latching power switch with momentary pushbutton
« Reply #7 on: October 20, 2017, 08:50:22 pm »
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.
« Last Edit: October 20, 2017, 09:01:53 pm by Ian.M »
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Latching power switch with momentary pushbutton
« Reply #8 on: October 20, 2017, 09:09:09 pm »
That removes the default conductance of  1e-12 mho added to every PN junction to aid convergence.  The equivalent shunt resistance is one Teraohm.

Prexactly. 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, it will lie to you.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline aharryTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: Latching power switch with momentary pushbutton
« Reply #9 on: October 21, 2017, 01:40:41 pm »
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)

The 22k on the base of the transistor did the trick. It now works as expected. Thank you for your sharing your knowledge and expertise.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14127
Re: Latching power switch with momentary pushbutton
« Reply #10 on: October 21, 2017, 01:43:39 pm »
Be aware it can still be marginal.  0.1uF in series with 10K across the 100K resistor will help.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->