How to? Arduino + SparkFun RTC (DS1307)

Hi there,

I'm a bit of a n00b, and I'm working on my first RTC project. I'm using an Arduino for this.

What's the basic process to get this thing hooked up and telling time?

try this:

Looks like a great post.

I’ve never used the 2-wire interface before. Which pins on the RTC module to I route to the Arduino?

I’ve got SQW, SCL, and SDA.

maybe you can collate all that and make us a proper tutorial for the "Playground" wiki ? :)


Excellent, figured it all out.

I'll do what I can to post a nice walkthrough in the wiki.

Thanks for your help!

excellent! You're all signed up to be the forum's DS1307 expert. :)

Haha, we'll see about that.

My last issue if you have any insight:

My last issue if you have any insight:

...but I can't get it to print out an integer to the LCD. It puts a solid black box. Characters work just fun, and I tried to cast it (char)number_variable, but it just doesn't seem to work.

Just add '0' (ASCII zero) to your integer, to convert the number to ASCII, like this:

LCD_Out(4 + '0')

(LCD_Out() might be a routine that "prints" a single ASCII character to the LCD.)

BTW, on a related topic, I used the DS1302 RTC in a project recently. It uses the same data register format as the DS1307. (The 12/24 hour flag in the Hours register has a different value, otherwise the two data formats are identical.) Feel free to take a peek at it if you think it might help you handle the DS1307.