The hardware is the standard setup and is as follows.

SDA of the RTC to pin 4 of the Arduino.
SCL of the RTC to pin 5 of the Arduino

Then of course pos and neg.
Just ignore the gizDuino info in the setup picture. left side of the page.

Complete details of this RTC can be found here.  Just click on Technical Manual on the left side of the page.

Step 1: Code

Copy and past this into the Arduino IDE and burn to the board. For this i am using an ACEDuino that has a ATMega 328P.
To set the date and time is all done is the serial monitor, which is the easiest i have found. 

// RTC data and time setter              //
//                                       //
// This sample program allows the user   //
// to set the date and time of an RTC    //
// using I2C.                            //
//                                       //
// Codes by:                             //
// eGizmo Mechatronix Central            //
// Taft, Manila, Philippines             //
// http://www.egizmo.com                 //
// April 15, 2013                        //

#include <Wire.h>
const int DS1307 = 0x68; // Address of DS1307 see data sheets
const char* days[] =
{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
const char* months[] =
{"January", "February", "March", "April", "May", "June", "July", "August","September", "October", "November", "December"};
// Initializes all values: 
byte second = 0;
byte minute = 0;
byte hour = 0;
byte weekday = 0;
byte monthday = 0;
byte month = 0;
byte year = 0;

void setup() {
  delay(2000); // This delay allows the MCU to read the current date and time.
  Serial.print("The current date and time is: ");
  Serial.println("Please change to newline ending the settings on the lower right of the Serial Monitor");
  Serial.println("Would you like to set the date and time now? Y/N");
  while (!Serial.available()) delay(10);
  if (Serial.read() == 'y' || Serial.read() == 'Y')
  // This set of functions allows the user to change the date and time
    Serial.print("The current date and time is now: ");
  Serial.println("Thank you.");

// Continuous function for converting bytes to decimals and vice versa
void loop() {
byte decToBcd(byte val) {
  return ((val/10*16) + (val%10));
byte bcdToDec(byte val) {
  return ((val/16*10) + (val%16));

// This set of codes is allows input of data
void setTime() {
  Serial.print("Please enter the current year, 00-99. - ");
  year = readByte();
  Serial.print("Please enter the current month, 1-12. - ");
  month = readByte();
  Serial.print("Please enter the current day of the month, 1-31. - ");
  monthday = readByte();
  Serial.println("Please enter the current day of the week, 1-7.");
  Serial.print("1 Sun | 2 Mon | 3 Tues | 4 Weds | 5 Thu | 6 Fri | 7 Sat - ");
  weekday = readByte();
  Serial.print("Please enter the current hour in 24hr format, 0-23. - ");
  hour = readByte();
  Serial.print("Please enter the current minute, 0-59. - ");
  minute = readByte();
  second = 0;
  Serial.println("The data has been entered.");
  // The following codes transmits the data to the RTC
  // Ends transmission of data

byte readByte() {
  while (!Serial.available()) delay(10);
  byte reading = 0;
  byte incomingByte = Serial.read();
  while (incomingByte != '\n') {
    if (incomingByte >= '0' && incomingByte <= '9')
      reading = reading * 10 + (incomingByte - '0');
    incomingByte = Serial.read();
  return reading;

void printTime() {
  char buffer[3];
  const char* AMPM = 0;
  Serial.print(" ");
  Serial.print(" ");
  Serial.print(", 20");
  Serial.print(" ");
  if (hour > 12) {
    hour -= 12;
    AMPM = " PM";
  else AMPM = " AM";
  sprintf(buffer, "%02d", minute);

void readTime() {
  Wire.requestFrom(DS1307, 7);
  second = bcdToDec(Wire.read());
  minute = bcdToDec(Wire.read());
  hour = bcdToDec(Wire.read());
  weekday = bcdToDec(Wire.read());
  monthday = bcdToDec(Wire.read());
  month = bcdToDec(Wire.read());
  year = bcdToDec(Wire.read());

Step 2: Open the Serial Monitor

Open up the serial monitor and this what you will see. The date and time will not be the same but that's OK we are here to correct this.
Please follow along with the pictures for the input sequence.
If you mess up just start over until you enter everything correctly.  

<p>thank you soo much code is very good.</p>
The code worked fine for me. I also have the code how to display the time and date on the serial monitor. If anyone has any doubt regarding the code can contact me.
Brother when I have run the code I got the output as kkkkkkkkkkkkkkkkkkk..........<br>So please help me <br><br><br><br>
<p>I am getting the time format in 165, ..153 something like this. What is the wrong? can you suggest me..</p>
<p>Hello Hemanthgoalla, </p><p>I am not able to set the time in required format. Suggest me on that. </p><p>Thank you..</p>
<p>Hey, I am having trouble in displaying time and date when i upload the sketch and open serial monitor to see it. My problem is when i give 'y' character in serial monitor the setTime() function is executed which is fine because i want to set time and other parameters through serial monitor but WHAT I WANT IS WHEN I DONT PRESS 'Y' I SHOULD GET EARLIER VALUES OF TIME AND DATE FROM RTC AS A NORMAL FUNCTIONING AS SOON AS I OPEN SERIAL MONITOR AFTER UPLOADING THE CODE AND IN BETWEEN IF I GIVE 'Y' KEY IT SHOULD ONLY EXECUTE setTime(). so what should i do?</p>
<p>Thank you this is amazing! Very sophisticated code!</p>
<p>I am a beginning Arduinist. I have a DS 1307 running with hh:mm:ss and on 2nd row dd/mm/yyyy. I however want on 2nd row &quot;wednesday, december 21&quot; Where /how can I fill in the date? You see, I use a real breadboard!</p>
<p>Thank you very much. You just made my work easy. Keep uploading such instructables.</p>
<p>Thank you for this code.</p><p>I am trying to set a simple RTC DS1307 but when I follow the prompts to set the time etc in the serial port it comes up with the below message...</p><p>the data has been entered.</p><p>The current date and time is now: . -....B. ... 165, 20165 153:165 PM </p><p>Thank you.</p><p>Any ideas how to get the actual time or what I am doing wrong? I am very new to arduino.</p><p>Cheers</p><p>R </p>
<p>i oso face the same problem here</p>
<p>Works well.</p><p>Could a DS3231 be substituted in place of the DS1307?</p>
<p>Hi,</p><p>i have a little problem, i've this message:</p><p>The current date and time is: &frac34;&ucirc;�&Iacute;&Ccedil;&yuml;^&iquest;&thorn;&ordm;&thorn;^&szlig;&plusmn;&iquest;yw}&iquest;&bull;�&szlig;&copy;&Oacute;&iuml;p}&Yuml;&ouml;&yuml;&yuml;&Ugrave;?&icirc;&Yacute;&Dagger;&iquest;w&yuml;&mdash;&ucirc;&Uuml;&lt;&szlig;&divide;&divide;&Ucirc;{&divide;&Iuml;&iuml;,&ucirc;&oacute;&THORN;[&iuml;W&frac14;;}&Ucirc;]&Yacute;&szlig;&Iacute;&yuml;&ucirc;&thorn;&iacute;s&eacute;&yuml;W&ucirc;&divide;&eacute;&yuml;&yuml;&ugrave;&ugrave;&Euml;&Aring;&thorn;&iuml;m&Ouml;k}&atilde;&icirc;~&THORN;&iuml;x&Yuml;&ucirc;_&yuml;&para;&Ugrave;&iquest;o&reg;&Iacute;&yacute;&iquest;W&yuml;&iuml;}&THORN;&yuml;,&Yacute; 165, 20165 153:165 PM<br>Please change to newline ending the settings on the lower right of the Serial Monitor<br>Would you like to set the date and time now? Y/N</p><p>The date's format is'nt ok.</p><p>The probleme already exist after settings:</p><p>The data has been entered.<br>The current date and time is now: &frac34;&ucirc;�&Iacute;&Ccedil;&yuml;^&iquest;&thorn;&ordm;&thorn;^&szlig;&plusmn;&iquest;yw}&iquest;&bull;�&szlig;&copy;&Oacute;&iuml;p}&Yuml;&ouml;&yuml;&yuml;&Ugrave;?&icirc;&Yacute;&Dagger;&iquest;w&yuml;&mdash;&ucirc;&Uuml;&lt;&szlig;&divide;&divide;&Ucirc;{&divide;&Iuml;&iuml;,&ucirc;&oacute;&THORN;[&iuml;W&frac14;;}&Ucirc;]&Yacute;&szlig;&Iacute;&yuml;&ucirc;&thorn;&iacute;s&eacute;&yuml;W&ucirc;&divide;&eacute;&yuml;&yuml;&ugrave;&ugrave;&Euml;&Aring;&thorn;&iuml;m&Ouml;k}&atilde;&icirc;~&THORN;&iuml;x&Yuml;&ucirc;_&yuml;&para;&Ugrave;&iquest;o&reg;&Iacute;&yacute;&iquest;W&yuml;&iuml;}&THORN;&yuml;,&Yacute; 165, 20165 153:165 PM<br>Thank you.</p><p>If someone can help me...</p><p>Thanks!</p>
<p>hi, thanks for the code, but i have one problem with it.</p><p>After i type in the y for yes, the code fill automatically the year with a 0</p><p>Please enter the current year, 00-99. - 0 (this could not be set)</p><p>Please enter the current month, 1-12. - </p><p>Any ideas what the problem is ?</p><p>Thanks and greats</p><p>Andr&eacute;</p>
<p>i face same problem ..</p>
<p>i solved it..</p><p>instead of pressing 'y' and enter, write 'y016' (for 2016), it'll write it like that</p>
<p>i face same problem ..</p>
<p>Hai I am doing this project with Arduino uno and i have completed but in serial terminal i am able to see only &quot; the current date is &quot; other than this i am not able to get anything as mentioned in the images in your website . Kindly help me ... advance thanks</p>
<p>Hello everyone! I'm testing this sketch with a Mega2560 and a DS3231...</p><p>Luckily the address of the chip is the same as the DS1307 ;-)</p><p>With the Serial Monitor (API 1.5.8) I can get access to the setting and display the good clock, but I have the same problem of PanTau78, it's impossible to set the Year!</p><p>I suppose that there one little problem in the function readByte at line 105...</p><p>Who has the solution?</p>
<p>At the bottom right of the serial monitor screen set the box so it says &quot;carriage Return&quot; and answer 'y' and then set it to &quot;Both NL &amp; CR&quot; then type in your other info.</p><p>Just some sloppy coding ..... But at least it works which is more than I can say for the Adafruit RTClib-Master library which won't set the time no matter what I tried</p>
<p>Thanks! Setting dropdown menu in Serial Monitor to &quot;Both NL &amp; CR&quot; worked for my issue where I could not get past the first setting (year setting). How did you figure it out?</p><p>The Adafruit RTClib-Master library is now outdated and my Arduino client is complaining and wont use it. That is not to mention that I prefer not to use additional libraries just to set the clock.</p>
<p>Thanks! Setting dropdown menu in Serial Monitor to &quot;Both NL &amp; CR&quot; worked for my issue where I could not get past the first setting (year setting). How did you figure it out?</p><p>The Adafruit RTClib-Master library is now outdated and my Arduino client is complaining and wont use it. That is not to mention that I prefer not to use additional libraries just to set the clock.</p>
<p>This code worked for me straight out the box, I'm using a homebrew RTC board with the SQW/OUT (pin 7) cabled to a led, to get noticed of my RTC clock running, If I may suggest, in the last &quot;Wire.write(byte(0));&quot; line, should be &quot;Wire.write(byte(0x90));&quot; for setting the control register to Square-Wave Output Enable once per second. (Per datasheet).</p><p>I'm using a Arduino Nano V3.0 (seems to be a chinese clone...)</p><p>Thumbs up!</p>
<p>Awesome! Worked flawlessly. Thanks for this!</p>
<p>OK this made my setting up the DS1307 RTC fast and easy. Thanks</p>
<p>Hi</p><p>this code is working perfectly but i am nt able to set the DATE. can u please help me regarding this.</p>
<p>Hello.</p><p>Worked great but</p><p>How i change pm hr mode to 24hr mode</p><p>Thanks</p>
<p>thank you so much !! very helpful :)</p>
<p>I connected DS1307 and its working. but there is time delay around 3 mins. how to avoid it</p>
<p>hi,</p><p>thanks a zillion for the code. It works perfectly.<br>Can I change SLC and SDA to connect to other lines (like A2 and A1) ? What I would need to change in the code? (is parameter 0x68 imortant for that)?</p><p>thanks for answer</p>
<p>Hey ,</p><p>As far as I know the SLC and SDA lines are set into the specific micro and cant be changed. If you look at the data sheet for the 328P you will see that the pins are set as such, because of this you cant change the pins of this method of communication,,,,, ran into this a while back and just had to deal with it :(</p>
<p>Works Perfectly for Me!!!</p>
<p>its not working ...</p>
Gosh thats to bad.
<p>arduino gives followig error..when i set the time.plz tell me solution.</p><p>The current date and time is: 165, 20165 153:165 PM</p><p>Please change to newline ending the settings on the lower right of the Serial Monitor</p><p>Would you like to set the date and time now? Y/N</p><p>Please enter the current year, 00-99. - 14</p><p>Please enter the current month, 1-12. - September</p><p>Please enter the current day of the month, 1-31. - 12</p><p>Please enter the current day of the week, 1-7.</p><p>1 Sun | 2 Mon | 3 Tues | 4 Weds | 5 Thu | 6 Fri | 7 Sat - Saturday</p><p>Please enter the current hour in 24hr format, 0-23. - 22</p><p>Please enter the current minute, 0-59. - 56</p><p>The data has been entered.</p><p>The current date and time is now: 9&ograve;&shy;e&iquest;t&divide;&frac14;?&eacute;&icirc;}&macr;nL&ugrave;s&Ouml;&raquo;&cent;&Ccedil;&Icirc;&acirc;&yuml;&thorn;&sup1;&yuml;&para;&quot;&yuml;&thorn;&yuml;]&copy;&brvbar;&sup1;&Oslash;^j&yuml;&Uuml;&Ograve;&gt;&ouml;&shy;&ecirc;‹-&Iuml;k&ugrave;&acute;1&reg;&iquest;&igrave;&shy;&THORN;p&ucirc;&auml;&gt;&iuml;&yuml;&brvbar;vŸV&ucirc;&otilde;&Yacute;9v&ucirc;&ograve;&oacute;],&iuml;&Ograve;kQ&yuml;’ŸV&Aring;7&frac14;F&shy;&cent;2~&frac34;&shy;G&times;&oacute;q&aacute;&divide;~;&Ecirc;f&aring;&atilde;&szlig;&Iuml;YvA&yuml;&sect;&Ouml;&yacute;&Ccedil;&divide;{;&cedil;{&thorn;&ucirc;&szlig;{m&raquo;&yuml;&not;&brvbar;&szlig;&uuml;&yuml;&oacute;&acute;&Ucirc;5&divide;&Icirc;&Ccedil;&Uuml;&aelig;&ucirc;y&times;&icirc;&Otilde;&szlig;(š&ETH;&yuml;&ordf;&szlig;}&Ntilde;&aring;e&icirc;&ugrave;&divide;&thorn;hu-Ÿ&eacute;&iuml;F&ntilde;&Aring;&Yacute;&frac12;&gt;_&iquest;]&raquo;‡&ccedil;&reg;&ucirc;;{&gt;“&Yacute;Ÿ&times;&yuml;‡“&iquest;O&yuml;&iquest;7&thorn;&Iuml;&atilde;&yacute;~&frac12;&Ouml;&szlig;&Atilde;&Iacute;?&thorn;&brvbar;&frac14;O;&sect;&frac34;&Otilde;&otilde;u0Ÿo&ecirc;/ž&THORN;g&yuml;&divide;u&iuml;'&Ouml;w}r&frac34;&laquo;&yacute;œ&sect;Œ&acute;&ecirc;&yacute;V&otilde;&raquo;&iquest;&Igrave;+&yen;&otilde;&macr;&ouml;&szlig;˜&uml;”&yuml;&Yacute;&Icirc;&iuml;;&aring;&iacute;žy&iuml;L&szlig;&frac34;]&Uuml;Ÿ&iuml;„&uacute;&uuml;&Oslash;&eacute;&thorn;&Auml;[&Acirc;&Icirc;&thorn;$U&otilde;&yacute;&ordf;+Y{‡&Otilde;&Icirc;&Yacute;&Aring;&divide;&Oslash;|&sect;&uuml;&ordm;&brvbar;Ž&divide;&Ugrave;&Yacute;&Yacute;&Euml;</p><p>&iuml;&yuml;&szlig;&yuml;?}&yacute;‹x]&divide;z&Ugrave;&otilde;M‡ž&Ntilde;&sup2;&raquo;o&szlig;&Uuml;~[w“&micro;&Ouml;&yacute;N&euml;&Oslash;|&Iuml;Ÿ&Iuml;</p><p>&yuml;ƒ*&frac14;Ÿ9&yacute;&iquest;;&oacute;&Euml;&Ouml;&ucirc;.&frac12;&thorn;&plusmn;&iquest;&laquo;&Oacute;=Ÿ&ntilde;&ecirc;#&sup2;&shy;A;&copy;&pound;&Icirc;;-?Ÿ(k&amp;z&iquest;&ccedil;}&yacute;&iquest;&Aring;&Otilde;&THORN;•&ccedil;&frac34;?&Uacute;&szlig;&igrave;&divide;&eacute;™j&ugrave;&Ocirc;V&divide;&icirc;&raquo;&iquest;tkŸ&frac34;u&aring;&plusmn;o&ucirc;&euml;&euml;&ucirc;\&frac34;&frac14;&oacute;&Ucirc;&brvbar;&uuml;Š&acirc;klŸ7&szlig;{&yuml;&iuml;&lt;&Uacute;&uuml;S&raquo;&eacute;Eƒ&ccedil;&shy;œi&oslash;&euml;?~_&iuml;&iuml;&ouml;”S&Egrave;/&yacute;&ograve;&lt;o&ucirc;&gt;&icirc;V&szlig;&frac14;q™&ograve;&atilde;o›Ÿ&thorn;&cent;&uacute;&yuml;n&szlig;d+m&ugrave;&atilde;&szlig;z&iquest;3_&acirc;&plusmn;~_Ÿv&raquo;&curren;&Ouml;&aring;?&iquest;&Yacute;|&ecirc;&euml;&sect;&yacute;&iquest;~X&brvbar;}&thorn;'&uacute;&icirc;Ÿ&THORN;D&yacute;&atilde;&yuml;&yuml;&divide;Y&yuml;&yen;ƒG'o&eacute;&thorn;=;&szlig;a&szlig;W&Ouml;ž&ocirc;&yuml;^&reg;%&ucirc;&ccedil;R&thorn;?&yacute;&thorn;&thorn;GŸ3&yuml;Wž&uuml;wBG&ugrave;&thorn;k&otilde;&laquo;)cVK‡k}J&frac12;1&euml;4m—\&eacute;˜&egrave;o~&sup3;“~*&Ouml;&para;&otilde;&ucirc;&frac12;&ccedil;&yuml;/t&reg;&yen;&ouml;&Ugrave;Ÿ˜&macr;&para;6&euml;&Eacute;vus'&yuml;&laquo;fa&ocirc;&shy;&otilde;&iuml;15&laquo;&thorn;}&cedil;&iuml;&ograve;t&iquest;‚2&THORN;&iacute;&Uuml;ŸE&oslash;~&yacute;&oacute;&THORN;n3&szlig;&ugrave;&szlig;&Euml;&Otilde;&eacute;~:&times;&iuml;&yacute;&icirc;&Euml;&Ucirc;z1nw&Oacute;&Iuml;&macr;O&uuml;&Oslash;&ouml;ž&THORN;&igrave;&raquo;‡&uacute;.Ž&ordm;h&yacute;&reg;&thorn;=ƒŒ&atilde;&yacute;&Iuml;&thorn;U&icirc;–&yacute;&Otilde;&iquest;&szlig;v&ocirc;&divide;P&igrave;&oacute;=&yuml;&yuml;&Ugrave;+&yacute;&thorn;&yuml;&szlig;”w[–&yacute;I&iquest;P&thorn;N&curren;&yuml;\{&frac34;]&agrave;&frac12;&sup1;&iquest;&iquest;&ordm;&yuml;nm|Ÿ/&deg;w&igrave;&ocirc;&oacute;Ÿ&yacute;&Euml;&igrave;?&igrave;?&frac34;&iuml;&Yacute;&Otilde;&euml;[&times;&Ouml;&iuml;&eacute;&uuml;&yuml;n&Iacute;&Ouml;n;&pound;&Acirc;&aacute;&oslash;m&Icirc;Œ?&frac34;&raquo;&uml;ŸŸo&Ograve;&euml;&atilde;&oslash;&Ucirc;&Iuml;&Igrave;&Eacute;&oslash;&eacute;&szlig;&iquest;&iquest;&oacute;&sup1;s=&Uacute;&laquo;&szlig;&yuml;&ograve;Z&eacute;~&szlig;~&curren;&szlig;&szlig;&oacute;/j&uuml;=&micro;&yuml;&yuml;ž&Iuml;S&yuml;e&yacute;&ouml;&sup1;&micro;BW7†&ordm;&uacute;&euml;&THORN;&ouml;&yacute;&eacute;&THORN;&yuml;&cedil;&sup3;&Igrave;~&ugrave;&icirc;&Ugrave;&Iacute;d&micro;g?&laquo;&iuml;k&ouml;&ordm;&ETH;&gt;&lt;{&Eacute;{&thorn;&sect;˜&oslash;&igrave;&thorn;™&frac12;&acirc;–&uacute;&frac12;M7&uacute;&ucirc;&yuml;&ouml;{&shy;&thorn;&sect;&THORN;&Atilde;&thorn;&Ouml;ck&Icirc;n&frac12;Ÿ3&thorn;&iuml;M&oacute;o&iquest;Ÿƒ&iacute;}&Iuml;&ouml;&times;&yuml;&szlig;}|–&uuml;&sup1;w&szlig;&Iuml;&iuml;\&divide;&divide;_&yen;&otilde;&Otilde;&Ucirc;&ucirc;&Eacute;˜&sect;&yacute;&euml;&gt;_‰&szlig;o&Egrave;&Yacute;3&Yacute;&euml;&yacute;_m&yuml;&uacute;gw&sup2;m&aring;–&THORN;Š&sup3; &uacute;&yuml;&ecirc;&Otilde;&thorn;&divide;V&yacute;&micro;&thorn;&auml;&Eacute;&sup3;?&uuml;&times;&divide;&sup3;“&cent;&thorn;&Oacute;&ouml;&szlig;w&yuml;&oacute;&ucirc;&aring;&yuml;</p><p>@&uuml;&frac14;]&not;&thorn;%&ucirc;&Icirc;&THORN;&Ucirc;&frac34;:&iuml;&Ucirc;&gt;&macr;&copy;}zo=&times;{&uuml;&yacute;&euml;&gt;mP&uacute;&oacute;~&icirc;</p><p>OC&uacute;&micro;&Ouml;5&frac34;&Ouml;&times;œb—&yacute;&auml;</p><p>&Oslash;&szlig;&yuml;|&Atilde;›&Ograve;&divide;&Ucirc;&divide;&otilde;&divide;&pound;3y&macr;&sup1;&ucirc;=‹&iuml;&Uuml;“&iuml;&iuml;&frac14;&micro;NOn&sect;&ograve;&macr;q&sect;&ucirc;y&euml;‡&Otilde;&thorn;&yuml;&sup1;&icirc;auŸ&Yacute;œ&ntilde;vool&cedil;o&Ucirc;&ordm;&szlig;[&frac12;V&Auml;&raquo;\&iacute;w}&brvbar;&Iacute;&yacute;&uacute;&Iacute;&laquo;&ucirc;&brvbar;&eacute;/&aring;]&icirc;f&iuml;&Ntilde;&szlig;R&shy;•&uuml;&ograve;&ccedil;&divide;&yuml;&iuml;&Yacute;y&euml;&Iuml;g&aring;t&raquo;M&Ocirc;z&iacute;^&sup1;&curren;&yuml;/&yacute;&ugrave;&reg;&ucirc;&iacute;&otilde;W&ucirc;&euml;&iacute;&otilde;zk&aring;??&divide;g&yuml;7&ETH;&yuml;Ÿ&iquest;{?&macr;?&shy;“&copy;OoyW”&micro;%&otilde;&times;&iuml;&uuml;&Ntilde;&Icirc;&Ucirc;&iquest;&uacute;&eacute;$&yuml;&ucirc;I–&oslash;&yuml;w&sup3;&ugrave;&ouml;.=&THORN;&plusmn;&Ograve;n&lt;&frac34;&Igrave;š&eacute;&ccedil;g&yacute;&yuml;&yuml;{&divide;ž&oacute;&otilde;&iquest;&Uacute;&ccedil;&yacute;S&iuml;c&Ucirc;&Euml;=~&otilde;&sup1;&iquest;&yuml;&eacute;&szlig;S&copy;?&icirc;&oacute;&ucirc;&yuml;&Iuml;&Ocirc;‹•l&szlig;&auml;&ucirc;&ouml;&szlig;&frac34;D&uacute;&ntilde;&atilde;&plusmn;&Euml;&copy;i—&iuml;tm&Aring;&Yacute;&ecirc;&divide;lr”mG&ordm;&sup1;&Oacute; 165, 20165 153:165 PM</p><p>Thank you.</p>
So whats the problem, follow the directions and start with the first line, enter it and move on. Its a little tricky but is not impossible.
<p>after upload serial monitor shows right time.but wen i again connect arduino to pc then it shows 165/165 like garbage values..i also connected battery to rtc.</p>
hi camblonie! <br> <br>scl is connected to pin5,sda connected to pin4,gnd of rtc connected to gnd of gizduino, vcc connected to 5v of gizduino. but still rtc not working. <br> <br>here is serial monitor output: <br> <br>The current date and time is: 165, 20165 153:165 PM <br>Please change to newline ending the settings on the lower right of the Serial Monitor <br>Would you like to set the date and time now? Y/N <br>Please enter the current year, 00-99. - 14 <br>Please enter the current month, 1-12. - January <br>Please enter the current day of the month, 1-31. - 7 <br>Please enter the current day of the week, 1-7. <br>1 Sun | 2 Mon | 3 Tues | 4 Weds | 5 Thu | 6 Fri | 7 Sat - Tuesday <br>Please enter the current hour in 24hr format, 0-23. - 9 <br>Please enter the current minute, 0-59. - 28 <br>The data has been entered. <br>The current date and time is now: xh.•&lt;&sup3;wa&acute;&shy;—&thorn;&laquo;ƒ&Atilde;&Ouml;.t&divide;&auml;c&shy;‡|&divide;V}&uacute;\‑&Uuml;&shy;&micro;—9b&brvbar;&iuml;a&Ntilde;r––&Atilde;“&ordf;6&ntilde;*&Iacute;&ocirc;Š&divide;I&euml;d&sect;&szlig;&sup1;&uuml;K&frac34;–g&raquo;&yacute;&ordm;&shy;KE&ouml;?;&aring;&uuml;3&Uuml;Ÿ&oacute;&shy;ax&times;”&THORN;&frac34;&THORN;&Ograve;o&ordm;&laquo;&egrave;&Ugrave;‹ž&Egrave;&iacute;&frac34;Kx~=&ograve;&Iuml;{’+&ntilde;R&otilde;&acute;&Acirc;†•&Icirc;b&sup3;~&yacute;&otilde;k&Yacute;&lt;;{&ugrave;&Icirc;—&reg;I&times;Ž_&middot;Œ›}&ugrave;gUs&iuml;&gt;Nz&acute;&THORN;oz}&macr;!&iquest;|k&Icirc;&ugrave;&ograve;=•qŽ&middot;~m2&atilde;&Ouml;…&Ntilde;&amp;&ccedil;&Eacute;6„&sup3;^)&Icirc;‡&ucirc;u&igrave;~&reg;&aelig;&ordm;&iuml;mŒ&ouml;&Oslash;w&reg;d&acute;&auml;&euml;&Ograve;&Ccedil;&yuml;&thorn;ž&ecirc;d&szlig;6&ecirc;ž?&aacute;&yuml;&Euml;I&AElig;&iuml;,ž <br>[&sup3;k&iexcl;&micro;&Uuml;ˆ&yuml;&brvbar;‑&Iacute;:&ouml;&deg;&copy;KœM_&yacute;&Ecirc;S&Auml;&Uacute;&oacute;&raquo;&Uacute; <br>&micro;{&Icirc;\&raquo;&Ocirc;&yuml;&THORN;&ograve;&icirc;&Ouml;zkM&atilde;&Ouml;&iuml;&uuml; <br>ˆo&Uacute;k&reg;&auml;J&Oacute;djŠ&divide;.&lt;&oacute;&iuml;79&ntilde;&uml;&lt;{&Euml;{&Ouml;} 165, 20165 153:165 PM <br>Thank you. <br>
<p>ive same problems as you mentioned.did you get any solution on this?? plz tell me.. </p>
Continue with setting the date and time.
its me hellomark
<p>Hello, I have a problem about the time and date and the details are down below</p><p>The current date and time is: 165, 20165 153:165 PM<br>Please change to newline ending the settings on the lower right of the Serial Monitor<br>Would you like to set the date and time now? Y/N<br>Please enter the current year, 00-99. - 14<br>Please enter the current month, 1-12. - January<br>Please enter the current day of the month, 1-31. - 18<br>Please enter the current day of the week, 1-7.<br>1 Sun | 2 Mon | 3 Tues | 4 Weds | 5 Thu | 6 Fri | 7 Sat - Saturday<br>Please enter the current hour in 24hr format, 0-23. - 7<br>Please enter the current minute, 0-59. - 0<br>The data has been entered.<br>The current date and time is now: 165, 20165 153:165 PM<br>Thank you.</p>
<p>if you get the 165 output there si something wrong. There are two lines of thought:<br>1- there is a bad connection somewhere (that is what ladyada says)</p><p>2- yr chip is fried (that is my experience)</p>
<p>Hi,</p><p>Try running a I2C-Scanner code on your Arduino (http://playground.arduino.cc/Main/I2cScanner). You might get several different adresses back and maybe an other adress might work for your module. </p><p>I got 0x68 and 0x50 above code works fine for me with 0x68. But I get exactly the same output as you do, if I change &quot;const int DS1307 = 0x68;&quot; to &quot; &quot;const int DS1307 = 0x50;&quot; in line 16.</p><p>Hope that helps.</p>
<p>Hello, I've checked for I2C-Scanner, but the result is: Scanning...</p><p>No I2C devices found; What's wrong?</p>
<p>Whats the problem?</p>
<p>Hi!</p><p>I am facing the same problem as stuartsjg faced ...i-e when i pressed &quot;Y&quot; i got the message of thank you in the serial monitor ,and during this action i had disabled the newline ,still i got the same problem it looks like that the program is not jumping to the setTime() loop... here is the picture of serial monitor..plz help me out in this</p>
<p>Hello,</p><p>This looks good, however once i get to here:<br>The current date and time is: Saturday February 18, 2014 10:01 PM<br>Please change to newline ending the settings on the lower right of the Serial Monitor<br>Would you like to set the date and time now? Y/N<br>Please enter the current year, 00-99. - </p><p>I type in to the send box &quot;14&quot; and press send, there is no response. Any ideas why?</p>
<p>For pressing &quot;y&quot;, disable newlines. Then, for sending digits, enable &quot;Newline&quot;. The needed drop-down list is at the bottom of Serial Monitor, next to baud rate drop-down.</p>
<p>I am getting the following errors when I compile the set time code as presented above:</p><p>Compiling Set time DS1307...<br>Creating /home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp.o...<br>&quot;/home/steve/Arduino IDE/arduino-1.0.5/hardware/tools/avr/bin/avr-g++&quot; -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 &quot;-I/home/steve/Arduino_Build/Set time DS1307&quot; &quot;-I/home/steve/sketchbook/Set time DS1307&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/tools/avr/avr/include&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/avr-libc&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/variants/standard&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/libraries/Wire&quot; &quot;-I/home/steve/Arduino IDE/arduino-1.0.5/libraries/Wire/utility&quot; &quot;/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp&quot; -o &quot;/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp.o&quot;<br>/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp: In function &lsquo;void setup()&rsquo;:<br>/home/steve/Arduino_Build/Set time DS1307/Set time DS1307.ino.cpp:44: error: no matching function for call to &lsquo;HardwareSerial::begin()&rsquo;<br>/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/HardwareSerial.h:55: note: candidates are: void HardwareSerial::begin(long unsigned int)<br>/home/steve/Arduino IDE/arduino-1.0.5/hardware/arduino/cores/arduino/HardwareSerial.h:56: note: void HardwareSerial::begin(long unsigned int, uint8_t)<br>[Stino - Error 1]</p><p>I've checked and hardwareserial.h is where it is supposed to be. Any suggestions would be appreciated.</p>

About This Instructable




Bio: Why would i buy something ready made when i can make it myself with half the features for twice the money? DIY!
More by WWC:3D Pinted Spool Reel Hard Drive Tachometer for a Desktop Computer 4093 Schmidt Trigger / Fan Speed Regulation 
Add instructable to: