Hi,
this is my first topic.
I bought this sd-rtc shield:
http://snootlab.com/shields-snootlab/86-memoire-fr.html
The Wire.h and SD.h libraries work good but I can't find how to stop and wake up the arduino board: can you help me?
Thank you in advance.
The RTC on this board (DS1307) does not have an alarm function so all you could do is configure it's square wave output to 1Hz and sleep the arduino for a second at a time.
If you had something like the DS3231 RTC that has alarms then you could 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.
Is there a shield with an rtc like ds3231?
supermax:
Is there a shield with an rtc like ds3231?
I don't know if there is a shield but you can get this device http://www.phenoptix.com/products/adafruit-chronodot-ultra-precise-real-time-clock-v2-1?utm_source=google-product-search
Thank you very much Riva!
http://docs.macetech.com/doku.php/chronodot
This link says:"The SQW pin can be configured to output a square wave signal at 1.000 Hz, 1024 Hz, 4096 Hz, or 8192 Hz"
Do you know how to program the wave to last a day or fraction?
here is a clone with the ds3231 included
http://pcb.daince.net/doku.php?id=ad_ul_data_logger
A possible quick and easy answer to your original question that I found while researching my reply is to download the narcoleptic library from here Google Code Archive - Long-term storage for Google Code Project Hosting. and just sleep the arduino for x amount of time. The more complex answer if the sleep time needs to be accurate is to use the SQW output from your DS1307 to wake the arduino every second (or less) and you count the number of wakeup's and do something as required (eg every minute (60 wakeup's) read the temperature)
The principle is the same for both the shield you bough and the Chronodot, the difference is in the RTC chip being used. The DS1307 has a SQW output pin that is configurable for 1Hz, 4kHz, 8kHz or 32kHz output. The DS3221 SQW pin is configurable for either 1Hz or ALARM output. I would start with the shield you have and sleep the arduino for 1 second at a time, waking it with the SQW interrupt set to 1Hz. Once you get this working okay then substituting the DS3221 should only entail minimal hardware changes and a bit more programming to set alarm times and configure the SQW pin as an alarm interrupt instead of square wave output.
I cannot find a DS3221 library that has the alarm setting commands you would require but maybe someone else knows of one.
I would use this library GitHub - davidhbrown/RealTimeClockDS1307: Yet another DS1307 Real-Time Clock library for Arduino (obsolete) for the DS1307. I have used it myself and it works really well and also has the SQW configuration commands you will need.
I cannot find a schematic of the shield you have and cannot determine if/where the SQW pin is broken out on the shield pins. You will need to read up on causing the arduino to sleep and wakeup using an interrupt. I recall Nick Gammon doing an article on power saving using processor sleep, he and others can maybe give you more info on this.
*I'm quite new to arduino though not micro controllers (PIC) and have not ventured to wake on interrupts yet.
In case you are running your entire Arduino system on a battery, you can replace the DS1307 with a DS1337 on your RTC shield.
Pros:
DS1337 features and alarm output and is pin to pin compatible with the DS1307, apart from the Vbat pin.
If you use it you just need to exclude the coin battery from it and take power from Arduino 5V
Cons:
No dedicated pin for coin battery so you need, as said above, to rely on Arduino system 5V power (if you are running your Arduino on a battery you probably don't necessarily need a coin one, you just have to connect your system it to a power supply when replacing the battery in order not to loose your rtc data)
Can this proposal be feasible in your opinion?
Riva:
I cannot find a DS3221 library that has the alarm setting commands you would require but maybe someone else knows of one.
I humbly submit this one: