NRF24L01+ , temp sensor and 328P not so low power

I’ve created a coin cell powered 328P that reads the room temperature from an i2c temperature sensor and transmits the reading using the NRF24L01+. The current consumption now is steady around 2mA and i’d like to get it a lower. My programming skills are weak so any help would be appreciated.

Below is the Code and Schematic

// Low Power Library https://github.com/rocketscream/Low-Power  
// http://www.bajdi.com
// Nrf24L01 connected to Mega 2560
// Nrf24L01 connection details http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo
// Transmit analog value from pin A0 to the receiver
 
#include "LowPower.h" 
#include <SPI.h>
#include <Wire.h>  
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>

//Temp Stuff
//int TMP75_Address = 0x49;
int tmp102Address = 0x49;
int numOfBytes = 2;

 
float rate=12.3;

 
void setup(){
 
  //Serial.begin(9600);
 
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"clie1");
  Mirf.payload = sizeof(rate);
  Mirf.config();
  
    // Initialize TMP75
  //Wire.beginTransmission(TMP75_Address);       // Address the TMP75 sensor
  //Wire.write(0x01);                       // Address the Configuration register 
  //Wire.write(B01100000);                         // Set the temperature resolution 
  //Wire.endTransmission();                      // Stop transmitting
  //Wire.beginTransmission(TMP75_Address);       // Address the TMP75 sensor
  //Wire.write(0x00);                          // Address the Temperature register 
  //Wire.endTransmission();                      // Stop transmitting 
}
 
void loop()
{
    // ATmega328P, ATmega168
  LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, 
                SPI_OFF, USART0_OFF, TWI_OFF);

  
  //rate = analogRead(A0);
  float tempx = readTemp();
 
  Mirf.setTADDR((byte *)"serv1");
 
  //Mirf.send((byte *) &rate);
  Mirf.send((byte *) &tempx);
  
 
  while(Mirf.isSending())
  {
  }
  
  Mirf.powerDown();
}  
  
 //==========================================================//
// Read temperature
float readTemp()
{
  // Now take a Temerature Reading
  //Wire.requestFrom(TMP75_Address,2);  // Address the TMP75 and set number of bytes to receive
  //byte MostSigByte = Wire.read();              // Read the first byte this is the MSB
  //byte LeastSigByte = Wire.read();             // Now Read the second byte this is the LSB

  // Being a 12 bit integer use 2's compliment for negative temperature values
  //int TempSum = (((MostSigByte << 8) | LeastSigByte) >> 4); 
  // From Datasheet the TMP75 has a quantisation value of 0.0625 degreesC per bit
  //float temp = (TempSum*0.0625);
  //return temp;  
  // Return the temperature value
  Wire.requestFrom(tmp102Address,2); 

  byte MSB = Wire.read();
  byte LSB = Wire.read();

  //it's a 12bit int, using two's compliment for negative
  int TemperatureSum = ((MSB << 8) | LSB) >> 4; 

  float celsius = TemperatureSum*0.0625;
  return celsius;
}

Schematic_R1.1.PDF (49.6 KB)

I would think that the radio device is going to be the stumbling block for you there.

You don't want to use idle, you want to use powerDown mode. That'll drop your current consumption by a lot. Especially since you're just running the Watchdog timer to wake up, not a Timer.

Take a look at the 328P datasheet and you'll find at 8 MHz and 3 V you should be drawing somewhere around 0.6 mA. SLEEP_MODE_POWER_DOWN will drop that down to a few microamps with the WDT running.

I also don't see you shutting down the temp sensor before sleeping. That'll save a fewmicroamps too.

I forgot to mention that the temperature is properly being transmitted to the receiver. Every eight seconds the receiving module displays the transmitters temperature on a small display.

Tonight I'll try LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); instead of LowPower.idle(SLEEP_8S, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_OFF, SPI_OFF, USART0_OFF, TWI_OFF);

Mike

Hey Jiggy-Ninja, Just letting you know that LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF); brought the current draw from 2mA down to 28uA. Awesome and thanks a million! A quick video of the hardware so far.

http://youtu.be/lnTe4XPHePs?list=UUXpjUx31kBU96EtzbuK0xkQ

Mike