Battery-operated Pro Mini and DS3231 RTC module

Hello everyone,
I am struggling to understand how to run a pro-mini for 30 days through the use of a battery.
I was thinking to use a PRO Mini 3.3V and 3xAA batteries.

3xAA batteries should give me 4.5V and 2000mAh capacity (?)
Arduino Pro mini powered through the RAW pin in active state should consume 4.74mAh and 0.9mAh in sleep mode (reference)

If these data are correct, without any modification (e.g. remove the LED) I can run the microcontroller for
2000/4.74 = 17.58 days in full active state and 2000/(23*0.9+4.74)=79 days 1hr active per day

So so far, it seems good without much effort (I did not count that in active state, it is driving a mosfet, but it is for few minutes per day).

Now, in order to wake up the Pro Mini once per day, I am using a Ds3231 RTC module which should be powered by the microcontroller and it drains quite a lot.
I have read Gammon guidance and if I have understood well, I need to use a digital pin to power the RTC and set it as OUTPUT when it is not required.

What I do not get is, if the RTC is not powered, the alarm to wake up Arduino will not work.
Hence, how Arduino knows when it is time to power the RTC that in turn, should wake up Arduino?

I am lost...

The RTC needs a backup supply to keep the RTC going when the main power is turned off, you can confirm this with a quick read of the DS3231 datasheet. Also check out the supply voltage of the DS3231.

The PCF8562 RTC may be a better choice, check out its the datasheet for its non-active supply current and supply voltage.

There is lots of useful information in datasheets.

The Pro Mini will have a deep sleep supply current if you remove the regulator, assuming all your stuff is happy with the 4.5v to 3.0v supply the AAs will supply.

If the 'once a day' does not need to be accurate, then the ATmega watchdog timer can be used to do the wakeup, no RTC required.

I have had a Pro Mini, fitted with a MCP1700 regulator, waking up every 15 minutes, reading a BME280 sensor and transmitting the results with LoRa. Its powered with a 155mAh Lipo, which is dropping at around 30mV a month, its been up with no intervention for 6 months now.

On a set of AA Lithium energizers the battery life is going to be circa 40 years.

Arduino Pro mini powered through the RAW pin in active state should consume 4.74mAh and 0.9mAh in sleep mode

First off, consumption is measured in mA, not mAh. Capacity of a battery is measured in mAh. For example, your 3xAA cells have 2000mAh capacity which means they can supply 200mA for 10 hours, or 10mA for 200 hours. Capacity = current x time = mA x h = mAh.

Almost all of that 0.9mA consumption in sleep mode is the power led. You need to stop that. Either remove the led or remove the resistor connected to it.

srnet:
I have had a Pro Mini, fitted with a MCP1700 regulator, waking up every 15 minutes, reading a BME280 sensor and transmitting the results with LoRa. Its powered with a 155mAh Lipo, which is dropping at around 30mV a month, its been up with no intervention for 6 months now.

That's excellent! My sensors are similar. But I use a bare atmega328, mcp1702 and 3xAAA NiMh (low self-discharge type). Here are my battery readings. The sensor has an sht21 temp/humid sensor (the ones with cigar shaped waterproof enclosure) and bh1750 light sensor (the ones with the little domes).


So I've dropped ~150mV in 3 months. Don't know how much of that is self-discharge...

srnet:
If the 'once a day' does not need to be accurate, then the ATmega watchdog timer can be used to do the wakeup, no RTC required.

I have had a Pro Mini, fitted with a MCP1700 regulator, waking up every 15 minutes, reading a BME280 sensor and transmitting the results with LoRa. Its powered with a 155mAh Lipo, which is dropping at around 30mV a month, its been up with no intervention for 6 months now.

On a set of AA Lithium energizers the battery life is going to be circa 40 years.

Not, it does not to be accurate for this initial project.
I don't remember why I rejected this option, I though the watchdog cannot be set for long durations such as 24 hours. But I imagine this is easly solved with a bit of programming.

srnet:
The RTC needs a backup supply to keep the RTC going when the main power is turned off, you can confirm this with a quick read of the DS3231 datasheet. Also check out the supply voltage of the DS3231.

The PCF8562 RTC may be a better choice, check out its the datasheet for its non-active supply current and supply voltage.

