Author Topic: Power Saving Techniques and Libraries  (Read 79884 times)

Clemens

  • NewMember
  • *
  • Posts: 20
Re: Power Saving Techniques and Libraries
« Reply #15 on: June 14, 2014, 03:56:41 PM »
Has someone tried out LowPower vs. Narcoleptic lib? I will use a node who's logging time and some sensor values and transmit it once a day to a gateway with GPRS access. Narcoleptic has a nice time / date adjusting feature this is not available in LowPower.

But the biggest downside of Narcoleptic seems to be that ADC is not shut down and power consumption is so 0.4 mA vs. 0.4 uA, see http://forum.arduino.cc/index.php?topic=121096.msg924613#msg924613 Update: Seems there is an option to disable ADC via

https://code.google.com/p/narcoleptic/source/browse/examples/MerlinTheCat/MerlinTheCat.pde
Quote
  Narcoleptic.disableADC();

Has someone tried out LowPower vs. Narcoleptic with the Moteino and measured power consumption?
« Last Edit: June 16, 2014, 03:27:06 PM by Clemens »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Power Saving Techniques and Libraries
« Reply #16 on: June 14, 2014, 08:28:38 PM »
I think I did at one point and with all the same options off I did not see a worthy difference between the two. They are basically doing the same thing...

Alia

  • NewMember
  • *
  • Posts: 3
Re: Power Saving Techniques and Libraries
« Reply #17 on: July 24, 2014, 07:42:56 AM »
Hi,

I'm using the LowPower library with my moteino R4 with RFM69H and i'm not getting the results expected in terms of power consumption.
It's drawing 0.99 mAmps from the battery when using

Code: [Select]
radio.Sleep();
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

which is driving me nuts since according to the rocketscream webpage and according to the first post on this thread, the consumption should be way lower than that.

I even tried disabling the wdt but that wasn't useful.
Any hints?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Power Saving Techniques and Libraries
« Reply #18 on: July 24, 2014, 07:57:55 AM »
You need to sleep not just the arduino but the radio, flash, and any other peripherals/sensors that you have attached.

Charly86

  • Jr. Member
  • **
  • Posts: 74
  • Country: fr
Re: Power Saving Techniques and Libraries
« Reply #19 on: August 05, 2014, 02:28:32 PM »
I've been able to have 4uA consumption using a moteino like but with RFM12B module powered by a mosfet, removing power from RFM12B, then setup correctly your IO port so they are not sinking or drawing any current when in sleep mode.

Using watchdog you can't go below 4uA because this is the power the Watchdog need.

But I'm working hard on ultra low power version I'm close to 500nA in sleeping mode, that makes a huge difference but I think I found a way to close down to 150nA yes (0.150 uA )but I need external component for this. I will post a article soon about this.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Power Saving Techniques and Libraries
« Reply #20 on: August 05, 2014, 04:27:59 PM »
I've been able to have 4uA consumption using a moteino like but with RFM12B module powered by a mosfet, removing power from RFM12B, then setup correctly your IO port so they are not sinking or drawing any current when in sleep mode.

Using watchdog you can't go below 4uA because this is the power the Watchdog need.

But I'm working hard on ultra low power version I'm close to 500nA in sleeping mode, that makes a huge difference but I think I found a way to close down to 150nA yes (0.150 uA )but I need external component for this. I will post a article soon about this.
Sounds good, but there are some caveats. When you run on battery (lipo?) you might get close to 3.3V or even less and the mosfet eats some of that voltage since it has internal resistance. Since batteries don't discharge linearly you're spending most of the time in the lower voltage part of lifetime of the battery, so something to keep in mind. Also you will need to re-initialize the radio every time you wake up, which is just a tradeoff you need to live with. The radios have a low power sleep mode but that will need more than 1uA.

ColinR

  • Full Member
  • ***
  • Posts: 176
Re: Power Saving Techniques and Libraries
« Reply #21 on: August 22, 2014, 05:36:06 PM »
The solution this other forum suggests is to perform a Serial.flush(); just prior to the  LowPower.p(SLEEP_8S, ADC_OFF, BOD_OFF); call.

Thanks for this.

C
CuPID Controls :: Open Source browser-based sensor and device control
Interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

Charly86

  • Jr. Member
  • **
  • Posts: 74
  • Country: fr
Re: Power Saving Techniques and Libraries
« Reply #22 on: August 27, 2014, 03:51:00 AM »
Hi guys,

Correct, you need Serial.flush() before every entering into sleep mode, made me mad until I found it.

Concerning coin cell, I've made several node using them, then send data to emoncms with my dual gateway board (RFM12B + RFM69) and I'm facing the Coin Internal resistor problem.
I was hoping sending data until battery come to 2.2V (min voltage for RFM12) or 1.8V (for RFM69) but on the real life, all my nodes start loosing send packet from about 2.7V of the battery. I spend much time to figure out until I read this excellent document from TI http://www.ti.com/lit/wp/swra349/swra349.pdf
Very good reading, this mean at 2.7V peak current can be up to 12mA for RFM12B and so decrease voltage for about 0.5V, and we're at the limit of RFM12B, and it's same thing with RFM69 (more current about 30mA) even it it works until 1.8V the voltage drop is about 1V.
Of course I tried adding 100uF cap in // of the battery to see (suggested in the doc above)
I will try with RF module in sleep mode instead powering it off with mosfet, may be startup will need less peak current like this and will work longer.
Anyway this is not the ideal solution, so I need to go backward to my 1st idea, add Boost Converter and enable it only when I need juice, this is working fine also but I need to do another design.

