LowPowerLab Forum

Hardware support => Moteino => Topic started by: TacticalSnack on October 08, 2014, 10:38:32 PM

Title: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: TacticalSnack on October 08, 2014, 10:38:32 PM
At the risk of raising a solved topic, I'm powering a bare moteino r4 at 3 VDC from a bench supply and running the sketch below. I have a resulting current draw during sleep of 73µA which from data sheets and others' experiences is quite high. Side note, the moteino r4 has had the flash chip removed in the attempt to discover why the current was so high.

#include <LowPower.h>

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

int led = 9;

void setup() {               
  pinMode(led, OUTPUT);     
}

void loop() {
  LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);
  digitalWrite(led, HIGH);
  delay(10);
  digitalWrite(led, LOW);
  delay(990);
}


I also tested a second moteino with flash chip using pretty much the same sketch but putting the flash to sleep with the result of a 1 or 2 µA increase from the previous test. I have also confirmed readings with a second meter. I'm pretty much out of ideas as to why my current draw is so high.
Title: Re: high moteino r4 power consumption during sleep
Post by: Felix on October 09, 2014, 08:50:58 AM
I would say you're way below spec at 3V. It might work but I don't know exactly how the regulator will handle that.
Give it at least 3.5V on the VIN pin. Sounds like there is nothing else attached to the board. But if not, you would need to power down anything else attached to the Moteino (any sensors etc, if any).
You also need a good true RMS multimeter to get a ballpark of what's going on.
And yes there are other topics in the forum where this subject was discussed, worth a search.
Title: Re: high moteino r4 power consumption during sleep
Post by: TacticalSnack on October 09, 2014, 09:22:22 AM
Thanks, Felix. Forgot to consider 3VDC is outside the safe operating area for 328P when running at 16 MHz. I guess I'll be learning about fuses sooner rather than later. I will try 3.5V on VIN asap and update.
So I gather my Extech EX330's not going to capture a good reading? I also put 3V to the 3v3 pin to bypass the regulator. I have the moteino on a breadboard with nothing else attached (moved moteino to another spot on the breadboard and even tried another breadboard altogether).

I've noticed the following posts but have failed to discover a solid reason ...
Power Saving Techniques and Libraries - https://lowpowerlab.com/forum/index.php/topic,286.0.html (https://lowpowerlab.com/forum/index.php/topic,286.0.html)
Moteino draws excessive current - https://lowpowerlab.com/forum/index.php/topic,494.msg2777.html#msg2777
Moteino v2 sleep mode: is 0.17 mA at 3.3 ... - https://lowpowerlab.com/forum/index.php/topic,166.msg639.html#msg639
Title: Re: high moteino r4 power consumption during sleep
Post by: TacticalSnack on October 10, 2014, 09:34:21 PM
Yep, as you suspected, VCC was too low. I started reading around 6µA when 3.5V was applied.
Title: Re: high moteino r4 power consumption during sleep
Post by: Felix on October 11, 2014, 10:06:55 AM
Right, so you always want to supply at least 3.3V + the dropout voltage of the regulator which by the way is a very low dropout regulator.
If you look at the datasheet, there are some (Dropout V vs Load A) graphs. If the load is very small the dropout is almost 0. So you should be able to verify this if you supply anywhere above 3.3V.
As the load increases the dropout will also increase so your VIN should allow some room for that.
Conversely, as the load increases, your concern for very low power decreases.

Datasheet here: http://ww1.microchip.com/downloads/en/DeviceDoc/22049f.pdf
Title: Re: high moteino r4 power consumption during sleep
Post by: emjay on October 11, 2014, 11:03:53 PM
When operating at or below the dropout voltage, an effect that is often not shown on the LDO datasheets is an increase in quiescent current. The error amplifier is doing its best to turn on the pass element harder, but to no avail once the lowest Rds is reached.  The overdrive however kicks up the current consumed by the LDO itself, leading to a rise (often substantial in μA) in total current drain from the source.

The 'fix' is as Felix describes - avoid this operating region if you are seeking the lowest sleeping draw.
Title: Re: high moteino r4 power consumption during sleep
Post by: TacticalSnack on October 17, 2014, 04:42:47 PM
Thanks emjay. I definitely noticed that bump in power consumption when I was too low, hence the confusion.
Title: Re: high moteino r4 power consumption during sleep
Post by: Lensdigital on November 08, 2014, 09:32:34 PM
Quote from: emjay on October 11, 2014, 11:03:53 PM
When operating at or below the dropout voltage, an effect that is often not shown on the LDO datasheets is an increase in quiescent current. The error amplifier is doing its best to turn on the pass element harder, but to no avail once the lowest Rds is reached.  The overdrive however kicks up the current consumed by the LDO itself, leading to a rise (often substantial in μA) in total current drain from the source.

The 'fix' is as Felix describes - avoid this operating region if you are seeking the lowest sleeping draw.
I'm having same issue, but must power it by 3V coin cell...  Would replacing MCP1703 with a 3.0V version solve issue with quiescent current?  Also I'm running ATMega328p chip at 8Mhz so it's completely within specs...
Title: Re: high moteino r4 power consumption during sleep
Post by: emjay on November 09, 2014, 08:19:10 AM
@LensDigital,

