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?
Data Logging Shield does not work
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
Here are pictures of the front and back.
- Attachments
-
- front2.jpg (753.51 KiB) Viewed 1774 times
-
- back2.jpg (697.68 KiB) Viewed 1774 times
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
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=148718I 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 5v logic levels.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.
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
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?
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?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
You need to install RTCLib. https://github.com/adafruit/RTClib"RTC_DS 1307 does not name a type"
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.And how can I set the RTC automatically by the computer?
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__));
}
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
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.
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.
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
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.
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
Thanks!
And what can I do against the wrong time stamp in the Adafruit Logger?
And what can I do against the wrong time stamp in the Adafruit Logger?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
What does is the output in the serial monitor when you reset the Arduino?
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
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
FreeRam: 6569
Type any character to start
And when I start again, 1970/1/1,0:00:00 is shown
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
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!"
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!"
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
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__));
}
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__));
}
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
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
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
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Data Logging Shield does not work
Do you mean it is logging the correct time now?but the correct time was taken by the PC
-
- Posts: 10
- Joined: Tue Dec 04, 2012 4:50 am
Re: Data Logging Shield does not work
No, the Logger just shows the correct time once as shown above and then loggs 1970.
Please be positive and constructive with your questions and comments.