Author Topic: A new sleep mode using 225 nA  (Read 11050 times)

joelucid

  • Hero Member
  • *****
  • Posts: 869
A new sleep mode using 225 nA
« on: January 30, 2016, 04:36:01 PM »
Hey guys,

As by-product of a low-power project I'm working on I came up with an idea:

What if a Moteino could cut it's own power supply? You could get rid of the LDO, put the radio to sleep and enter powerDown mode with neither the brown out detector nor the watchdog timer. Your Moteino would then run on its 10uF cap on ~150nA for the 328p + 100nA for the radio in sleep.

As the Moteino draws down the power from the cap it will reach the power-on reset threshold of 1.3V and trigger a reset. If you could then power up it up again the process would start from the beginning.   

Now how could you cut and restart power? Well check this out:



It's just a high side switch with an inverter in front.

When the 328p is in reset the GPIO pins are put into tri-state and the pull-down pulls down the gate of the first mosfet. This will power up the Moteino. Then you query your sensors and send your data to the gateway. And finally you switch on the GPIO port (a simple digitalWrite( port, HIGH) will do) and thereby cut your cord.

It's amazingly simple when compared to approaches like https://hallard.me/category/ulpnode/. Plus as I tested today it actually works. And you can do it with parts you might have lying around. An added benefit is that your Moteino comes up clean every time - no possibility of getting stuck due to problematic sleep code.

When I use this circuit with a normal Moteino, LDO removed, running at 8Mhz, powered at 2.6V I get a rather convenient cycle time of about 70 seconds. Which is actually much better than I would expect: dU * C / t = I. I get a reset at 1.3V, so dU = 1.3V. The bulk cap on the Moteino is 10uF and I cycle in 70 seconds. So I = 185 nA, which is pretty amazing. Actually you have to add something like 40nA for R10 which is powered from VCC, so total 225 nA.

Clearly this doesn't work for everything. Anything that actively needs to react to time critical interrupts etc in real-time won't. Listen mode isn't included etc - so I doubt I will use it too much in practice. But I still thought it was cool enough to share.

The huge size of the pull-ups is obviously a worry. If you use conformal coating or potting it might work long term without humidity issues. Anybody up for a cord cutting circuit that's simpler than this?

http://ambiqmicro.com/am18xx-ultra-low-power-rtc could do it. But discretely?


Cheers, Joe

emjay

  • Full Member
  • ***
  • Posts: 115
  • Country: nl
Re: A new sleep mode using 225 nA
« Reply #1 on: January 30, 2016, 06:02:39 PM »
@joelucid,

Neat idea, but may not give the savings you anticipate.  There is an energy cost for waking up from a complete cold start.
For example, the RF Module goes through a bunch of houskeeping once Vdd ramps up for several ms with a current draw of many mA. So the uCoulombs consumed can easily outweigh leaving the module initialised, but asleep - depending of course on the overall length of the desired sleep period.

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #2 on: January 30, 2016, 06:35:34 PM »
Quote
So the uCoulombs consumed can easily outweigh leaving the module initialised, but asleep - depending of course on the overall length of the desired sleep period.

That's of course correct. It seems from what I've seen so far though that the 328p goes into power-on reset before the radio, possibly avoiding this pitfall. I'll look into this and into radio startup costs and share what I find.

If restart costs are prohibitively high for a 70s cycle you could add a larger cap for slower nodes or switch power to the radio using a mosfet, too. Actually there's really no good reason to keep the radio on during sleep if you need to restart it at the end of the cycle anyway.

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1735
Re: A new sleep mode using 225 nA
« Reply #3 on: January 30, 2016, 06:49:37 PM »
If restart costs are prohibitively high for a 70s cycle you could add a larger cap for slower nodes or switch power to the radio using a mosfet, too. Actually there's really no good reason to keep the radio on during sleep if you need to restart it at the end of the cycle anyway.
You could power the radio directly from the load switch and use a blocking diode to isolate the Moteino with Cap leaving them as the only load on the the cap.  A larger cap wouldn't take much space either.

What do you plan to use for persistent storage so that you know how many cycles you've run before contacting your gateway?  I'm assuming that you're not going to do that every power cycle.

ISTM, if you're giving up Listen Mode and restarting the proc/radio, then the RTC approach is not only much lower power, but also more accurate and much longer intervals between power ups.  You do have to calibrate that RTC if you want accurate time keeping.  It's good enough to be sufficiently accurate over a few hours(~200PPM), but needs calibration beyond that.

Tom

WhiteHare

  • Hero Member
  • *****
  • Posts: 1297
  • Country: us
Re: A new sleep mode using 225 nA
« Reply #4 on: January 30, 2016, 10:38:16 PM »
I'm curious to know how the total energy consumed by the 70 second version of this compares with the energy consumed by  the 65 second radio noise wake-up method (https://lowpowerlab.com/forum/index.php/topic,1325.0.html), since the two are of similar duration.  The radio noise method has the virtue of not needing any extra parts, but Joe's new method has the virtue of being extensible to longer sleep periods and, it sounds like,  potentially greater energy savings.

