RTC 1307

Hello everyone,

I have a problem with my arduino nano and rtc 1307.
I use this code:

#include <Wire.h>
#include “RTClib.h”
RTC_DS1307 RTC;

void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
if (! RTC.isrunning()) {
Serial.println(“RTC is NOT running!”);
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(DATE, TIME));
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.year(), DEC);
Serial.print(’/’);
Serial.print(now.month(), DEC);
Serial.print(’/’);
Serial.print(now.day(), DEC);
Serial.print(’ ‘);
Serial.print(now.hour(), DEC);
Serial.print(’:’);
Serial.print(now.minute(), DEC);
Serial.print(’:’);
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
}

but when a start to serial monitor showed nothing. Any ideas? thanks and sorry for my english

Is your serial monitor speed set to 9600? Speed mismatch is often a problem.

Yes serial monitor is set to 9600 baud.
Another ideas?

petko44:
Yes serial monitor is set to 9600 baud.
Another ideas?

Does the initial message print the first time you run it ("RTC is NOT running!")?

You might have a hardware problem. Try a sketch that does not use the RTC, but just prints something. Does that work? Does the program upload over usb?

I try print some text and its works. You think that is something wrong woth RTC, because didn´t print initial nessage

No, there might be something wrong with how it's hooked up though. Show us a clear picture of your circuit.

there is it my circuit:

No diagram showing …?

You should be wired like this …

Edit - have just run your code on a 1307 , its ok

dbe8cc2af4e2c9f58a18f81dcc54873fbf7c3fb6.jpg

566fdb208ad809a6eed50ec1997e7b49257cf590.jpg

.

and this is empty serial monitor

Did you click the 'Check mark' or the 'Arrow' button on the IDE tab?

.

I don´t know, what you mean. Can you explain me, please?
I´m new in this matters only 3 month.

2017-01-03_15-30-10.jpg

.

petko44:
there is it my circuit:

Thanks for the picture Ricky, Get out a magnifying glass and inspect the soldering job for "solder bridges between the pads where you attached the wires, and on the other side as well. It looks a bit spattered to me, and may be shorting out your connections.

I checked my soldering with magnifying glass an thre are no short out

I'm running out of ideas, but ...

Larry's comment is pertinent because your status line says "done compiling" not "done uploading" It appears that you have not uploaded the program.

Of course I updated to the board. And it´s says DONE COMPILING.

petko44:
Of course I updated to the board. And it´s says DONE COMPILING.

Please be accurate in what you are saying.

2017-01-04_0-12-06.jpg

.

ohh, sorry i mean DONE UPLOADING.
It´s possible that something missing in my notebook?

I just connected the same RTC and downloaded the sketch in post #1 to IDE 1.69 all works as expected.

I am getting a different memory usage on my compile but that is probably a IDE version difference.

If you have proven serial communications and the wires going to the RTC are making proper connection it looks like you RTC is bad. I assume the RTC battery is OK.

You could write some simple code to toggle A4 and A5 to LEDs to make sure the pins are OK.

At a minimum, you should get this when the RTC is not there (unplugged):

2017-01-04_0-53-01.jpg

.