Data Logging Shield does not work

by Sam666 on Tue Dec 04, 2012 3:59 am

Hello!

I have just assambled the Data Logging Shield and tried the sketches ds1307 and SD Card Info. Nothing worked.
With the uncommented line RTC.adjust(DateTime(__DATE__, __TIME__)); the shield did not get the actual time and showed the year 2034.
And trying the SD Card Info I got the error that initialization failed.

I connected the following pins to the Mega 2560: Vcc, Gnd, Gnd, 5V, Rst, Digital Out 10,11,12,13,Gnd and Analog Inputs 4 and 5.

As I checked the voltages at the pins I got nearly 5V at the pins A4, A5 and Digital Out 10 (even when I disconnected this pin from the Arduino) at the Shield, even though the regulator puts out 3V.

What can I do?
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by Sam666 on Tue Dec 04, 2012 5:00 am

Here are pictures of the front and back.
Attachments
front2.jpg
front2.jpg (753.51 KiB) Viewed 1393 times
back2.jpg
back2.jpg (697.68 KiB) Viewed 1393 times
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Tue Dec 04, 2012 6:50 am

I connected the following pins to the Mega 2560: Vcc, Gnd, Gnd, 5V, Rst, Digital Out 10,11,12,13,Gnd and Analog Inputs 4 and 5.

The Mega uses different pins for SPI and I2C. You need to modify the sketch to use softSPI and softI2C: viewtopic.php?f=31&t=29477&p=148718

As I checked the voltages at the pins I got nearly 5V at the pins A4, A5 and Digital Out 10 (even when I disconnected this pin from the Arduino) at the Shield, even though the regulator puts out 3V.

The Mega uses 5v logic levels.
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Tue Dec 04, 2012 10:07 am

Thanks a lot! SD card an RTC work.
But RTC has to be set manually in one of the sketches. And when I try running the AnalogLogger Sketch an error occurs: "RTC_DS 1307 does not name a type"
And how can I set the RTC automatically by the computer?
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Tue Dec 04, 2012 10:43 am

"RTC_DS 1307 does not name a type"

You need to install RTCLib. https://github.com/adafruit/RTClib

And how can I set the RTC automatically by the computer?

If you add the following code to your setup() function, the first time you run it will set the clock to your computer's time. Once the RTC is running, it will use the time from the RTC.

Code: Select all
  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__));
  }
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 5:30 am

Thanks again!
I installed all the libraries and tried the AdafruitLogger. First, the date and time manually sent to the RTC is given, but as it starts logging each measurement is stamped with 1970/1/1,0:00:00.

Adding the code to the setup() function doesn't work. When I try it with the ds1307soft sketch the wrong time, which was manually given to the RTC, appears.
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Wed Dec 05, 2012 6:34 am

The time set will not happen if the clock is already running. Power down the board and remove the battery from the RTC for few minutes to stop the clock. Then run the sketch again and it should set the time.
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 6:38 am

Thanks!
And what can I do against the wrong time stamp in the Adafruit Logger?
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Wed Dec 05, 2012 6:43 am

What does is the output in the serial monitor when you reset the Arduino?
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 7:00 am

The sketch begins again and says:
FreeRam: 6569
Type any character to start

And when I start again, 1970/1/1,0:00:00 is shown
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Wed Dec 05, 2012 7:30 am

This is the sketch with the modified setup?

Power down and pull the battery to reset the clock and try again. The first time you run it after that, it should say: "RTC is NOT Running!"
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 8:43 am

I tried the modified setup in ds1307soft after taking out the battery and it worked.

But as I tried the Adafruit Logger again it showed:


FreeRam: 6520
Type any character to start
2012/12/5,14:34:22
Logging to: LOGGER11.CSV
millis,date,time,sens0,banned,sens2
3000,1970/1/1,0:00:00,467,418,364
4000,1970/1/1,0:00:00,344,350,335
5000,1970/1/1,0:00:00,310,319,313

So the time is right but is not saved correctly on SD card.

I used the Adafruit Logger sketch without any changes and with:

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__));
}
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 8:45 am

Even as I put

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__));
}

in the ds1307soft sketch, "RTC is NOT running" did not appear on the screen after taking out the battery, but the correct time was taken by the PC
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am

Re: Data Logging Shield does not work

by adafruit_support_bill on Wed Dec 05, 2012 8:55 am

but the correct time was taken by the PC

Do you mean it is logging the correct time now?
User avatar
adafruit_support_bill
 
Posts: 25582
Joined: Sat Feb 07, 2009 9:11 am

Re: Data Logging Shield does not work

by Sam666 on Wed Dec 05, 2012 9:10 am

No, the Logger just shows the correct time once as shown above and then loggs 1970.
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 3:50 am