Tomega3

  • NewMember
  • *
  • Posts: 35
Re: Power Saving Techniques and Libraries
« Reply #23 on: December 12, 2014, 07:39:19 PM »
I am just about to order a few Moteinos. I have been reading the excellent RFM69 library files, the hoperf rfm69 manual (www.hoperf.com/upload/rf/RFM69W-V1.3.pdf) and the LowPower library (see https://github.com/rocketscream/Low-Power ) files and have a question about sleeping the moteino and radio. I see that the current LowPower library will work with the Moteino )avr 328p) but not with the Moteino Mega. (avr 1284p)

If I understand correctly a radio.sleep() call will put the radio in low power mode but it can still fire an interrupt indicating packet received or packet sent.

Looking at the LowPower powerDownWakeExternalInterrupt.ino example I am not sure what will happen in the watchdog timer routine if it attaches an interrupt to the same pin as the rfm69 interrupt pin. Is this even possible to share an interrupt or am I going about waking up from an incoming packet while the Moteino is sleeping all wrong.

It appears that the LowPower(powerDown() calls lowPowerBodOn or lowPowerBodOff both of which call cli and sei (disable interrupts and enable interrupts). I think I can use LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); without calling attachinterrupt before it and detachInterrupt after it but this will probably prevent waking up the Moteino upon the radio receiving data when the radio and Moteino are both sleeping because interrupts are disabled during sleep..

My goal is to put the Moteino and radio in low power mode using a watchdog timer to 'sleep' for so long unless the radio indicates it has data available. Any and all help in doing this is appreciated.




TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Power Saving Techniques and Libraries
« Reply #24 on: December 12, 2014, 09:09:10 PM »
I would suggest looking into the Sleep_n0m1 library.  I find that it's more comprehensive than the Lowpower library.

I've incorporated this into my own Moteino infrastructure so I just 'sleep' for as long as I want for the specific application and everything is managed and recovers nicely on 'wakeup'...

Tom

Tomega3

  • NewMember
  • *
  • Posts: 35
Re: Power Saving Techniques and Libraries
« Reply #25 on: December 13, 2014, 10:58:56 PM »
Thanks for the info on the Sleep_nom1 library
I will take a look at it.

I think I can Sleep in Low Power mode a mote that only transmits.
I think I want to know if I can sleep a mote in Low Power mode that is a receiver.
The low power sleep code I have looked at all disable all interrupts except the watchdog interrupts during sleep.
If this is the case, wont I miss an incoming packet from the radio since int2 is disabled?

Tom

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: Power Saving Techniques and Libraries
« Reply #26 on: December 14, 2014, 07:44:08 AM »
Thanks for the info on the Sleep_nom1 library
I will take a look at it.

I think I can Sleep in Low Power mode a mote that only transmits.
I think I want to know if I can sleep a mote in Low Power mode that is a receiver.
The low power sleep code I have looked at all disable all interrupts except the watchdog interrupts during sleep.
If this is the case, wont I miss an incoming packet from the radio since int2 is disabled?

Tom
I'll have to let Felix answer about an receive capability while in radio.sleep() mode.  Somehow I doubt that it can receive in this mode given the overall power of a Moteino with an RFM69HW in sleep mode consumes about 6uA.

I would try to structure your receive/tx end points so that you can 'sniff' at fixed intervals but with as low a duty cycle as possible.  If the TX side has enough power to tx with multiple retries and the total time for all the retries is longer than your rx interval, you should be able to catch the TX signal during one of the shots.

I'm curious about a low power receive only mote.  What is it used for?  I do have at least one of these kinds of devices (a battery operated sprinkler valve) but I set it up to 'ping' my gateway at reasonable intervals and the gateway, if it has anything to send to the device, will ACK with a flag saying, "Stay online, I've got something for you."

Tom

KanyonKris

  • Full Member
  • ***
  • Posts: 113
Re: Power Saving Techniques and Libraries
« Reply #27 on: December 14, 2014, 11:58:23 PM »
As TomWS mentioned, in order to receive you're going to need to keep the radio on and that costs 16 mA + the power to run the ATMega enough to not miss any data that the radio may receive.

If your project permits, a technique I've used is to transmit then keep the radio on and listening for say 100ms then if no data was received go to sleep.

Tomega3

  • NewMember
  • *
  • Posts: 35
Re: Power Saving Techniques and Libraries
« Reply #28 on: December 15, 2014, 08:14:26 PM »
Hi KanyonKris
I am interested in learning how you keep the radio on and listening for say 100ms then if no data was received go to sleep.
I appreciate the help along with the info that I must keep the radio on so not to miss any packets, I think a sleep wake up duty cycle could be found to save power and not miss too many packets.

Thanks again

Tomega3

  • NewMember
  • *
  • Posts: 35
Re: Power Saving Techniques and Libraries
« Reply #29 on: December 15, 2014, 09:30:52 PM »
I think I may have found an answer to the question: can a sleeping radio receive data?

I found a reference to this on this forum but did not copy the topic link.  :-[

The answer, from Felix, goes like this:
A packet will only be received if the radio is listening.
If it's sleeping it will not "hear" anything. (receiverDone returns false).

My text here:   
I am assuming it cant send anything too. send and sendwithretry will fail.

So... during radio.sleep() packets received will be missed.
So... some sort of wake / sleep duty cycle should be implemented to try not to miss to many incoming packets while sleeping to save power.

So... its OK to sleep the radio and the moteino and  use a watchdog timer to 'wake' up the moteino and the radio every so often to check for received data and maybe send a "hello I am awake to the Gateway.

   
Did I get this correct?

Thanks