Atmega 328. [ Sleep 60 sec - Wake and do something - Repeat]

If it were a ESP8266 or ESP32 this requirement of sleeping for 60 sec , waking up / doing something and going to sleep is so easy.

But how to go about with the Atmega 328 chip ? No one is available to push any buttons and so the whole process must happen on its own ...

Idea is to save battery power and so an external timer like 555 is not OK. Maybe an RTC like DS3231 ? Need to study the DS.

Meanwhile any different ideas are welcome.. !

RTC DS3231 could indeed help

there is this old post that could also give ideas

Meanwhile any different ideas are welcome.. !

Have you tried sending the ATmega to sleep for the 8s it has available multiple times. Seven times an 8 second sleep and then a 4 seconds sleep make 60 seconds too and the very short wakeups don't cost you that much battery, probably less than an external device.

pylon:
Have you tried sending the ATmega to sleep for the 8s it has available multiple times. Seven times an 8 second sleep and then a 4 seconds sleep make 60 seconds too and the very short wakeups don't cost you that much battery, probably less than an external device.

Sounds good. Yes that short wakeup pulses would not add upto a power drain. And in any case if i can save another RTC its worth trying. Have never tried this kind of code. Let me start searching / reading.

Thanks.

If its 328p (bare metal config) could be done via one of the internal timers xtals connected to ~32khz crystal. Timer will count check overflow register for overflow or compare match register for match then via interrupt will wakeup update variables via your code and again back to sleep.

If its 328p (bare metal config) could be done via one of the internal timers xtals connected to ~32khz crystal. Timer will count check overflow register for overflow or compare match register for match then via interrupt will wakeup update variables via your code and again back to sleep.

Correct me if I'm wrong but with timers enabled you cannot go into power down sleep state, so power consumption will be substantially higher.

Page 39

If you do not need high accuracy, you can use the WatchDog timer. If high accuracy is required, and the MCU is clocked by the internal oscillator, you can use an external 32khz crystal in combination with Timer2. Both will allow you to put the MCU in low power state, the method with Timer2 and a crystal is the better option if possible. You should be aware that you either need to add capacitance to the crystal or get a crystal with a low load capacitance - otherwise it will not work as expected.

Very nice info!

surepic:
https://www.sparkfun.com/datasheets/Components/SMD/ATMega328.pdf

Page 39

My interpretation of that section of the datasheet is that the lowest power setting is power-save if you want timer 2 running on the external clock. Power-save mode needs about 5 times the power of power-down mode. So the option with a few wake-ups from power-down mode with the WDT is probably the most power-efficient.