Despite power saving efforts, batteries are depleted in 48h.

Dear all,

First of all, I have been experimenting with Arduino for some time now (simple projects), but it is the first time I post a problem to this forum, so I am really just a beginner. Apologies if I ask something stupid, do not follow a forum guideline or have made a simple coding mistake.

Recently, I moved to a new home with a concrete rain water well (to collect and store rain water for toilet use etc.). However, there was no means present to measure the volume of water available in the well. Therefore, I made 2 arduinos. One sender arduino (arduino pro mini 5V) that is placed inside the well below the sealing cover and measures the distance to the water via an ultrasonic distance sensor (HCSR04). 2 measurements are done each 24h (via an RTC that interrupts twice a day). When a measurement is done, this measurement is sent wirelessly to the receiver arduino using a nRF24L01 module. So far so good, everything is working fine and the measurements work.

Now my problem.

Because I do not want to open my well too often to replace batteries, I used an arduino pro mini powered by four 1.5V AAA 900 mAh batteries. To minimize power consumption, I followed the guidelines described here,

I removed the power led, so the power consumption of the sender arduino should be (ACT = active mode, PDS = power down sleep mode):

No Power LED RAW Pin ACT 16.9 mA
No Power LED RAW Pin PDS 0.0232 mA*

I put the sender arduino for 99,98% of the time on sleep mode during 24h (using 0.0232 mA). Only when measuring, the arduino is awake and uses 16.9 mA.

So with 4 AAA batteries of 900 mAh, the sender should be able to send for months and months without replacing the batteries. But unfortunately, batteries are depleted within 48h (which suggests to me that the arduino is 100% active during these 48h --> 900 mAh more or less equals 16.9 mA * 48h).

What do I do wrong? In my code of the sender arduino (see attachment), I use following instruction after each measurement (as suggested on the website):

LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

Thanks already for all your help!

sender.ino (2.6 KB)

I'm guessing the the problem lies with the code you didn't post. Post all the code so we can see what's going wrong.

Oops, my mistake! Didn't see the attachment. :grin:

Can you put the radio module to sleep as well?

How to you have everything wired up? You have a radio transmitter that requires power. You have a sensor that requires power, you have a RTC that requires power (probably on a battery). A schematic would be most helpful.

Have you run this code connected to your PC for several days to verify your "awake" and "sleep" messages are coming out at the correct time and not more often than you want?

Please post your code.
In code tags, obviously.
And a schematic

You need to turn off the ultra sonic sensor and radio link in between measurements , so most of your time the power should be below 1mA.
There is also a voltage regulator on board which will consume power .

Any peripheral that draws less than about 20 mA can be powered from an Arduino pin. How much current does the radio draw when transmitting?

Based on all of your reactions, I think I made the mistake of assuming that powering down the arduino would also cut off power to my radio and ultrasonic sensor (which is apparently not the case when connecting them directly to VCC and GND pin). I will try to cut off power to those as well and let you know what the result is. Thanks already for all of your reactions!

I have now tested the setup by powering the ultrasonic distance sector via an arduino pin. In sleep mode, the arduino now uses 0,88mA. Without the radio module (which is now powered by an external dc dc transformer to get from 5V to 3.3V) and the ultrasonic distance sector, the arduino still consumes 0,7mA (so arduino pro mini + RTC). Still far from 0,0232mA, but now I can measure my water well already for a month with 4 AAA batteries. Thanks again!

How did you powered RTC and what is RTC power consumption?

I inserted a coin cell battery in the DS3231, but I also power it by using the Vcc pin of the arduino (5V). I followed your suggestion to measure power consumption and indeed the RTC uses almost all of the current in standby mode! 0,63 mA to be precise. However, if I do not power the RTC by the 5V arduino pin, I do not get an interrupt signal twice a day to wake the arduino, so I have no choice I think. Or am I missing something here?

Which RTC you are using?

ZS-042

Power it from some pin set as output HIGH when you awake and set that pin to LOW or INPUT before sleep.

And remove an LED from RTC module as well.

Some other consideration

  • Switch your mini to 8MHz internal oscillator (or take 8MHz version), remove voltage regulator and power it directly from 18650 LiIon battery. You'll get less power consumption plus nore juice in battery

  • Put glass or plastic sealed pipe with set reed switches inside and floating magnet outside into you well. Then connect reeds switch to arduino pin and make them wake your arduino.

riendev:
I have now tested the setup by powering the ultrasonic distance sector via an arduino pin. In sleep mode, the arduino now uses 0,88mA. Without the radio module (which is now powered by an external dc dc transformer to get from 5V to 3.3V) and the ultrasonic distance sector, the arduino still consumes 0,7mA (so arduino pro mini + RTC). Still far from 0,0232mA, but now I can measure my water well already for a month with 4 AAA batteries. Thanks again!

Why aren't you using that transformer to supply the entire project?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Thanks.. Tom... :slight_smile:

I posted recently about current draw by the DS3231 on the ZS-042 module:

https://forum.arduino.cc/index.php?topic=710910.msg4776389#msg4776389

The DS3231 draws considerably less current when running on its Vbat pin than when running on its Vcc pin. But the difference doesn't get you anywhere near the current you are seeing on the Arduino when it's sleeping. The ZS-042 uses 4.7K pullup resistors on the I2C and alarm lines, so you have to make sure that nothing is sinking current through them when they are inactive.

I think the best option may be to control the DS3231 Vcc pin from a GPIO port, and bring it high only when you need to communicate with it on I2C. But if you do that, you will also need to cut the trace from the INTSQW pin to its pullup resistor, and instead make the GPIO pin used to awaken the Arduino an INPUT_PULLUP. (If you bring the Vcc pin low, the pullup resistor on the ZS-042 will become a pulldown resistor, and the wakeup won't function - the pin will always be low. I think that's why you lost the wakeup function when you switched to coin cell power. See the alternate circuit in my post.)

Another complication is that the Wire.h library for I2C enables the internal pullup resistors on the SDA and SCL pins. If you bring the ZS-042 Vcc pin low, you will then be drawing current through the Arduino pullup resistors. I believe the solution to that is to reverse what Wire.h does immediately after you start it, so the pullups will be disabled. The 4.7K pullups on the ZS-042 are what's needed anyway, not the much weaker internal pullups.

Wire.begin();
digitalWrite(SDA, LOW);
digitalWrite(SCL, LOW);

And perhaps someone here will know - it may be possible to instead simply turn off I2C completely with a "Wire.end()" to minimize Arduino sleep current - if Wire.end() also disables those pullup resistors.

If you disable the ZS-042 "charging circuit" and the power LED, the ZS-042 will draw about 1.25uA from the coin cell when Vcc is at ground. It will last a long time at that rate.

But I still don't see how you are getting nearly a millamp during sleep. A schematic would be helpful, and the latest version of your code if it's different from the original post.

Thanks all for your explanation. I will have to read a little bit about pullup and pulldown resistors, because that is new for me. I included a schematic and my code for the sender module. If you spot any clear errors and/or quick wins in power saving efforts, I would be happy to know. Thanks again!

verzender_lowpower.ino (3.49 KB)