2165/165/165 Output from DS1307N

Hi, I have build a sensor using arduino Uno and Deekrobot datalogger shield to measure pressure. I am trying to add timestamp to the output using DS1307N but the output i am getting is 2165/165/165 for Year/Month/Day. The deekrobot datalogger shield has built in RTC (DS1307N) hence I have not build a separate circuit.

However, when i run the RTC without integrating its code into data logger, it records correct values.

I have attached both codes and the output :

  1. FSR_Datalogger_v2.ino ----> Error in RTC Output
  2. Timestamp.ino -----> Perfect Output

I don’t understand why stand alone code is working and integrated code isn’t. Can anyone help?

Error in RTC Output.png

Perfect Output.png

FSR_Datalogger_v2.ino (3 KB)

Timestamp.ino (2.22 KB)

I am adding picture of my setup for better reference.

here are the pictures

The 165 indicates that the data line for the RTC (SDA) is stuck at one which usually indicates a wiring error. I notice in the photos that you do not have one or two of the jumper wire's pins pushed all the way into the header so that they may not be making good contact.

There is one small difference in the two sketches as far as the RTC is concerned. In the datalogger code, you call Wire.begin() in setup() but in the standalone RTC code you don't. I would have thought that the standalone RTC sketch would have failed without the wire.begin(). Anyway, try removing the Wire.begin() from the datalogger.


Thanks Pete. I was able to work the code. I started with the Timestamp code and inserted the code for sensor. It worked, somehow :P