4
\$\begingroup\$

I'm designing a battery powered device, which must be turned on by an external 3.3V impulse from a comparator output (TLV3201), and for the sake of power efficiency I want the MCU to power itself off when it has finished processing the event. For the self-poweroff circuit I've found the following solution:

enter image description here

The P-channel MOSFET is powered off by default by pulling it's gate to VCC via R1, but when the EN pin is pulled high, either by the comparator (push-pull op-amp) output or the MCU (after it has got power), the P-channel switch is opened to supply power to the MCU.

The problem is that the high signal from the comparator may stay high for many seconds, even after the MCU has done it's work, and I want the MCU to be able to shutdown the power regardless of the comparator output (after it has initially enabled the switch) until the next time the comparator output rises. How could that be done?

Edit:

  • Added schematic of the comparator circuit.
  • The power supply is an unregulated Li-Ion battery (~3.7V). The 3.3V regulator is to be placed after the P-channel switch as part of the Load.

The comparator is used to sense the resistance connected between IN1 and IN2, which may switch between ~1.5 kOhm and ~5.5 kOhm. 1.5 kOhm resistance results in a high level output of the comparator, and 5.5 kOhm is low level (0V) output.

schematic

simulate this circuit – Schematic created using CircuitLab

Edit 2: The MCU will be a ESP-07 Wi-Fi module (ESP8266). I am currently researching its deep sleep capabilities and power consumption.

\$\endgroup\$
3
  • 1
    \$\begingroup\$ If your comparator holds a signal for a potentially longer time than the MCU requires it, have you considered using the rising edge (or falling) of the comparator output via a differentiator (capacitor?) to trigger an ON state latch (discrete, or otherwise), which can then be turned off via the MCU? (It might also help if you'd lay out a few timing diagrams to show all possible cases, because your writing so far isn't entirely complete in that sense, without making an assumption or two.) \$\endgroup\$
    – jonk
    Sep 4 '18 at 21:31
  • \$\begingroup\$ What is the range of 3.3V? Can you show your comparator circuit also? Not everything you say is making sense, and I think showing the whole circuit would help. \$\endgroup\$
    – mkeith
    Sep 5 '18 at 4:54
  • \$\begingroup\$ I guess what I need to know is, is the processor powered by Vin also? Or is Vin an unregulated voltage? If unregulated, what is the voltage range over which it may operate? \$\endgroup\$
    – mkeith
    Sep 5 '18 at 5:08
2
\$\begingroup\$

For this application I'd recommend using TPL5110 timer. It is designed to drive MOSFET gate, so you simply put it instead of R1 and Q1.

It will be waking up you MCU periodically (longest delay is 2 hrs), but will switch power OFF as soon as MCU sends back DONE signal.

The great thing about it, though, is that it has manual ON input (also dubbing as delay setting). So, you can connect your comparator output to that pin and TPL5110 will power up MCU when necessary. Again, when MCU is done processing that event it signals DONE and shuts down.

Basically MCU is powered up externally at certain intervals or comparator signal, whichever comes first.

UPDATE

Following your comment I see that the timer won't work for you. Here are some alternative solutions. Whether they work or not depends on specific MCU you are using.

  • Most MCUs nowadays have sleep modes consuming power comparable to that of external nano-power timers. For example, ATmega328P can run on a button cell for a year. The interrupt requests that wake up MCU usually can be configured for either edge of a signal. So, by connecting comparator to MCU interrupt pin and programming it for rising edge you can solve the problem and get rid of power MOSFET circuit altogether.

  • Another option is a variant of the above, but using analog comparator input instead of interrupt. Some MCUs have comparator inputs with interrupts, so you can get rid of external comparator too and use internal interrupt for wake up. Although power consumption is usually higher in these sleep modes, so check datasheet if it is acceptable to you.

  • Finally, you can use a combination of power switching and sleep mode. Basically, use your existing circuit, but with tiny code change. After your MCU is done processing and switched MOSFET control line OFF add commands to enter sleep mode (deepest possible, with every module shut down; on some MCUs sleep current is as low as 0.1μA, or 400 times lower than your comparator!). If by this time comparator is already below threshold then MCU will be powered down immediately and your system is back to original state. However if comparator is still high then MCU will temporary go into deep sleep and won't consume much power.

UPDATE 2

Here is another option you might want to try. It reduces power consumption to under 3μA by switching to power off mode instead of deep sleep. Essentially, this is option 3 above, but instead of using external MOSFET it uses internal power switch of ESP8266.

enter image description here

It works like this:
- Initially R2 pulls CH_PD low, keeping MCU in power off mode.
- When wake up signal comes in through D1 it powers on MCU. MCU immediately puts high on GPIO0 to keep itself active through R1.
- After MCU is done processing the event it switches GPIO0 low and goes into deep sleep mode. If comparator input is already low, then CH_PD goes down and MCU powers off. If comparator is still high the MCU will sleep until it goes low.

\$\endgroup\$
7
  • \$\begingroup\$ Looks like a pretty good IC, but the datasheet says "An extended assertion of a logic HIGH at the DELAY/M_DRV pin will turn on the MOSFET for a time longer than the programmed time interval. DONE signals received while the DELAY/M_DRV is HIGH are ignored. If the DRV is already LOW (MOSFET ON) the manual power ON is ignored.". So in my case, if the comparator output stays HIGH for long, the DONE signal will be ignored \$\endgroup\$ Sep 5 '18 at 6:01
  • 1
    \$\begingroup\$ That is where the third option comes in. The power is off for the most part. Sleep is only temporary state between MCU finishing processing and comparator going below threshold. As I mentioned, some MCUs consume 400 times less current in sleep than your comparator chip, comparable to MOSFET leakage current. But as I said, if you want better answer at least tell people what MCU you are using \$\endgroup\$
    – Maple
    Sep 5 '18 at 10:16
  • 1
    \$\begingroup\$ I plan to use an ESP-07 WiFi module. The chip itself seems to have a deep sleep mode with ~20uA comsumption according to datasheet, so maybe I'll just use third option with it, if real life testing shows the 20uA is real. \$\endgroup\$ Sep 5 '18 at 11:13
  • 1
    \$\begingroup\$ With ESP8266 deep sleep mode can be used for the first option as well, if your module gives you an access to GPIO16 (XPD_DCDC). That pin works as external wakeup from deep sleep. \$\endgroup\$
    – Maple
    Sep 5 '18 at 16:28
  • 1
    \$\begingroup\$ Just stumbled upon this video, using of CH_PD pin to turn the chip completely off. They deal with long control signal by waiting until it goes low. I've modified this to better accommodate your needs. See update 2. \$\endgroup\$
    – Maple
    Sep 5 '18 at 21:42

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.