There is lots of useful information in datasheets.

The Pro Mini will have a deep sleep supply current if you remove the regulator, assuming all your stuff is happy with the 4.5v to 3.0v supply the AAs will supply.

The DS3231 RTC works well and it has a smal backup supply. But it has an LED and its consumption should be around 50mA which is way too much.

I do prefer try to do not remove components from the Pro Mini and the DS3231 at this stage, if it is possible

PaulRB:
First off, consumption is measured in mA, not mAh. Capacity of a battery is measured in mAh. For example, your 3xAA cells have 2000mAh capacity which means they can supply 200mA for 10 hours, or 10mA for 200 hours. Capacity = current x time = mA x h = mAh.

Almost all of that 0.9mA consumption in sleep mode is the power led. You need to stop that. Either remove the led or remove the resistor connected to it.

I got it now, thanks.

Removing the LED is something I will try, I have nver done it.

Regarding my project, if the time is not required to be precise, just I need to remove the RTC and use the microcontroller watchdog?

srnet:
I have had a Pro Mini, fitted with a MCP1700 regulator, waking up every 15 minutes, reading a BME280 sensor and transmitting the results with LoRa. Its powered with a 155mAh Lipo, which is dropping at around 30mV a month, its been up with no intervention for 6 months now.

On a set of AA Lithium energizers the battery life is going to be circa 40 years.

What is the purpouse of the MCP1700 regulator?

Srnet, how are you fitting the MCP1700 3.3v regulator on the pro mini, do you have any images of your connections? Thanks, sorry to interrupt.

AntroxEv:
What is the purpouse of the MCP1700 regulator?

It might not be needed for your project. The 3.3V Pro Mini will run happily with 3xAA batteries connected to the Vcc pin, bypassing it's on-board regulator. But as you read in the link you posted, the chip uses more current at higher voltages, at least while awake, so the built-in regulator or an external regulator may help reduce that. But in sleep mode, it makes only a small difference.

The 3.3V regulator is needed in my project and srnet's project because we use LoRa radio modules. These need 3.3V because they might be damaged by direct connection to 3xAA batteries, which could be as high as 4.5V (NiMH) or even 4.9V (lithium non-rechargeables).

AntroxEv:
I though the watchdog cannot be set for long durations such as 24 hours. But I imagine this is easly solved with a bit of programming.

Indeed it is, just call the watchdog sleep, 8 seconds maximum, the requesite number of times in a loop;

sleep8seconds(sleeps); //sleep Atmel processor in units of approx 8 seconds

void sleep8seconds(uint32_t sleeps)
{
  //uses the lowpower library
  uint32_t index;

  for (index = 1; index <= sleeps; index++)
  {
    //sleep 8 seconds
    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
  }
}

itmoto:
Srnet, how are you fitting the MCP1700 3.3v regulator on the pro mini, do you have any images of your connections? Thanks, sorry to interrupt.

The Pro Mini is of my own design PCB. Its just more convienent to use.

There is a picture of my Pro Miser here;

https://www.loratracker.uk/2020/02/

However you can achieve exactly the same thing and avoid doing SMT stuff with a 'bare bones' ATmega328 (DIP version built) on a bit of strip board using all through hole components, the MCP1700/2 is available in a T092 package. With the MCP1700 fitted and the watchdog timer running such a board consumes around 6-8uA.

PaulRB:
It might not be needed for your project. The 3.3V Pro Mini will run happily with 3xAA batteries connected to the Vcc pin, bypassing it's on-board regulator. But as you read in the link you posted, the chip uses more current at higher voltages, at least while awake, so the built-in regulator or an external regulator may help reduce that. But in sleep mode, it makes only a small difference.

The 3.3V regulator is needed in my project and srnet's project because we use LoRa radio modules. These need 3.3V because they might be damaged by direct connection to 3xAA batteries, which could be as high as 4.5V (NiMH) or even 4.9V (lithium non-rechargeables).

In my project I am hooking up an IRL540 (datasheet) to drive a 12V motor powered (400mA) by a 12V lead acid battery.
From the datasheet on the link, I think I need to check figure 3, which says that at gate to source voltage VGs 3.3V, the Drain current is 10A, so it should be ok for me without a 3.3V regulator?