Unfortunately no, since the coin cell is nominal 3V, there is again no head room for a 3.0V LDO.
For lowest "waste" consumption, dispense with the LDO completely unless you have some sensor attached that really needs a stable supply - with adequate decoupling, the ATMega and RF module don't care. You will see this technique over at http://www.digitalsmarties.net/products/jeenode-micro
Note that the LDO must be completely removed, just bridging its Vin to Vout or leaving Vin open circuit with power on Vout will still have a quiescent drain.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: ned on December 27, 2014, 09:07:10 PM
Hi all,

I am having problems minimising my current draw in sleep mode. I'm new to this so I guess I've made a simple mistake, but can't for the life of me find what I've done wrong. I think I've read everything on this forum on similar issues. Details of my test below:

-Moteino R4, with RFM69W, no flash, no peripherals attached
-test code: as for the OP TacticalSnack. I also included radio.sleep()
-5V to Vin (I also tried 3.5V to Vin, with no change in current)
-equal results with two identical new Moteino R4's

I can't get the current draw below 1.5mA in sleep mode. Any ideas?

cheers
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 03, 2015, 10:10:07 PM
Ned - how are you measuring current?
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: ned on January 03, 2015, 10:32:40 PM
I measured the current using the ammeter of a multimeter.

To double check this value I also measured the voltage drop over a 10 Ohm resister in series, which was ~15mV. In this case there was 5V applied to Vin so there was still ample voltage at Vin.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 04, 2015, 04:27:29 PM
The reason I asked is because I've had others measure it "with a multimeter" and after some time chasing rabbits in wonderland it turned out they did it with a $10 chinese DMM in AC mode :)
But it "sounds" like you are doing it right, just good to check before we move on.
As long as you put everything to sleep the current should be in the 10 uA range or thereabouts. I assume your atmega, regulator and radio are still in intact condition and have not been shorted or overdriven in any way. Those may be common causes for high current. Code would be nice to be included, hard to chase other code in other posts you know.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: ned on January 04, 2015, 06:34:01 PM
Understood, well I used a TENMA 72-7720, so it's not very expensive at ~$35 but it should be able to measure below 1mA. I've tried this with a brand new moteino with equal results. The code follows:


#include <LowPower.h>
#include <RFM69.h>    //get it here: https://www.github.com/lowpowerlab/rfm69
#include <SPI.h>
#include <SPIFlash.h> //get it here: https://www.github.com/lowpowerlab/spiflash

/*
  Turns on an LED on for 10ms, then goes into sleep mode for 4s, repeatedly.
*/

#define NODEID        2    //unique for each node on same network
#define NETWORKID     100  //the same on all nodes that talk to each other
#define GATEWAYID     1
//Match frequency to the hardware version of the radio on your Moteino (uncomment one):
#define FREQUENCY   RF69_433MHZ
//#define FREQUENCY   RF69_868MHZ
//#define FREQUENCY     RF69_915MHZ

int led = 9;
RFM69 radio;

void setup() {               
  pinMode(led, OUTPUT);     
  radio.initialize(FREQUENCY,NODEID,NETWORKID);
  radio.sleep();   //stops led blink
}

void loop() {
  LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);       //1.5mA measured
  //LowPower.idle(SLEEP_4S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF);      //3mA measured
  digitalWrite(led, HIGH);
  delay(10);
  digitalWrite(led, LOW);
}
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 04, 2015, 08:53:37 PM
Can you tell me what is the current reading when you have the arduino LED blink program running (ie when nothing is put to sleep explicitly)?
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: ned on January 05, 2015, 09:09:40 AM
If I replace LowPower.powerDown() with delay(), then I measure around 7mA continuously.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 05, 2015, 09:15:23 AM
Yep that is not right. It should be around 15-20mA. So either your DMM is faulty or you're not measuring it correctly.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 05, 2015, 10:41:51 AM
How about a controlled current test:
Measure the current with your DMM that goes through 10K and 100K resistors from a 5V source. You should get ~500uA and ~50uA respectively.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: ned on January 05, 2015, 07:28:21 PM
Well this is embarrassing. I did those tests and the DMM looks fine, even measures down to 5uA with 1M resistor. I tested the original code again with the same hardware setup and now I'm getting 25uA in sleep mode. I'm pretty certain that everything is the same but I must have done something differently. Sorry for all the trouble! I assume that the MCU completely reset with each code upload? So it can't retain any settings from a previous code right?

Is 25uA the lowest I can get? I've read others achieving lower values in sleep mode, but not sure what I need to do software wise to reach that.

Thanks again.

Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on January 05, 2015, 08:06:32 PM
Cool.
Don't expect much accuracy with a $35 DMM :)
I'd say 25uA is pretty good. I am usually getting around 10uA on the bare Moteino with nothing on it measuring with a Fluke 87V. Still others will say there is a burden resistor in the DMM etc ... yes and you can't get absolute accuracy unless you use much more expensive gear or use an accurate ammeter like the EEVBlog uCurrent kit.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: mattmunee on June 23, 2015, 11:03:53 PM
Quote from: ned on December 27, 2014, 09:07:10 PM
Hi all,

I am having problems minimising my current draw in sleep mode. I'm new to this so I guess I've made a simple mistake, but can't for the life of me find what I've done wrong. I think I've read everything on this forum on similar issues. Details of my test below:

-Moteino R4, with RFM69W, no flash, no peripherals attached
-test code: as for the OP TacticalSnack. I also included radio.sleep()
-5V to Vin (I also tried 3.5V to Vin, with no change in current)
-equal results with two identical new Moteino R4's

I can't get the current draw below 1.5mA in sleep mode. Any ideas?

cheers

Well, I should probably start my own thread, but I seem to be having this same problem.  I've tried to run a sketch which ONLY puts the avr to sleep.  No serial or radio objects are ever instantiated, and I draw roughly 1.5mA on two different Moteinos (R4).  I'm powering with 5V through the FTDI PWR pin, which should be identical to using the VIN pin.  My multimeter is inline with the PWR signal, using a pair of jumpers.  It's a cheapish $35 meter, but I've also used it to measure uA levels using the same voltage supply and a 10k resistor.  As was suggested, I also ran the built in Blink sketch, and I draw roughly 8mA.  Any idea what could be causing this high consumption?
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: Felix on June 24, 2015, 07:36:31 AM
Quote from: mattmunee on June 23, 2015, 11:03:53 PM
I seem to be having this same problem.  I've tried to run a sketch which ONLY puts the avr to sleep.  No serial or radio objects are ever instantiated, and I draw roughly 1.5mA on two different Moteinos (R4).  I'm powering with 5V through the FTDI PWR pin, which should be identical to using the VIN pin.  My multimeter is inline with the PWR signal, using a pair of jumpers.  It's a cheapish $35 meter, but I've also used it to measure uA levels using the same voltage supply and a 10k resistor.  As was suggested, I also ran the built in Blink sketch, and I draw roughly 8mA.  Any idea what could be causing this high consumption?
If you only sleep the AVR you might be missing the radio and flash. Those and anything else attached should be slept otherwise they will be in IDLE/STANDBY modes which draws some current (not so much on the FLASH MEM which draws only a few dozen uA if in IDLE mode).
The most important is the radio, instantiate it and sleep it as shown in this sketch (https://github.com/LowPowerLab/RFM69/blob/master/Examples/MotionMote/MotionMote.ino#L122), and let us know your findings.
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: mattmunee on June 25, 2015, 08:58:09 PM
Thanks for the reply, Felix.  I ran the attached sketch with no edits.  For the record, there is no flash chip installed.  I get 1.36mA.  Thoughts?
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: TomWS on June 25, 2015, 09:16:03 PM
Quote from: mattmunee on June 25, 2015, 08:58:09 PM
Thanks for the reply, Felix.  I ran the attached sketch with no edits.  For the record, there is no flash chip installed.  I get 1.36mA.  Thoughts?
I suggest that you change line 134 to:

while (1)
{
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}

if you really want to measure the power while sleeping.  Otherwise you'll measure the average power between sleeping for 8 seconds and running whatever code is in that sketch.

Tom
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: mattmunee on June 27, 2015, 01:43:43 PM
So, today everything works fine in terms of power consumption (kind of).  I've finally reached ~25uA when asleep!  I'll post more about that in the other forum.  I have noticed some weird behavior a couple of times, when I've switched power sources.  Every once in a while, the sketch will consume ~1.3mA.  My test code is below.  It seems like I may accidently be touching a different pin with my probes which puts it into a weird state, but I haven't nailed down exactly what it is that's causing it.  Generally if I go back and switch sketches and switch back, the behavior goes away.  I guess I won't worry about it too much now, but if anyone has thoughts on this, it would be helpful. 

I don't think I'm crazy though, since ned stated basically the same thing that I'm seeing.  He started with 1.5mA, then he was unsure what he changed, and all of a sudden he was getting 25uA. 


#include <LowPower.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}
Title: Re: high moteino r4 power consumption during sleep at 3Vin [answered]
Post by: TomWS on June 27, 2015, 03:30:13 PM
Quote from: mattmunee on June 27, 2015, 01:43:43 PM
So, today everything works fine in terms of power consumption (kind of).  I've finally reached ~25uA when asleep!  I'll post more about that in the other forum.  I have noticed some weird behavior a couple of times, when I've switched power sources.  Every once in a while, the sketch will consume ~1.3mA.  My test code is below.  It seems like I may accidently be touching a different pin with my probes which puts it into a weird state, but I haven't nailed down exactly what it is that's causing it.  Generally if I go back and switch sketches and switch back, the behavior goes away.  I guess I won't worry about it too much now, but if anyone has thoughts on this, it would be helpful. 

I don't think I'm crazy though, since ned stated basically the same thing that I'm seeing.  He started with 1.5mA, then he was unsure what he changed, and all of a sudden he was getting 25uA. 


#include <LowPower.h>

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}
This code is not instantiating the RFM69 device and putting it in sleep mode (as advised several comments back), therefore you're totally dependent on how the radio powers up into an unknown state.

Tom