# Trying to get below 10uA in sleep

**URL:** <https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795>\
**Category:** End Devices (Nodes)\
**Created:** [July 11, 2018, 10:29pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795 "2018-07-11T22:29:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 11, 2018, 10:29pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/1 "2018-07-11T22:29:10Z")

</div>

I have been reading all the low power posts and techniques for days but am stuck at 45uA in sleep for my ATMEGA328p + RFM95 (915MHz) node.

I have removed all resistors and other components on the board. All I have is a MCP1703 – ATMEGA328P – RFM95

The uC is connected like this:

- Pin 10 - NSS
- Pins 11-13 to the equivalent SPI pins on the RFM95
- Pin 2 – DIO 0
- Pin 8 – DIO 1
- Pin 7 – DIO 2
- Pin 9 – to LED through a 1kohm resistor
- Pin 3 – to RESET through 10kohm resistor

I have tried three different methods and libraries for the ATMEGA sleep but they all give the same result (45uA):

- LowPower (RocketScream)
- SleepyDog (Adafruit)
- Direct AVR/sleep.h using examples from Nick Gammon’s tutorials

Different firmware tests:

1. LMIC: After LMIC joins and sleeps the current drops to 45uA.
2. No code – Empty setup and loop – just induce sleep (current drops to 45uA).
3. No code – All pinModes to OUTPUT (current drops to 45uA).
4. No code – All pinModes to OUTPUT and digitalWrite HIGH or LOW (FAIL – many mA)

I have two boards with this setup and they both show the same results. I have a third board that just has the MCP1703 + ATMEGA328p (No RFM95). This boards sleeps at 1.5uA!!

Any tips? I am running out of ideas.

---

<div class="post-metadata">

**Author:** ![alexsh1](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@alexsh1](https://www.thethingsnetwork.org/forum/u/alexsh1)\
**Post date:** [July 11, 2018, 11:54pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/2 "2018-07-11T23:54:45Z")

</div>

Its hard to say, but I’ll try to give it a shot:

- are you using Arduino Pro mini?
- what firmware loaded onto atmega328p / what fuse settings?

Normally, you should start with just a bare atmega328p board and sleep (lowpower from rocketscream is good). Then you add peripherals and more software (rfm95w + LMIC etc) and check current. MCP1703 would have a current consumption of around 2uA.

Do you have schematic of your project?

---

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 12, 2018, 12:12am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/3 "2018-07-12T00:12:49Z")

</div>

The board is called an Anarduino, but it looks identical to a Moteino that I have. The bootloader is Duemilanove. I’ve removed everything from the board except for the MCP1703, the reset button and led. I’ll find a schematic.

I was thinking about the fuses. Is there anything I should be looking for in the fuses related to low power?

Here are the fuses:  
BODLEVEL = 2V7  
RSTDISBL = []  
DWEN = []  
SPIEN = [X]  
WDTON = []  
EESAVE = []  
BOOTSZ = 256W\_3F00  
BOOTRST = [X]  
CKDIV8 = []  
CKOUT = []  
SUT\_CKSEL = EXTXOSC\_8MHZ\_XX\_16KCK\_14CK\_65MS

EXTENDED = 0xFD (valid)  
HIGH = 0xDE (valid)  
LOW = 0xFF (valid)

---

<div class="post-metadata">

**Author:** ![alexsh1](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@alexsh1](https://www.thethingsnetwork.org/forum/u/alexsh1)\
**Post date:** [July 12, 2018, 1:29am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/4 "2018-07-12T01:29:35Z")

</div>

I know this board, but I have not had any experience with it. With Molteino you get 5uA straight out of the box.  
These are my fuse setting for my atmega328p tqfp (8Mhz internal oscillator, disabled BOD) board  
atmega328\_384\_8.bootloader.low\_fuses=0xE2  
atmega328\_384\_8.bootloader.high\_fuses=0xDE  
atmega328\_384\_8.bootloader.extended\_fuses=0xFF

These settings are used to run it on a battery power.

Re bootloader, I can highly recommend Optiboot, but I do not think it would solve your issue re consumption.

All three boards are 100% identical?  
I think the only other option left is to de-solder rfm95w module (VCC pin) and see if it makes a difference.

---

<div class="post-metadata">

**Author:** ![alexsh1](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@alexsh1](https://www.thethingsnetwork.org/forum/u/alexsh1)\
**Post date:** [July 12, 2018, 9:27am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/5 "2018-07-12T09:27:36Z")

</div>

Another suggestion, please upload this sketch (change the pins)

```
#include <LowPower.h>
#include <lmic.h>
#include <hal/hal.h>

//==================THIS HAS TO BE CHANGED============
#define LMIC_NSS 10
#define LMIC_RXTX LMIC_UNUSED_PIN
#define LMIC_RST A0
#define LMIC_DIO0 2
#define LMIC_DIO1 7
#define LMIC_DIO2 8
//=====================================================

const lmic_pinmap lmic_pins = {
    .nss = LMIC_NSS,
    .rxtx = LMIC_RXTX,   
    .rst = LMIC_RST,
    .dio = {LMIC_DIO0, LMIC_DIO1, LMIC_DIO2},  
}; 
void setup()
{
Serial.begin(115200);
os_init();
LMIC_reset();
}

void loop() 
{
Serial.print("Sleeping now");
delay(50);
digitalWrite(lmic_pins.nss, LOW); // NSS
LMIC_shutdown();
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); 
}

```

Let’s see if it helps.

---

<div class="post-metadata">

**Author:** ![BoRRoZ](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/borroz/32/44234_2.png) [@BoRRoZ](https://www.thethingsnetwork.org/forum/u/BoRRoZ)\
**Post date:** [July 12, 2018, 9:45am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/6 "2018-07-12T09:45:14Z")

</div>

> [@Full Arduino Mini LoraWAN below 1uA Sleep Mode](https://www.thethingsnetwork.org/forum/t/full-arduino-mini-lorawan-below-1ua-sleep-mode/8059):
>
> Hi Guys, I’d like to introduce my new demo node, no wire, just battery powered, Arduino Mini 3.3V 8Mhz. I created a demo for a customer with a fully Temperature Humidity sensor (I2C SI7021) with Battery Level Monitor, and here it is. [image] [image] I know it’s not the smallest node, but what the deal with small nodes if the battery size is twice the node size? So I decided to test some with battery and my old [ULPNode](https://hallard.me/category/ulpnode/) Power Efficient Library (not released yet but soon) but trust me this lib…

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [July 12, 2018, 10:14am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/7 "2018-07-12T10:14:30Z")

</div>

> [@bborncr](#):
>
> Any tips? I am running out of ideas.

Are you actually setting up the RFM95 to go into sleep mode itself ?

My own preferance for working on issues like this is to start with the bare board, no added components, and ensure sleep is in the 1uA region.

Then add say the RFM95, minimum connections, SCK, MOSI, MISO, NSS and write to the registers directly to put the LoRa device into sleep. Then start connecting the extra pins, RESET, DIO0, DIO1, DIO2.

Then when your happy with the sleep current, which should be circa 2uA, perhaps try the LMIC library sleep stuff.

---

<div class="post-metadata">

**Author:** ![Charles](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/charles/32/45146_2.png) [@Charles](https://www.thethingsnetwork.org/forum/u/Charles)\
**Post date:** [July 12, 2018, 10:44am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/8 "2018-07-12T10:44:00Z")

</div>

That’s the best way to do this 😉

For reference, to put quickly RFM95 into sleep mode

```auto
    //Set NSS pin Low to start communication
    digitalWrite(LORA_CS,LOW);

    //Send Addres with MSB 1 to make it a write command
    SPI.transfer(0x01 | 0x80);
    //Send Data
    SPI.transfer(0x00);

    //Set NSS pin High to end communication
    digitalWrite(LORA_CS,HIGH);

```

---

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 12, 2018, 1:33pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/9 "2018-07-12T13:33:03Z")

</div>

Thanks for all the help!

@alexsh1 Your code gives me 45uA.  
@alexsh1 I am going to change the bootloader, I don’t know why it has Duemilanove.  
@LoRaTracker You are right, next thing to try is to isolate the RFM95 completely.

@Charles This code gives 5mA…maybe there is something missing? Being able to manually shutdown the RFM95 without LMIC would be great for troubleshooting.

```javascript
#include <SPI.h>
#include "LowPower.h"
#define LORA_CS 10

void setup()
{
  pinMode(LORA_CS, OUTPUT);
  //Set NSS pin Low to start communication
  digitalWrite(LORA_CS, LOW);

  //Send Addres with MSB 1 to make it a write command
  SPI.transfer(0x01 | 0x80);
  //Send Data
  SPI.transfer(0x00);

  //Set NSS pin High to end communication
  digitalWrite(LORA_CS, HIGH);
  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
}

void loop()
{
}

```

---

<div class="post-metadata">

**Author:** ![Charles](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/charles/32/45146_2.png) [@Charles](https://www.thethingsnetwork.org/forum/u/Charles)\
**Post date:** [July 12, 2018, 5:24pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/10 "2018-07-12T17:24:28Z")

</div>

Sorry, I don’t see any `SPI.begin()` initialization, may be your problem ?

---

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 12, 2018, 5:51pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/11 "2018-07-12T17:51:15Z")

</div>

Of course, I should have seen that!

---

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 13, 2018, 11:04pm UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/12 "2018-07-13T23:04:08Z")

</div>

SOLVED! It WAS the regulator after all. Thanks for all the help! I learned a lot about low power because of this, so there’s that 🙂

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [July 14, 2018, 12:11am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/13 "2018-07-14T00:11:49Z")

</div>

> [@bborncr](#):
>
> SOLVED! It WAS the regulator after all. Thanks for all the help! I learned a lot about low power because of this, so there’s that

The regulator ?

You said it was a MCP1703, this has a standby current of 2uA, so it was faulty ?

---

<div class="post-metadata">

**Author:** ![bborncr](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bborncr/32/42600_2.png) [@bborncr](https://www.thethingsnetwork.org/forum/u/bborncr)\
**Post date:** [July 14, 2018, 12:35am UTC](https://www.thethingsnetwork.org/forum/t/trying-to-get-below-10ua-in-sleep/15795/14 "2018-07-14T00:35:41Z")

</div>

It’s either faulty or it’s not really a MCP1703. There is no writing on the ic itself.
