Recommendation for low power improvement of wireless sensor

Hi,
I created a "development instance" of a low power wireless sensor based on the arduino pro mini clone and nrf24l01+ wireless module.
I removed LEDs from arduino pro mini as well as I removed the onboard voltage regulator (ams1117 3.3) and I power the arduino via VCC pin with 3.3V. As a source of 3.3V I use step up voltage regulator with low quiescent current. It uses 2108A 1304/33 step-up ic. I removed the LED from the step up converter regulator as well to save as much power as possible. I power the step up converter from 2xAAA alkaline batteries. So the final setup of the wireless node is:

Arduino pri mini
Step up 3.3v converter
nrf24l01+
DHT22

I wanted to test it how it will perform, so I wrote a code which will measure temperature and humidity every ~5minutes and send it to second arduino via nrf24l01+. Second arduino writes it into database via ethernet. In the payload I send humidity, temperature, voltage of the AAA batteries (measured via analog pin), and counter (number of measurement).

I use Rocket Scream LowPower library and put the arduino to power down and wake it every 8 seconds (internal timer which works in power down mode) and I cound number of wakeups and if I have 37th wakeup, I measure and send values.

It works perfectly. Consumption is following:
In the power down, arduino alone draws from step-up conv: 30uA
In the power down with arduino alone, step-up draws from 2xAAA batt: 50uA
If I hook up the DHT and NRF24l01+ which is in power down mode as well: 80uA is drawn from AAA batteries.
I can't measure consumption during measuring and transmitting as it is fast and I have only basic multimeter, no oscilloscope.

I am interested into this:

  • Is there still a way for improving consumption? How?
  • Does measuring of voltage via analog pin (5 times measure and then average the value) consumes a lot of power? Should I avoid it? I use it as an "alarm value" that I would know the batt is weak

I have a feeling that batteries will not last as much as I had expected. I run it for ~3.5 days and I can see the voltage on the batteries dropped from initial 3.2V to 3.06V. I do not know if it will stick to this decreasing-fast tendency, but if so, then I can run it for days and not for months as I had expected. Here is the graph with voltage/time:

I use this loop code:

void loop(void)
{
    LowPower.powerDown( SLEEP_8S, ADC_OFF, BOD_OFF ); 
    currentCounter++;
    delay(20);
    if ( currentCounter - lastCounter >= 37 )
    {
        lastCounter=currentCounter;            
        int chk = DHT.read22(DHT22_PIN);
        if (chk == 0)
        {
            radio.powerUp();
    
            int sensorValue = analogRead(A3);
            sensorValue += analogRead(A3);
            sensorValue += analogRead(A3);
            sensorValue += analogRead(A3);
            sensorValue += analogRead(A3);
            float voltage = ( sensorValue/5) * (3.32 / 1023.0 ); 
    
            radio.stopListening();
            payload.B=DHT.temperature;
            payload.C=DHT.humidity;
            payload.D=voltage;
            bool ok = radio.write( &payload, sizeof(payload) );
            delay(20);
            radio.powerDown();
            delay(20);
            payload.A++;
        }
    }
}

You can save some power by getting rid of the step-up converter. An 8 MHz ATmega328p will run on 2.4V so just connect the batteries directly.

Why the 20 mS delays? During that time the processor is running full bore doing nothing. Remove each one an check to see if your code still functions. If removing one causes a failure, make that delay as short as possible.

Your voltage measurement seems to be jumping in 0.01 Volt increments. Even with Aref of 5V you should get twice that resolution. You might want to look into that.

I realized I measured the current draw from the batteries wrong. I measured it now and after ~3.5 days of running there was ~1mA drawn from the batteries. I disconnected the step-up converter and measured the current drawn from the batteries (nothing connected to VOUT of step up converter) - ~0.5mA was drawn from the batteries. So it looks this step up convertor is not a good option because when arduino needs 0.03mA, the step up will need ~1mA for providing 3.3V output for arduino. The current needed from batteries will increase when battery's voltage is lower. So definitely this kind of setup would not be sufficient for months. Maybe 2-4weeks.

The question is. Can I run arduino safe with only 2xAAA batteries? So the voltage would be 3V instead of 3.3V and of course will drop after some time? I tried now - it runs on 3V (2xAAA bat.), nrf24l01+ transmits, DHT22 measures temp/humidity.
nrf24l01+ can run on 1.9V-3.6V, so this is OK.
But regarding arduino, I am not sure - if it can run safe on 1.9V (pro mini, 3.3V 8Mhz)
And DHT22 - in the specification there is 3.3V-5V.

EDIT: I was writing this reply and in the meantime johnwasser replied, so I will react.

  • delay(20) --> I put it there because in my initial tests it shown without delay Serial.println() did not work - it looked like arduino went to power down before it was completed (sorry I do not have suffucient knowledge in serial communication). So I decided to stick with delay(20) even after sending payload (radio.write()) for sure. I am not sure if this is needed, I will test with removing all delays.

An 8 MHz ATmega328p will run on 2.4V so just connect the batteries directly.

--> does pro mini 8Mhz has default brown out detection set to 2.4V or does it have to be set by a fuse?

EDIT2:

Your voltage measurement seems to be jumping in 0.01 Volt increments. Even with Aref of 5V you should get twice that resolution. You might want to look into that.

--> Could you please explain me more? I am not sure I understand you correctly.

The Arduino Pro Mini 3.3V 8MHz has the Brownout Detector set for 2.7V.

pro.menu.cpu.8MHzatmega328=ATmega328 (3.3V, 8 MHz)
pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF
pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA
pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x05

You could re-set the fuses for 1.8V or DISABLED and the processor should work down to 2.4V.

--> Could you please explain me more? I am not sure I understand you correctly.

Your voltage graph shows obvious steps. There are 5 steps between 3.20V and 3.15V so each step seems to represent 0.01V. If you use the Arduino A/D with a 5.0V Aref you should get steps close to 0.005V. With Aref of 3.3V your steps should be about 0.0033V or about three times as precise as you are showing. Somewhere in your code you are losing precision.

Somewhere in your code you are losing precision.

Most likely on the receiving arduino. I convert float to char there with only 2 decimal numbers:

dtostrf(payload.D,1,2,volt_buff);