Hi All. Looking for some info/advise if anyone knows the details.
I want to build a little medication reminder. All i want it to do is turn and hold on a bright LED every 24 hours. I will be shutting off the LED by checking if the box that all the stuff is in has been opened(either using a LDR or just a contact plate on the edge of the box).
Does anyone know how accurate the attiny85's sleep watchdog timer is? If i was to put the chip to sleep at its max watchdog timer setting of 8 seconds. if each time i woke it up i added 8 seconds to the counter and check if its been 24 hours would this end up being accurate over 24 hours? i don't need 100% accuracy but would it end up drifting more then 10 minutes?
I plan on testing this but if anyone knows the details or has any suggestions that would be great.
I think over time it will drift an unacceptable amount (i havent check the
numbers but id assume an internal crystal would drift a fair bit over this
time).
Another option would be to use a real time clock with an alarm interrupt?
Check out the ds3232 real time clock module at jaycar stores, this should
suffice and be fair more accurate with a lot less drift
On Sep 6, 2012 9:56 AM, "Shival Wolf" <shivalw...@gmail.com> wrote:
> Hi All.
> Looking for some info/advise if anyone knows the details.
> I want to build a little medication reminder.
> All i want it to do is turn and hold on a bright LED every 24 hours.
> I will be shutting off the LED by checking if the box that all the stuff
> is in has been opened(either using a LDR or just a contact plate on the
> edge of the box).
> Does anyone know how accurate the attiny85's sleep watchdog timer is?
> If i was to put the chip to sleep at its max watchdog timer setting of 8
> seconds.
> if each time i woke it up i added 8 seconds to the counter and check if
> its been 24 hours would this end up being accurate over 24 hours?
> i don't need 100% accuracy but would it end up drifting more then 10
> minutes?
> I plan on testing this but if anyone knows the details or has any
> suggestions that would be great.
> --
> You received this message because you are subscribed to the Google Groups
> "Connected Community HackerSpace" group.
> To post to this group, send an email to
> connected-community-hackerspace@googlegroups.com.
> To unsubscribe from this group, send email to
> connected-community-hackerspace+unsubscribe@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msg/connected-community-hackerspace/-/cgK... > .
> For more options, visit https://groups.google.com/groups/opt_out.
My experience recently with sleeping, using maximum watchdog of about 8 seconds, on a Atmega 2560 is that it is very roughly somewhere between 7.6 and 8.1 seconds !!! Very inaccurate.
Easy but more expensive solution would be a RTC. Or if power isn't an issue leave the external crystal on, which is far more accurate. Or use a crystal to trigger a counter - which is really how an RTC works anyway.
BTW. The way I solved my issue, where I needed to sleep for 2.5 hours, was to wake up after about 2.1 hours, and recheck the GPS, adjust my 8 seconds time and re-sleep until closer. This meant on average I only had to check my GPS 2 or 3 times each 3 hours period, and due to the VBAT connection (about 100 uA) it would often only take about 10 seconds to get an accurate fix.
Scott
On 06/09/2012, at 10:11 AM, James Muraca <jmur...@gmail.com> wrote:
> I think over time it will drift an unacceptable amount (i havent check the numbers but id assume an internal crystal would drift a fair bit over this time). > Another option would be to use a real time clock with an alarm interrupt? Check out the ds3232 real time clock module at jaycar stores, this should suffice and be fair more accurate with a lot less drift
> On Sep 6, 2012 9:56 AM, "Shival Wolf" <shivalw...@gmail.com> wrote:
> Hi All.
> Looking for some info/advise if anyone knows the details.
> I want to build a little medication reminder. > All i want it to do is turn and hold on a bright LED every 24 hours.
> I will be shutting off the LED by checking if the box that all the stuff is in has been opened(either using a LDR or just a contact plate on the edge of the box).
> Does anyone know how accurate the attiny85's sleep watchdog timer is?
> If i was to put the chip to sleep at its max watchdog timer setting of 8 seconds.
> if each time i woke it up i added 8 seconds to the counter and check if its been 24 hours would this end up being accurate over 24 hours?
> i don't need 100% accuracy but would it end up drifting more then 10 minutes?
> I plan on testing this but if anyone knows the details or has any suggestions that would be great.
> -- > You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To post to this group, send an email to connected-community-hackerspace@googlegroups.com.
> To unsubscribe from this group, send email to connected-community-hackerspace+unsubscribe@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msg/connected-community-hackerspace/-/cgK....
> For more options, visit https://groups.google.com/groups/opt_out.
> -- > You received this message because you are subscribed to the Google Groups "Connected Community HackerSpace" group.
> To post to this group, send an email to connected-community-hackerspace@googlegroups.com.
> To unsubscribe from this group, send email to connected-community-hackerspace+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
The sleep timer is not all you need to think about, you also need to account for the program execute time (between sleeps) For 24 hours you will need about 10800 sleeps so over this number of loops per day even a few ms will turn into minutes.
On Thursday, 6 September 2012 09:56:36 UTC+10, Shival Wolf wrote:
> Hi All. > Looking for some info/advise if anyone knows the details.
> I want to build a little medication reminder. > All i want it to do is turn and hold on a bright LED every 24 hours. > I will be shutting off the LED by checking if the box that all the stuff > is in has been opened(either using a LDR or just a contact plate on the > edge of the box).
> Does anyone know how accurate the attiny85's sleep watchdog timer is? > If i was to put the chip to sleep at its max watchdog timer setting of 8 > seconds. > if each time i woke it up i added 8 seconds to the counter and check if > its been 24 hours would this end up being accurate over 24 hours? > i don't need 100% accuracy but would it end up drifting more then 10 > minutes?
> I plan on testing this but if anyone knows the details or has any > suggestions that would be great.
> Hi All.
> Looking for some info/advise if anyone knows the details.
> I want to build a little medication reminder.
> All i want it to do is turn and hold on a bright LED every 24 hours.
> I will be shutting off the LED by checking if the box that all the > stuff is in has been opened(either using a LDR or just a contact plate > on the edge of the box).
> Does anyone know how accurate the attiny85's sleep watchdog timer is?
> If i was to put the chip to sleep at its max watchdog timer setting of > 8 seconds.
> if each time i woke it up i added 8 seconds to the counter and check > if its been 24 hours would this end up being accurate over 24 hours?
> i don't need 100% accuracy but would it end up drifting more then 10 > minutes?
> I plan on testing this but if anyone knows the details or has any > suggestions that would be great.
> -- > You received this message because you are subscribed to the Google > Groups "Connected Community HackerSpace" group.
> To post to this group, send an email to > connected-community-hackerspace@googlegroups.com.
> To unsubscribe from this group, send email to > connected-community-hackerspace+unsubscribe@googlegroups.com.
> To view this discussion on the web, visit > https://groups.google.com/d/msg/connected-community-hackerspace/-/cgK....
> For more options, visit https://groups.google.com/groups/opt_out.