« Last Edit: January 31, 2016, 01:44:34 AM by WhiteHare »

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #5 on: January 31, 2016, 04:17:46 AM »
Quick update:

I tested power consumption during restart by writing a simple sketch that initializes the radio, sleeps it and cuts the power. To my dismay restart took around 20ms and was very costly. I then drilled into the details of radio initialization and distilled the minimum required to sleep it. This is what remains:

Code: [Select]
#include <SPI.h>
#include <RFM69.h>
#include <RFM69registers.h>
#include <LowPower.h>

#define SELECT ( 1 << 2 )
#define CUTPOWER ( 1 << 5 )

void setup()
{
  // shut off ADC
  ADCSRA = 0;
  // shut off all units not needed
  PRR = _BV( PRTWI ) | _BV( PRTIM0 )| _BV( PRTIM1 ) | _BV( PRTIM2 ) |
    _BV( PRUSART0 ) | _BV( PRADC );

  // Setup slave select
  PORTB |= SELECT;
  DDRB |= SELECT;
 
  // set up SPI
  SPI.begin();
  SPI.setDataMode(SPI_MODE0);
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV2);
 
  // Sleep radio
  while( true ) {
    PORTB &= ~SELECT;
    SPI.transfer(REG_OPMODE | 0x80);
    SPI.transfer(RF_OPMODE_SLEEP);
    PORTB |= SELECT;
    PORTB &= ~SELECT;
    SPI.transfer(REG_OPMODE & 0x7F);
    if( SPI.transfer( 0 ) == RF_OPMODE_SLEEP) break;
    PORTB |= SELECT;
  }
 
 
  // cut power
  PORTD |= CUTPOWER;
 
  LowPower.powerDown( SLEEP_FOREVER, ADC_OFF, BOD_OFF );
}


void loop()
{
}

With this code restart now takes less than 500us and very little power.

To measure current during restart I hooked up a 220uF tantal cap to the power supply and cut the cord. See the following scope trace. Channel 1 is voltage at the tantal ac coupled, channel 2 is voltage over the moteino.



As you can see voltage at the tantal drops around 65mV as the Moteino is recharged. Using dV * C / t = I again I get an average current of 200nA - even better than estimated earlier.

This might actually be for real!


joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #6 on: January 31, 2016, 04:28:29 AM »
Tom,

Quote
What do you plan to use for persistent storage so that you know how many cycles you've run before contacting your gateway?  I'm assuming that you're not going to do that every power cycle.

So far this is just exploratory, but eeprom would be the obvious choice for persistent storage.

Quote
ISTM, if you're giving up Listen Mode and restarting the proc/radio, then the RTC approach is not only much lower power, but also more accurate and much longer intervals between power ups.  You do have to calibrate that RTC if you want accurate time keeping.  It's good enough to be sufficiently accurate over a few hours(~200PPM), but needs calibration beyond that.

First I have no intention of dropping listen mode. My current project is all about making listen mode work in a lifetime mote (as in a mote that will never require a battery change in your lifetime). That project requires switching off a buck converter during sleep which is where the circuit originates. It then just hit me that it could be used the way I presented.

I have an alternative design for the lifetime mote using the RTC but it requires more components and spoils the form factor a bit. So I'm glad that I can get (not quite) similar power savings with the cutting the cord approach should I ever want to.

If one just wants to go very low power as simply as possible few approaches can beat http://www.ti.com/lit/ds/symlink/tpl5010.pdf.

Joe 

TomWS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1735
Re: A new sleep mode using 225 nA
« Reply #7 on: January 31, 2016, 07:45:33 AM »
Joe,
I guess I'm missing how you would integrate Listen Mode and this shutdown technique.  Also, maintaining a counter (or state information) in EEPROM could quickly wear it out unless you move it around using a load leveling technique.

I still prefer the RTC approach because it allows you to schedule when you want to go to listen mode, when you want to report on a scheduled post basis, or when you want to simply 'sleep' (AKA powered off) for months on end...  It also has 256 bytes of battery backed up ram that you can use for persistent data.  And, given its power management hooks, it's simple to attach to a P MOSFET or LoadSwitch depending on your power source. 

If anyone is interested in this approach I might be able to post a reference design with just the proc, radio, and RTC (in a separate thread, of course  ;)

Tom
UPDATE: AND Coin Cell Battery, of course!
« Last Edit: January 31, 2016, 08:56:24 AM by TomWS »

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #8 on: January 31, 2016, 11:18:55 AM »
Quote
I guess I'm missing how you would integrate Listen Mode and this shutdown technique.

I think how it would work is when using the shutdown technique the Mote would regularly phone home to send data or status, pretty much like we did prior to listen mode. After each update the client would listen for a command from the server for a short period of time, also like earlier. I'd make one modification: I wouldn't just leave the client in rx after tx, but wait a couple ms and the switch on listen mode for a single rx cycle. If the server has something it sends back, it now sends a short burst of packets to ensure the client sees it.

Given this underlying dialog it would be easy to switch on listen mode selectively when you need it if you're very battery constrained.

Quote
Also, maintaining a counter (or state information) in EEPROM could quickly wear it out unless you move it around using a load leveling technique.

Ha - good point. I should have known there was a catch to your question  ;). For the counter this is easily solved though. Lets say we want the Mote to run for 100 years. That's about 53 million minutes. Each byte of EEPROM can be erased and written 100k times according to spec. If you think about it each erase / write cycle gives you 9 states: set each bit individually and then erase the byte. So we need 53m / ( 9 * 100k ) bytes for 100 years, which comes out to 59 bytes. 59 * 9 is 531 which would represent around 8 1/2h, so you could just set bits going from low to high bytes, the erase again left to right and take the count mod an appropriate number.

Point taken though. When you don't have RAM retention and no external RAM things are a bit more challenging. 

Quote
I still prefer the RTC approach because it allows you to schedule when you want to go to listen mode, when you want to report on a scheduled post basis, or when you want to simply 'sleep' (AKA powered off) for months on end...  It also has 256 bytes of battery backed up ram that you can use for persistent data.  And, given its power management hooks, it's simple to attach to a P MOSFET or LoadSwitch depending on your power source. 

I like the RTC, too. As I said I have an alternative schematic with the RTC. I'm not decided between both, yet. A lot depends on how the boards will layout. Like you say the RTC has a big advantage in my use case: it can serve as voltage supervisor and switch the buck on periodically to avoid a reset. That's clearly more elegant than the approach of either waiting for a reset, or (if using listen mode) periodically triggering recharges from the 328p.

Quote
If anyone is interested in this approach I might be able to post a reference design with just the proc, radio, and RTC

Oh, definitely. I'd like to see it. I'd like to cross check what I've done. I plan to post my designs here as well when they are ready.

Joe

WhiteHare

  • Hero Member
  • *****
  • Posts: 1297
  • Country: us
Re: A new sleep mode using 225 nA
« Reply #9 on: January 31, 2016, 12:51:01 PM »
Just a thought, but I wonder how it would compare if you hooked the interrupt pin from the radio to your Moteino power-up circuit and let both the circuit and the atmega328p go dead while the radio ran directly from the battery, but in a listen-mode with a very long sleep cycle (100na while asleep).  It would be similar to the old way of doing listen-mode, but the atmega328p and flash would be totally powered off rather than sleeping.

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #10 on: January 31, 2016, 02:13:22 PM »
Quote
in a listen-mode with a very long sleep cycle (100na while asleep)

Unfortunately the rfm69hw draws 1.2uA in idle. So saving 150nA for the 328p isn't really worth the trouble. That's why finding another wake mechanism gives such a nice payoff. We've come a long way since using the wdt with 4uA!

WhiteHare

  • Hero Member
  • *****
  • Posts: 1297
  • Country: us
Re: A new sleep mode using 225 nA
« Reply #11 on: February 09, 2016, 03:31:58 AM »

As the Moteino draws down the power from the cap it will reach the power-on reset threshold of 1.3V and trigger a reset. If you could then power up it up again the process would start from the beginning.   


Cheers, Joe

Is it safe to run the atmega at 1.3v?  I had thought anything lower than 1.8v was chancing corruption.

BTW, I wonder if two or three of these could be put in series to make a high efficiency charge pump?  For instance, maybe I could convert a dumb  solar LED garden light, which runs on one AA Ni-Cad battery, to power a Moteino without frittering away most of its stored energy on an inefficient boost converter.

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #12 on: February 09, 2016, 05:18:55 AM »
Quote
Is it safe to run the atmega at 1.3v?  I had thought anything lower than 1.8v was chancing corruption.

Running it at 1.3v is certainly not safe. But it seems the 328p can snooze in powerDown at (slightly above) these levels without problem if you reset afterwards. I haven't found anything in the data sheet on this question but it does seem to be at least conceptionally supported by the fact that you can disable the BOD during powerDown.

Quote
BTW, I wonder if two or three of these could be put in series to make a high efficiency charge pump?

I don't think that charge pumps are generally more efficient than boost converters. Plus you have the bootstrap problem. The way to achieve voltage conversion with very high efficiency at ultra low currents is to only run the converter intermittently and smartly disconnect it in between.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1297
  • Country: us
Re: A new sleep mode using 225 nA
« Reply #13 on: February 09, 2016, 12:10:25 PM »
Thanks!  Now I just need to find an energy storage vessel with a ultra low leakage current or else the benefit of running everything else on mere nanoamps will be just a rounding error.  The best Maxell supercap that I know of has a 6uA leakage current, which is a lot of waste in comparison to a 35nA RTC or a 150nA atmega328p.

BTW, you may or may not be interested in these:  http://www.cymbet.com/products/enerchip-real-time-clocks.php
« Last Edit: February 09, 2016, 12:14:25 PM by WhiteHare »

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: A new sleep mode using 225 nA
« Reply #14 on: February 09, 2016, 12:14:08 PM »
Just use a 100uF ceramic. They are available even in 0806, have super low esr and <30nA leakage. Capacity degrades with DC bias so gong for at least 6v rated voltage is recommended even if it will increase size a little.