Data Logging Shield does not work

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Data Logging Shield does not work

Post by Sam666 »

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 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

Here are pictures of the front and back.
Attachments
front2.jpg
front2.jpg (753.51 KiB) Viewed 1773 times
back2.jpg
back2.jpg (697.68 KiB) Viewed 1773 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

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: http://forums.adafruit.com/viewtopic.ph ... 7&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.

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

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?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

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

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

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.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

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.

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

Thanks!
And what can I do against the wrong time stamp in the Adafruit Logger?

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

What does is the output in the serial monitor when you reset the Arduino?

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

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

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

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!"

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

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,sens1,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 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

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

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logging Shield does not work

Post by adafruit_support_bill »

but the correct time was taken by the PC
Do you mean it is logging the correct time now?

Sam666
 
Posts: 10
Joined: Tue Dec 04, 2012 4:50 am

Re: Data Logging Shield does not work

Post by Sam666 »

No, the Logger just shows the correct time once as shown above and then loggs 1970.

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

Return to “Arduino Shields from Adafruit”