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:
LMIC: After LMIC joins and sleeps the current drops to 45uA.
No code – Empty setup and loop – just induce sleep (current drops to 45uA).
No code – All pinModes to OUTPUT (current drops to 45uA).
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!!
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.
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?
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.
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.
For reference, to put quickly RFM95 into sleep mode
//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);
@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.
#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()
{
}