Author Topic: An idea for soft power with no quiescent loss  (Read 5763 times)

0 Members and 1 Guest are viewing this topic.

Offline sebmadgwickTopic starter

  • Regular Contributor
  • *
  • Posts: 129
  • Country: gb
    • YouTube Channel
An idea for soft power with no quiescent loss
« on: October 31, 2014, 04:07:09 am »
I would like for a single button to switch a battery-powered device on/off but I would also like the button to have other functionality once the device is switched on.  For example, once switched on, a momentary press changes mode but holding down for 3 seconds switches the device off.  This would normally be achieved using the microcontroller's sleep mode but the combined current consumption of the sleeping microcontroller, voltage regulator, etc may be hundreds of uA.  Not great if the device is going to sit on the shelf for a few weeks/months.

I've attached a circuit of what could be a handy solution.  When the circuit is off (e.g. when battery connected for first time), nothing is powered.  Pressing the button switched on the circuit and the microcontroller must then immediately set two tri-state pins to GND and VDD to latch the circuit.  The button then has no effect of the power and its state may be read with a third microcontroller pin.  The microcontroller turn itself off by returning its GND and VDD outputs to Hi-Z.

Is this kind of circuit already common practice?  All comments welcome. :)
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: An idea for soft power with no quiescent loss
« Reply #1 on: October 31, 2014, 04:24:24 am »
It won't work. The processor pin connected to the MOSFET gate has a diode to VDD which will pull the MOSFET gate low when power is off. Also when you try to turn off the MOSFET gate still sees difference between your battery and regulated supply.

A processor with 5v tolerant pins and open drain output option might work if the battery voltage isn't too high. Otherwise you need another transistor to isolate that pin.
« Last Edit: October 31, 2014, 04:28:42 am by Rufus »
 

Offline sebmadgwickTopic starter

  • Regular Contributor
  • *
  • Posts: 129
  • Country: gb
    • YouTube Channel
Re: An idea for soft power with no quiescent loss
« Reply #2 on: October 31, 2014, 07:17:23 pm »
oops.  I didn't think of that ...a hazard of posting ideas at 3am.

I've given it a bit more thought and attached an alternative solution.  This circuit does not require anything from the microcontroller other than a pull low to switch off  The microcontroller pins must be tolerant of the expected voltages.  A dual transistor package could be used to provide both the transistor and the diode to reduce the BOM to only 4 parts.

What do you think?  Is there a risk that the floating transistor base could false trigger?

EDIT: Gait should be pulled high by resistor
« Last Edit: October 31, 2014, 07:50:39 pm by sebmadgwick »
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: An idea for soft power with no quiescent loss
« Reply #3 on: October 31, 2014, 08:02:27 pm »
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: An idea for soft power with no quiescent loss
« Reply #4 on: October 31, 2014, 08:03:40 pm »
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: An idea for soft power with no quiescent loss
« Reply #5 on: October 31, 2014, 08:12:48 pm »
I'd probably do something like this. It's the cheapest solution I can think of.



Switch + R2 turns on the transistor which turns on the PFET. R3 is necessary to protect the input of the MCU from the battery voltage. At power-up, MCU immediately turns on On/off output to latch the transistor on and keep the PFET on for as long as desired. Because there is 0.6V at the base of the transistor, R2 now acts as a pulldown for the switch, although 0.6V might not be 'low' enough for a 3.3V MCU. Use ADC or comparator input instead. Pressing the switch while powered up is still detected through R3. MCU clears on/off output low to turn off power. Floating base might be a problem, 1M from on/off to ground will sort it, lower if active power consumption is not an issue.
« Last Edit: October 31, 2014, 08:14:25 pm by lewis »
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: An idea for soft power with no quiescent loss
« Reply #6 on: October 31, 2014, 09:37:13 pm »
Quote
soft
Quote
no quiescent loss
Quote
immediately

Depending on how you define those terms, the answer ranges from "sure" to "no way".
================================
https://dannyelectronics.wordpress.com/
 

Offline sebmadgwickTopic starter

  • Regular Contributor
  • *
  • Posts: 129
  • Country: gb
    • YouTube Channel
Re: An idea for soft power with no quiescent loss
« Reply #7 on: October 31, 2014, 10:14:01 pm »
Thanks for the links, I knew I was reinventing the wheel.  I've attached my circuit with the previously missing pull up/down resistors.  I built the circuit (LED load, no microcontroller) and quiescent loss is ~20 nA according to uCurrent.

We have been here before. There is a better circuit here https://www.eevblog.com/forum/suggestions/single-button-power-and-input-with-microcontroller/
Which of the circuits you are referring to in that thread?  I assume this one.  In what way do you think it is better?  It uses fewer components but requires firmware to latch.  My suggested circuit latches without a microcontroller; this is very important if the microcontroller is to be allowed to reset without loosing power.

Also I was reminded of this from ages back: https://www.eevblog.com/forum/projects/mosfet-power-switch-with-auto-off/msg120253/#msg120253
Looks almost identical to mine (p-channel MOSTFET instead of PNP) but lacks the feedback to latch without a microcontroller.  This could easily be added.  How would you compare the circuits?
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: An idea for soft power with no quiescent loss
« Reply #8 on: October 31, 2014, 10:28:02 pm »
I assume this one.  In what way do you think it is better?  It uses fewer components but requires firmware to latch.

Better because it doesn't apply the battery voltage to any processor pin. Your current circuit applies full battery voltage to the processor input pin before the processor is even powered.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: An idea for soft power with no quiescent loss
« Reply #9 on: October 31, 2014, 10:39:40 pm »
Quote
How would you compare the circuits?

1. When the switch is closed, what happens to the microprocessor input pin?
2. When the microprocessor outputs a on the base, what happens between it and the ground?
================================
https://dannyelectronics.wordpress.com/
 

Offline sebmadgwickTopic starter

  • Regular Contributor
  • *
  • Posts: 129
  • Country: gb
    • YouTube Channel
Re: An idea for soft power with no quiescent loss
« Reply #10 on: October 31, 2014, 10:41:31 pm »
An issue with my feedback for latching without firmware is that capacitive loads a difficult to switch off.  The microcontroller would need to pull the PNP base low until the load has discharged, which is not possible because the microcontroller would brown out first.

Better because it doesn't apply the battery voltage to any processor pin. Your current circuit applies full battery voltage to the processor input pin before the processor is even powered.
Yes, that is appealing, and given the issue I just described, I think I prefer the circuit you linked.

1) Do you have any thoughts on the ability of the microcontroller to reset without causing power to be cut?
2) Is there a simple way the circuit can be made to switch on when power is connected for the first time (e.g.cap across the button)?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: An idea for soft power with no quiescent loss
« Reply #11 on: October 31, 2014, 10:44:24 pm »
A simpler solution for you to complete:

1) pnp/p-ch switch on;
2) push button to ground the base/gate - to turn on the switch;
3) push button is by-passed by a npn/n-ch controlled by the mcu.

That's the gist of it. Latching can be done by applying the right voltage on the npn's base / n-ch's gate.

================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf