Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time keeping in powerdown mode #4

Open
shirish47 opened this issue Dec 28, 2015 · 2 comments
Open

Time keeping in powerdown mode #4

shirish47 opened this issue Dec 28, 2015 · 2 comments

Comments

@shirish47
Copy link

Hi,
I have this need of time keeping in my arduino. although its not necessary to have a perfect timing but if it was good enough for mins resolution it would be good. I wanted to use Time library and also lowpower library, in powerdown mode from lowpower library.. timer0 is shutdown too .and thus millis() fail and also Time library.. so I wanted to have timekeeping and thus I though time keeping with watchdog timer..in low power there is a mode to wake controller ever 1,2,4,8 secs.. I can adjust the timer library seconds at every wakeup and check if the wake up is not from Watchdog it will not update seconds .. this is good for 1 second sleep ... I hope some one can implement this in any of these libraries ..this way we can get a rude low power with time keeping library..but this should not be used for realtime things ...what do you think of this?

@tcustodio
Copy link

Hi, shirish47. I ran into a similar problem a few days ago and right now what I'm doing, using both the Time library and the SleepyDog is this:
adjustTime(Watchdog.sleep()/1000);
This line will take the time that the arduino slept (e.x.: 8000ms) divide by 1000 to convert from miliseconds to seconds and offset the internal timekeeping of the Time library.
Not yet a complete solution but better than none. It seems that in the long run the clock drifts a few seconds using this method. I hope I have helped in any way

@shirish47
Copy link
Author

ya it works fine in my project. few seconds is not a problem. and later we can update it with NTP server once a day. RTC is also possible solution for this. I have not tried it but Atmega328 has RTC and I think that would have low power consumption than WDT, I suppose. not sure would try someday and post it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants