Goal: Battery powered arduino that deep sleeps for 3 months then performs action

Note that time precision is not crucial for the goal. In other words, it is fine if I set it to take action in three months and it takes action in 29 days (or similar).

Please let me know which (if any) direction is the best way to proceed and or possible.

Direction A:

  • Add a Real Time Clock module such as the DS1307.
  • Utilize a deep sleep mode library to sleep a full day.

http://jeelabs.org/2011/12/13/developing-a-low-power-sketch

  • Wake up, check the time, determine if it is time to take action, go back to sleep for a day.

Direction B:

  • Add a Real Time Clock module such as the ds3231.
  • Put Arduino in deep sleep mode*
  • Utilize the DS3231 to "connect it's INT/SQR output pin to an interrupt pin on the Arduino, configure and set an RTC alarm to wake up and put the arduino to sleep until this alarm time."

Source:

*Is deep sleep necessary here? Would it be possible to actually have the arduino powered off and only powered on when DS3231 alarm goes off?

Direction C:

  • Don't add a real time clock
  • Utilize a library such as narcoleptic to deep sleep for 3 months

https://code.google.com/archive/p/narcoleptic/

  • Perform action when wake up then go back into deep sleep mode

Have you seen Nick Gammon's low power tutorial?

...R

Thank you.

In that post he mentions the following:

"Meanwhile this sketch below shows how you can use the watchdog timer to sleep for 8 seconds (the maximum you can set up a watchdog for)"

Although I'm new at this, I'm operating under the assumption I will be able to build a barebones arduino and accomplish deep sleep.

What I'm not finding is the best way to enter deep sleep (or power off) for long periods of time and perform an action based on a long duration (months).

What I'm not finding is the best way to enter deep sleep (or power off) for a day and perform a short action if x days have passed (assuming that's the best way to accomplish my goal).

Please study Nick Gammon's tutorial -- it is the best there is.

Using the watchdog timer, an AVR can sleep for about 8 seconds, wake up and increment a counter, check for one day passed (about 10800 increments) and if not, go back to sleep. Total time active per wakeup 1-2 microseconds.

Or you can add a battery backed DS3231 (IC2) or DS3234 (SPI) module and let it wake the processor whenever you set it's alarm time.

Direction D:

  • Add a watch crystal to the processor.
  • Use the maximum prescaler to reduce the wake time.
  • Wake on overflow.
  • Update run time.
  • Stay awake / do your thing when the appropriate time has elapsed.

Bear in mind that managing power loss is much easier with A and B.

Using the watchdog timer, an AVR can sleep for about 8 seconds, wake up and increment a counter, check for one day passed (about 10800 increments) and if not, go back to sleep.

I'm surprised that the best way forward is wake up 10,800 a day even though I only need it to wake up at most once a day to see if it is a day scheduled to perform an action.

That being said, his article states that he got well over a year on 3 AAs, so I suppose it will be sufficient for my use case.

In summary, the following is the recommended direction I should take to achieve my goal:

  • Don't add a real time clock
  • Follow the Nick Gammon tutorial

http://www.gammon.com.au/forum/?id=11497

  • Wake up in 8 second intervals and decide if enough time has elapsed to perform the action

Thank you!

edit I see other suggestions came in after I wrote this.

I'm surprised that the best way forward is wake up 10,800 a day even though I only need it to wake up at most once a day

Unless you add extra circuitry, it is your only option. Work with what you have.

Your big saviour is the lack of required accuracy, which allows you to use the lowest cost/part count option.

However, in the first post - three months is nowhere near 29 days...!
That's a real lack of precision!

That's a real lack of precision!

:smiley: :smiley: :smiley:

Good catch!

89 days is closer to the number I was searching for.

battery back DS3231 that wakes up barebones 328P from powerdown sleep mode with alarm signal.
Have everything else with P-channel MOSFET controlled power source so it's all powered down under arduino control.

Is there a P-channel MOSFET that you often use?

Thru hole?
NDP6020
http://www.digikey.com/product-search/en?keywords=ndp6020

pugs421:
89 days is closer to the number I was searching for.

Mixing months and days does not help anyone understand the accuracy you need as the number of days that is 3 months will vary depending on the time of year.

If the planned period is 90 days for example, what is the allowable varience ?