Pages: [1]   Go Down
Author Topic: Accessing The DS1307 via the I2C protocol.  (Read 561 times)
0 Members and 1 Guest are viewing this topic.
Trinidad & Tobago
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have decided to purchase a real time clock module for an automated feeder project I am attempting. I would like it to come on everyday for 7pm using a servo to open a door for the food to come out but I am having some difficulty understanding what is meant by "The DS1307 is accessed via the I2C protocol". In Layman's terms, how exactly do I reference the library to read the time? Do I need to purchase additional hardware?

Thanks.  smiley-cool
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I have decided to purchase a real time clock module for an automated feeder project I am attempting. I would like it to come on everyday for 7pm using a servo to open a door for the food to come out but I am having some difficulty understanding what is meant by "The DS1307 is accessed via the I2C protocol". In Layman's terms, how exactly do I reference the library to read the time? Do I need to purchase additional hardware?

Thanks.  smiley-cool

The DS1307 real time clock chip is a 8 pin IC that uses two wire (plus ground) communications to a host device, such as an arduino, using the I2C communications method which the arduino supports directly. So no you don't need any additional hardware other then the DS1307 module.

 What you do need is software support in the form a a library that allows you to utilize the DS1307 in your arduino sketch to utilize it. There are several 3rd party libraries that will provide this support but you have to locate them, download them and learn how to utilize their commands, as the Arduino IDE comes with no standard library to support this RTC module. A DS1307 support library will handle all the details of how to communicate between your arduino sketch and the RTC module using the I2C communications protocol. You just need to study the library you settle on to see how to use it in your sketch.

Lefty

 
Logged

Trinidad & Tobago
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Lefty. You have cleared the dust alot there for me. There's no standard library support in Arduino IDE for this, seems weird I thought this might have been built in since handling time is so cool for automation.
Do you know of any other easy way to handle time modules besides the DS 1307 where Arduino is concerned?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you Lefty. You have cleared the dust alot there for me. There's no standard library support in Arduino IDE for this, seems weird I thought this might have been built in since handling time is so cool for automation.
Do you know of any other easy way to handle time modules besides the DS 1307 where Arduino is concerned?


The DS1307 is the most popular and cost effective way to add a RTC to your arduino projects. Learning to use support libraries is part of the learning curve of utilizing the arduino. Have you selected a RTC module yet? If not many of the vendors that sell them also have software libraries to support them. For example:

Adafrute sells a nice DS1307 module: http://www.adafruit.com/products/264

And offers a link to a library that will support the module: http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/arduino-library

Lefty
Logged

Trinidad & Tobago
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty again thank you very much. I will be purchasing that one you mentioned since it came from an Arduino guru himself. smiley-grin plus you gave the library as well for it.
I already made the gizmo for the pet feeder, now it's time to integrate the time module with my newly found 3rd party library.
Logged

Pages: [1]   Go Up
Jump to: