3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

The Arduino Weather Station / Thermostat

Step 6Arduino Clock Module

Arduino 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 StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
185
Followers
7
Author:sspence(Arduinotronics)
Professionally, I'm an IT Engineer (Executive Level) and Electronics Tech. I'm a Amateur Radio Operator (KK4HFJ). I lived off grid, with Solar (PV), Wind, and veggie oil fueled diesel generator power ...
more »