This sounds promising. Some german vendor on ebay suggested that one should use a zener diode to drop the voltage as the device as-is does harm the lir on the long run...
Something diffenrent: I wanted to use the ds3231 to send an interrupt every second to my arduino pro mini (5V). There are some libs that set up the ds3231 to do just that however not the most cited one (
https://www.pjrc.com/teensy/td_libs_DS1307RTC.html). Also I don't like the overhead of a library if I only want a 1Hz Interrupt.
To wire the stuff up connect SQW of the ds3231 to pin 2 or 3 of your arduino pro mini. Actually interrupt 0 is pin 2 and interrupt 1 is pin 3 - that confused me just a bit. Also you do not need a pullup resistor.
Now here a simple sketch that just requires the Wire.h library that comes with the sdk:
#include <Wire.h>
volatile bool ledstate = 0;
volatile bool interrupt = 0;
void rtc_interrupt()
{
ledstate = !ledstate;
interrupt = 1;
}
void setup() {
pinMode(13, OUTPUT);//Led
Wire.beginTransmission(0x68); //DS3231 address
Wire.write(0x0E); //The configuration register
Wire.write(0); //This will enable the interrupt at 1Hz intervals
Wire.endTransmission();
attachInterrupt(0, rtc_interrupt, FALLING); //the ds3231 pulls the line to GND when issuing an interrupt
}
void loop() {
if (interrupt) {
digitalWrite(13, ledstate);
//your code goes here...
interrupt = 0;
}
}