I just got it down to 17uA. The sketch is attached below.
PROBLEM: I am running with two 1.5v Alkaline, for 3v total.
If I hook the batteries via Vin and the regulator, then I get about 120mA draw. Which is obviously, horrible.
If I hood the batteries to the 3.3v pin, I get about 120uA draw. Which is 100 times better, but still terrible for battery use.
If I hook to 3.3v and unsolder the voltage regulator chip, the draw goes to 17uA, which is OK. But this is a bummer, since it means that I must unsolder the regulator chip for each unit. But then the board cannot be reprogrammed if necessary. An awkward fix would be to do a new boardwith a jumper to connect or disconnect the regulator chip. Or am I missing something?
Here is the sketch:
// Sample RFM69 sender/node sketch, with ACK and optional encryption
// Sends periodic messages of increasing length to gateway (id=1)
// It also looks for an onboard FLASH chip, if present
// Library and code by Felix Rusu - felix@lowpowerlab.com
// Get the RFM69 and SPIFlash library at: https://github.com/LowPowerLab/
#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
#include <Wire.h>
#include <LowPower.h>
#define NODEID 13 //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
#define ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW //uncomment only for RFM69HW! Leave out if you have RFM69W!
#ifdef __AVR_ATmega1284P__
#define LED 15 // Moteino MEGAs have LEDs on D15
#define FLASH_SS 23 // and FLASH SS on D23
#else
#define LED 9 // Moteinos have LEDs on D9
#define FLASH_SS 8 // and FLASH SS on D8
#endif
#define SERIAL_BAUD 1200
int temp_address = 72;
SPIFlash flash(FLASH_SS, 0xEF30); //EF30 for 4mbit Windbond chip (W25X40CL)
RFM69 radio;
void setup() {
//Serial.begin(9600);
//Create a Wire Object
Wire.begin();
radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW
radio.setHighPower(); //uncomment only for RFM69HW!
#endif
radio.encrypt(ENCRYPTKEY);
//radio.setFrequency(919000000); //set frequency to some custom frequency
char buff[50];
sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
Serial.println(buff);
if (flash.initialize())
{
Serial.print("SPI Flash Init OK ... UniqueID (MAC): ");
flash.readUniqueId();
for (byte i=0;i<8;i++)
{
Serial.print(flash.UNIQUEID[i], HEX);
Serial.print(' ');
}
Serial.println();
}
else
Serial.println("SPI Flash Init FAIL! (is chip present?)");
}
long lastPeriod = 0;
void loop() {
char out_temp[30]="test";
char inbuffer[20];
int loopcounter=0;
radio.send(GATEWAYID, out_temp, 12 );
radio.sleep();
flash.sleep();
//LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF,SPI_OFF, USART0_OFF, TWI_OFF); // 1.36mA
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
}