Step 6Arduino Clock Module
We finished the Arduino Time & Date functions using the Sparkfun DS1307 I2C RTC module, a 2 line LCD, and the Arduino Duemilanove. There are four connections from the DS1307 to the Arduino:
//pin SDA to Arduino Analog pin 4
//pin SCL to Arduino Analog pin 5
//pin GND to Arduino GND
//pin VCC to Arduino 5v
To set the time, edit the following section in the code with the correct time and date,
// Change these values to what you want to set your clock to.
// You probably only want to set your clock once and then remove
// the setDateDs1307 call.
second = 0;
minute = 42;
hour = 9;
dayOfWeek = 1; //Sunday
dayOfMonth = 3;
month = 10; //October
year = 10;
and temporarily remove the // from the following line:
//setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);
Upload your code to the Arduino, then put the // back in the above line, and upload again.
The complete code and wiring are posted at http://arduinotronics.blogspot.com/2010/10/ds1307-real-time-clock-working.html
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|














