Yes, I can't see any need for the regulator in your circuit. Although it might reduce current consumption, as I said earlier.

Thanks @srnet, I wonder if it is possible to fit a MCP1700 3.3v to a pro mini (original regulator removed) and use the onboard capacitors?

itmoto:
Thanks @srnet, I wonder if it is possible to fit a MCP1700 3.3v to a pro mini (original regulator removed) and use the onboard capacitors?

It would be cheaper\quicker than building you own if you could do that.

Ralph Bacon has a new video that might be relevant on using the DS3231 RTC to wake an Atmega328P from deep sleep.

ShermanP:
Ralph Bacon has a new video that might be relevant on using the DS3231 RTC to wake an Atmega328P from deep sleep.

https://www.youtube.com/watch?v=-dW4XsBo3Mk

Thanks, I will have a better look at it later.

I was thinking to use a RTC as I mentioned here
https://forum.arduino.cc/index.php?topic=678490.msg4565821#msg4565821
But, the main problem is the consumption of the RTC module. I have a similar one that the one shown in the youtube video but with a LED. I am studying a way to remove it as I should do with my Pro MINI.
Hopefully, with no LEDs the consumption is low enough to garantee a 20-30 days of power from my 3xAA.
Otherwise, I would need to use a watchdog of 8sec.

@srnet, I think removing the original regulator and power LED from a Pro mini (the parts will probably be destroyed!) and trying to fit the MCP1700 maybe slightly easier and less time consuming for me than populating a whole board from scratch due to inexperience (that’s something I would like to try in the future though).
Have you or anyone else achieved this though and made connections making use of the onboard capacitors on Vin(raw) and Vout(vcc). I think the capacitance of capacitors is slightly different on the Pro mini but wondered if the MCP1700 still performed well?

itmoto:
@srnet, I think removing the original regulator and power LED from a Pro mini (the parts will probably be destroyed!) and trying to fit the MCP1700 maybe slightly easier and less time consuming for me than populating a whole board from scratch due to inexperience (that’s something I would like to try in the future though).
Have you or anyone else achieved this though and made connections making use of the onboard capacitors on Vin(raw) and Vout(vcc). I think the capacitance of capacitors is slightly different on the Pro mini but wondered if the MCP1700 still performed well?

I have not yet seen a Pro Mini where this is practical, check the pinouts of the appropriate regulators, do they match ?

Some of the older style Pro Minis use a regulator where the voltage level of 3.3V\5V is set by a resistor divider which consumes a lot of power. You can replace the regulator on these with a MIC5205 which has a qiescent current of around 100uA. Newer Pro Minis (the ones with the fuse and reverse protection diode) use a regulator that has a qiescent current of around 40uA.

None are a match for the MCP1700 which has a qiescent current of around 2uA.

Thanks @srnet, I will need to check which 3.3v Pro Minis I have, they were the cheap ones of eBay, think they were called the simple.
Thanks again for all the extra info, given me more to think about.

A couple things. First, my method of removing surface mount parts (that I don't need to keep) is to place the soldering iron tip right on top of the part. In a few seconds the entire thing will heat up, the solder holding it to the board will melt, and I just flick the part away with the iron tip. Of course this is almost certain to be a destructive removal. If you can identify the resistor that the LED is connected to, it may be easier to remove that instead of the LED. Removing a regulator may be more complicated, and I think the last one I removed from a Pro Mini I used desoldering braid first, but the direct heat method would probably work.

On the RTC module, if I understand the Ralph Bacon video correctly, the RTC (with any LED removed) should draw very little current, but somehow the I2C lines sink some current. I'm not sure how that happens, but it must involve pull-up resistors in some way. But I have to believe that you could set the I2C lines to the right state before going to sleep so they wouldn't be sinking current. Also I think typical RTC modules always have a coin cell battery that would last many months, but I think it might be better to power the RTC from the processor so they both have the same Vcc.

I really doubt there would be any benefit to replacing the Mini's regulator with another. If you are in deep sleep, with the regulator and LED removed you can get the Mini sleep current down to under 1 microamp, and the replacement regulator's idle current will be more than that. There is potentially some power saving when the circuit is active, but if it's only doing something once a day, battery life will primarily be a function of sleep current.