strange datalogger rtc problem

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
O2
 
Posts: 33
Joined: Sat Aug 30, 2014 11:20 am

strange datalogger rtc problem

Post by O2 »

The datalogger was working fine for the first 24 hours of test run. Then I played with removing and inserting sd while the logger is running. I also played with plugging 6 AA while usb is still connected. Suddenly, I started getting strange rtc readings. The problem comes and goes unpredictably. Here is the record of one session (ignore temp, and vcc). Sample rate is every 10 second. I didn't touch the logger during the session.

Initializing SD card...card initialized.
Logging to: LOGGER23.CSV
millis,stamp,datetime,Oxygen,temp,vcc
9999, 1409355118, "2014/8/29 23:31:58", % 021.20, 535.42, 1.10
19998, 1230162385, "2165/165/165 165:165:85", % 021.07, 535.42, 1.10
30000, 1230162385, "2165/165/165 165:165:85", % 020.97, 535.42, 1.10
39999, 1230162385, "2165/165/165 165:165:85", % 020.93, 535.42, 1.10
49999, 1409355158, "2014/8/29 23:32:38", % 020.92, 535.42, 1.10
60000, 1230162385, "2165/165/165 165:165:85", % 020.87, 535.42, 1.10
69998, 1409355178, "2014/8/29 23:32:58", % 020.88, 535.42, 1.10
80000, 1409355188, "2014/8/29 23:33:8", % 020.89, 535.42, 1.10
89999, 1409355198, "2014/8/29 23:33:18", % 020.87, 535.42, 1.10
99999, 1409355208, "2014/8/29 23:33:28", % 020.87, 535.42, 1.10
110000, 1230162385, "2165/165/165 165:165:85", % 020.88, 535.42, 1.10
119999, 1230162348, "2165/165/165 165:165:48", % 020.87, 535.42, 1.10
129998, 1409355238, "2014/8/29 23:33:58", % 020.85, 535.42, 1.10
140000, 1409355248, "2014/8/29 23:34:8", % 020.89, 535.42, 1.10
149999, 1409355258, "2014/8/29 23:34:18", % 020.85, 535.42, 1.10
160000, 1409355268, "2014/8/29 23:34:28", % 020.82, 535.42, 1.10
169999, 1409355278, "2014/8/29 23:34:38", % 020.84, 535.42, 1.10
179998, 1409355288, "2014/8/29 23:34:48", % 020.85, 535.42, 1.10
190000, 1409355298, "2014/8/29 23:34:58", % 020.86, 535.42, 1.10
199999, 1409355308, "2014/8/29 23:35:8", % 020.85, 535.42, 1.10
209999, 1409355318, "2014/8/29 23:35:18", % 020.86, 535.42, 1.10
219999, 1409355328, "2014/8/29 23:35:28", % 020.86, 535.42, 1.10
229998, 1409355338, "2014/8/29 23:35:38", % 020.83, 535.42, 1.10
239998, 1409355348, "2014/8/29 23:35:48", % 020.89, 535.42, 1.10
249999, 1409355358, "2014/8/29 23:35:58", % 020.85, 535.42, 1.10
259999, 1409355368, "2014/8/29 23:36:8", % 020.88, 535.42, 1.10
269999, 1409355378, "2014/8/29 23:36:18", % 020.90, 535.42, 1.10
279999, 1409355388, "2014/8/29 23:36:28", % 020.91, 535.42, 1.10
289999, 1409355398, "2014/8/29 23:36:38", % 020.90, 535.42, 1.10
299999, 1409355408, "2014/8/29 23:36:48", % 020.87, 535.42, 1.10
309999, 1409355418, "2014/8/29 23:36:58", % 020.85, 535.42, 1.10
320000, 1409355428, "2014/8/29 23:37:8", % 020.90, 535.42, 1.10
329999, 1409355438, "2014/8/29 23:37:18", % 020.86, 535.42, 1.10
339998, 1409355448, "2014/8/29 23:37:28", % 020.87, 535.42, 1.10
350000, 1409355458, "2014/8/29 23:37:38", % 020.89, 535.42, 1.10
359999, 1409355468, "2014/8/29 23:37:48", % 020.91, 535.42, 1.10
369998, 1409355478, "2014/8/29 23:37:58", % 020.89, 535.42, 1.10
380000, 1409355488, "2014/8/29 23:38:8", % 020.93, 535.42, 1.10
389998, 1409355498, "2014/8/29 23:38:18", % 020.82, 535.42, 1.10
399998, 1409355508, "2014/8/29 23:38:28", % 020.91, 535.42, 1.10
409999, 1409355518, "2014/8/29 23:38:38", % 020.92, 535.42, 1.10
419998, 1230162385, "2165/165/165 165:165:85", % 020.86, 535.42, 1.10
430000, 1230162385, "2165/165/165 165:165:85", % 020.92, 535.42, 1.10

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: strange datalogger rtc problem

Post by adafruit_support_rick »

Those RTC readings usually indicate a bad ground connection. Check your wiring and soldering.

User avatar
O2
 
Posts: 33
Joined: Sat Aug 30, 2014 11:20 am

Re: strange datalogger rtc problem

Post by O2 »

Thanks for the help. Now how do I set the SD file creation date? All my files show 1/1/2000 12:00AM.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: strange datalogger rtc problem

Post by adafruit_support_mike »

There are a couple of options:

You can write a sketch that sets the RTC's date/time using the __DATE__ and __TIME__ precompiler macros. Those are converted to explicit time values every time you compile the code, but remain fixed any time you run the code. Load and execute the sketch once to set the RTC, then load in a new sketch that assumes the clock is set to the correct time rather than trying to set it.

You can also extract the time/date from the GPS module's output and use that to set the clock periodically.. once every hour or so.

User avatar
O2
 
Posts: 33
Joined: Sat Aug 30, 2014 11:20 am

Re: strange datalogger rtc problem

Post by O2 »

I already ran your sample sketch using the __DATE__ and __TIME__ to set the rtc. The rtc gives me correct time. My problem is with the file created/modified date. Is it created automatically by sd lib. or do I have to write a sketch to do that? It'd be helpful to see the correct date for each file when I transferred the sd to my pc.

I don't have a gps.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: strange datalogger rtc problem

Post by Franklin97355 »

There was this on the Arduino forums http://forum.arduino.cc/index.php?topic=72739.0

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”