Author Topic: My Moteino are using ~90uA during powerdown (SOLVED)  (Read 4641 times)

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
My Moteino are using ~90uA during powerdown (SOLVED)
« on: July 22, 2016, 01:52:26 PM »
Hi,

I am trying to power consumption down to ~5uA during powerDown on my Moteino R4 with flash and RFM69W_433MHz and it should be possible because I have seen posts where they are close to 1 uA.
The Moteino is powered by two AA batteries (3.14V at the moment).

I have changed the fuses to lfuse: E2 hfuse: DC efuse: FF so it is using internal 8MHz RC oscillator and brown out detection is disabled (BOD could most likely be left on but I disabled it anyway).

The mcp1703 voltage regulator is not removed yet... but I have removed the D9 led, flash chip and the radio on one of my Moteinos but it did not help.

I am using Arduino IDE 1.6.9 and the latest version of the libraries... what did I miss?
Do I have to remove the external crystal and/or voltage regulator (there is not much else to remove)?

This is the test sketch I am using:
Code: [Select]
#include "LowPower.h"
#include <RFM69_ATC.h>
#include <SPI.h>
#include <SPIFlash.h>

#define NODEID        100
#define NETWORKID     100
#define GATEWAYID     1
#define FREQUENCY   RF69_433MHZ
#define ENCRYPTKEY    "sampleEncryptKey"
#define FLASH_SS      8
SPIFlash flash(FLASH_SS, 0xEF30);
RFM69_ATC radio;

void setup() {
  pinMode (9, OUTPUT);
  radio.initialize(FREQUENCY,NODEID,NETWORKID);
  radio.encrypt(ENCRYPTKEY);
  radio.enableAutoPower(-70);
  radio.sleep();
  flash.initialize();
  flash.sleep();
}

void loop() {
    LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
    digitalWrite (9, HIGH);
    LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
    digitalWrite (9, LOW);   
}

« Last Edit: July 23, 2016, 04:04:41 AM by ove »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6018
  • Country: us
    • LowPowerLab
Re: My Moteino are using ~90uA during powerdown
« Reply #1 on: July 22, 2016, 03:01:06 PM »
YOu need >3.5v on VIN. Unless you remove the regulator and power 3.3v pin directly. Anything else won't work as long as the regulator in on there.
Use the deepsleep sketch in the examples, should give you 7uA on stock Moteinos (loaded).

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
Re: My Moteino are using ~90uA during powerdown
« Reply #2 on: July 22, 2016, 04:03:16 PM »
Thanks... I removed the regulator and now it is only using 4.3 uA during powerDown :)
The regulator is a bit small so I did not want to remove it unless I had to. It will not be as pretty if I try to solder it back again ;)

I tried both VIN and the 3.3v pin and both worked and the current was almost the same ~90uA... removing the regulator made a huge difference.

Best Regards
Ove

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6018
  • Country: us
    • LowPowerLab
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #3 on: July 25, 2016, 08:18:00 AM »
The regulator is a very small quiescent current and allows you to power the board with up to 16v. With stock fuses/settings/regulator, you get around 7uA in deep sleep.
You get some savings from removing the regulator (all other things equal). The tradeoff is that you cannot feed more than ~3.5v into the 3.3V pin to power the board.

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #4 on: July 25, 2016, 01:49:09 PM »
Are you sure it is possible to get down to ~7uA in deep seep with Moteino R4 without removing the voltage regulator?

The only thing I did to get from 90 to 4.3uA was to remove the voltage regulator... and I found this blog post so I am not alone with this problem:
https://harizanov.com/2013/03/funky-v2s-ldo-to-blame-for-high-sleep-current-now-fixed/

Did earlier Moteinos have another voltage regulator or has it always been mcp1703?

Best Regards
Ove

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6018
  • Country: us
    • LowPowerLab
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #5 on: July 25, 2016, 01:56:43 PM »
Are you sure it is possible to get down to ~7uA in deep seep with Moteino R4 without removing the voltage regulator?

