What is the best (simple and reliable) way to put a project to sleep and wakeup on a daily basis?
I have an UNO with a battery +/- terminals connected to it and reading its voltage. The voltage is read and then saved to an SD card for about a month.
I've read about LowPower but Im not sure if I can use it to wake up daily?
Your suggestions would be appreciated.
The longest you can sleep without some outside cicuit to wake you up is 8 seconds with the longest watchdog timer as the wake signal. For 24 hours you'll need an external circuit to give you a pulse on one of the interrupt pins for the wake signal. For shorter periods I've seen someone use a 555 timer. I don't know if you can reasonably make one pulse that slow or not.
One good option would be a RTC with an alarm set for once a day. But that itself is going to consume some power to run which may or may not be more than simply setti,g the Arduino wake up every 8s and go back to sleep.
If accurate timing is of any concern the RTC looks a lot better.
RTC is typically battery backed with a coin cell, does not use any current from the battery running the uC.
uC can be pretty low power draw - but needs to be standalone design, not an Uno with regulators, power LED, USB/Serial converter, autopower switch circuit.
Details on turning off internals to minimize power here:
Use the watchdog timer to wake up every 8 seconds, increment a counter, and go back to sleep.
Roughly 10,800 of those intervals will equal a day, at which point you do something else before sleeping.
Thanks, I already have a 1307 RTC module. I was thinking of using it and a library i found called TimeAlarms which seems to work nicely with 1307 to create alarms.
Im about to wire it and I ran into this doubt, why does the rtc module have 2 sets of pinholes?
TimeAlarms runs on the Arduino right? So won't the Arduino need to be awake to use that?
Ok, could you explain to me why that means we need two pins?
AFAIK, I need the RTC module to signal to Arduino when it is 8am each morning and voila, the Arduino will do something.
Marciokoko:
Ok, could you explain to me why that means we need two pins?
I wasn't answering that question. I was telling you that the TimeAlarms library will likely not work for what you have described wanting thus far. To run that library, the Arduino would have to be awake. If the Arduino is awake, then you could just read the RTC and dispense with the library.
Marciokoko:
AFAIK, I need the RTC module to signal to Arduino when it is 8am each morning and voila, the Arduino will do something.
Then you have the wrong RTC. The one you have doesn't do alarms. It won't send you any signal at any particular time of day and no amount of code on the Arduino is going to change that.
Oh cause the TimeAlarms code runs on the Arduino itself! Duh!
So I'd need a DS3231?
Marciokoko:
Oh cause the TimeAlarms code runs on the Arduino itself! Duh!
So I'd need a DS3231?
That would be a good choice.
What's your goal? You try to sleep the arduino to save power?
If you need to just save some data daily or to do some tasks daily as your talking about daily you need a
clock to know when that daily time will arrive. One step is to get a real time clock and make your arduino
to start the basic daily check on, when the time will arrive, in between that time the arduino will stand by
for the time to pass, meaning that the arduino will not do anything in the period of time waiting the time
to pass/arrive to run the code and save your data.
That way will save you some power but if you need to put it in a sleep mode to save maximum power
then I'm not sure how you make it sleep but in any case you need a clock.
ps(As I know to put a arduino in sleep mode you need a button or a way to wake up the arduino,
like the smartphones, while you don't use it is in "sleep mode" after you press the button it turns on, in any case to use sleep mode you need a way to wake up the device)
Dominon60
Check out the PCF8593 RTC. It can be set to interrupt a sleeping Arduino on a schedule, and only draws 1 microamp typical current.
I need to sample 3 times a day and the rest of the day the Arduino can sleep. I just need the RTC to tell the arduino to wakeup.
I thought I understood I could do that by making the RTC send an interrupt (a pulse) at specific times based on its RTC reference. Those pulses would wake up the Arduino, execute code and go back to sleep.
I know this topic is old, but I just wanted to address the two sets of pinholes you were wondering about.
Your RTC seems to be i2c enabled, so I am guessing the extra holes are just a nice means by which to pass the i2c bus signal onto the next device. Not a bad idea by the RTC vendor, most devices I have hooked up like this have only had the one set, requiring me to make a kind of i2c connection soldering hub of sorts.