Did earlier Moteinos have another voltage regulator or has it always been mcp1703?

Yes, try this sketch.
Yes, for a very long time.

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #6 on: July 25, 2016, 03:17:05 PM »
Also, verify that you have the very latest version of LowPower library.  IDE from 1.6.5 on, I believe, had compiler optimization that killed the BOD disable sequence.

Tom

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #7 on: July 25, 2016, 05:40:29 PM »
@ove,

Quote
The Moteino is powered by two AA batteries (3.14V at the moment).

The LDO target output voltage is 3.3v - how do you expect it to achieve that?
Try 3x AA when feeding through the LDO, some of your symptoms will go away.
« Last Edit: July 26, 2016, 05:44:29 AM by emjay »

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #8 on: July 25, 2016, 08:37:49 PM »
@ove,

Quote
The Moteino is powered by two AA batteries (3.14V at the moment).

The LDO target output voltage is 3.3v - how do you expect it to achieve that?
Try 3x AA, your symptoms will go away.
OP said he reprogrammed the fuses to operate with internal 8MHz clock.  3.14V is more than enough for that (he's also pulled the VR).  3xAA will blow out his radio module without the VR.

Tom

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #9 on: July 26, 2016, 05:34:51 AM »
I tried the DeepSleep sketch from Felix on a new Moteino R4 with Arduino IDE 1.6.9 and 8V on the VIN pin... and I got  ~220uA
Then I switched to ArduinoIDE 1.5.8 and it went down to ~100uA... so there is a problem with BOD disable sequence in newer versions of Arduino IDE.
Still a long way to 7uA

Best Regards
Ove

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6018
  • Country: us
    • LowPowerLab
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #10 on: July 26, 2016, 08:19:10 AM »
I tried the DeepSleep sketch from Felix on a new Moteino R4 with Arduino IDE 1.6.9 and 8V on the VIN pin... and I got  ~220uA
Then I switched to ArduinoIDE 1.5.8 and it went down to ~100uA... so there is a problem with BOD disable sequence in newer versions of Arduino IDE.
Still a long way to 7uA
Try IDE 1.0.6 see what you get with that.

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #11 on: July 26, 2016, 10:08:25 AM »
Try IDE 1.0.6 see what you get with that.
I get the same result with IDE 1.0.6... ~100uA

If I place my finger on pin 7-8-9 then it goes down to ~70uA... do I have to connect any pull down or pull up resistor?!

emjay

  • Full Member
  • ***
  • Posts: 120
  • Country: nl
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #12 on: July 26, 2016, 10:13:29 AM »
@ove,

Open DIO pins left as inputs are bad. You can enable the internal pullup to get out of the "floating" zone or just define them as output - with nothing connected, that does not consume load current.

ove

  • Newbie
  • *
  • Posts: 8
  • Country: se
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #13 on: July 31, 2016, 08:26:12 AM »
Open DIO pins configured as inputs is probably not a good idea but I was using the sketch provided by Felix and I wanted to replicate his ~7uA deep sleep on an unmodified Moteino R4.

I will switch LowPower library from the LowPowerLab fork (https://github.com/LowPowerLab/LowPower) to the original library from Rocket Scream (https://github.com/rocketscream/Low-Power) because it contains a patch so Brown Out Detector can be disabled even if you use newer Arduino IDE.
I will also replace the external crystal with a 32.768MHz one so I can keep track of time even when I am in low power mode.

It will take a week or two before I get the new crystal so I can continue my testing but I still think there is something wrong with the power regulator on the Moteino... I have to remove it to get below 90uA.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6018
  • Country: us
    • LowPowerLab
Re: My Moteino are using ~90uA during powerdown (SOLVED)
« Reply #14 on: August 01, 2016, 08:13:20 AM »
I will look into patching the LowPower lib if there are any updates.
But there is nothing wrong with the regulator(unless it's damaged somehow or the compiler will do something to prevent the deep sleep). You should be able to get the 7uA, that is why I posted that sketch.