The SD card is not creating any file

Hi guys,

I am running a project consisting in a weather station. It runs measuring rain fall and temperatures. I will place the weather station in the forest so that I need to keep the data into the SDCard.

The sketch works perfectly but the serial monitor says that the SDCard cannot create a file.

My question is, should be the red LED from the adafruit shield ON or just the green LED indicated the power ON?

It is being difficult to me to keep these LEDs on and I do not want to start soldering before being sure that the SDcard really works.

Please see attachments.

Regards.

Reading at serial monitor.pdf.pdf (232 KB)

This is the sketch which is working good but It is not creating any file at the SDCard.

/*-----( Declare Libraries )-----*/

#include <SPI.h>
#include <SD.h>          //Ensure that you downlaod these libraries and store them in your Arduino libraries folder 
#include <Wire.h>        //Remember no semi-colon after these commands
#include "RTClib.h"
#include <OneWire.h>
#include <DallasTemperature.h> //Get DallasTemperature Library here:  http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library

/*-----( Declare Constants and Pin Numbers )-----*/
const int REED = 9;     //The reed switch outputs to digital pin 9
int val = 0;            //Current value of reed switch
int old_val = 0;        //Old value of reed switch
int REEDCOUNT = 0;      //The intial count is zero

const int chipSelect = 10;
File logfile;
#define SYNC_INTERVAL 60000
#define ONE_WIRE_BUS_PIN 2
uint32_t syncTime = 0; // time of last sync()

/*-----( Declare objects )-----*/
RTC_Millis rtc; /////RTC_DS1307 RTC; // define the Real Time Clock object
OneWire oneWire(ONE_WIRE_BUS_PIN);// Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature.

/*-----( Declare Variables )-----*/
DeviceAddress Probe01 = { 
  0x28, 0x5A, 0xB7, 0x00, 0x00, 0x00, 0x80, 0x6D };// Assign the addresses of your 1-Wire temp sensors. 
DeviceAddress Probe02 = { 
  0x28, 0x5C, 0xB7, 0x00, 0x00, 0x00, 0x80, 0xDF };// See the tutorial on how to obtain these addresses:
DeviceAddress Probe03 = { 
  0x28, 0x12, 0x6D, 0x73, 0x06, 0x00, 0x00, 0x27 };// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html
DeviceAddress Probe04 = { 
  0x28, 0xB2, 0xCB, 0x5E, 0x06, 0x00, 0x00, 0x39 };

/////////////Program Set-up/////////////////////////////////////////////////////////////////////

void setup(void){ /****** SETUP: RUNS ONCE ******/

  Serial.begin(9600);// start serial port to show results
  pinMode (REED, INPUT_PULLUP);  //Activate the internal pull-up resistor

  /////////////Setting up the file on the SD Card///////////////////////////////

  Serial.println("Initializing SD card...");
  pinMode(10, OUTPUT);  // make sure that the default chip select pin is set to output


  if (!SD.begin(chipSelect)) {  // see if the card is present and can be initialized:
    Serial.println("Card failed, or not present");
  }
  Serial.println("card initialized.");  // create a new file

  char filename[] = "LOGGER00.CSV";      //The file names must be in the 8.3 format
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE); 
      break;  // leave the loop!
    }
  }

  if (! logfile) {
    Serial.println("could not create file");
  }

  Serial.print("Logging to: ");
  Serial.println(filename);

  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
  /////rtc.adjust(DateTime(2015, 7, 7, 12, 40, 0));

  Serial.println("Rainfall, Reading/count, date, time");
  logfile.println("Rainfall, Reading/count, date, time"); 

  //Serial.begin(9600);
  Serial.print("Initializing temp. sensors");
  Serial.println("Reading 4 probes");


  sensors.begin();// Initialize the Temperature measurement library


  sensors.setResolution(Probe01, 10);// set the resolution to 10 bit (Can be 9 to 12 bits .. lower is faster)
  sensors.setResolution(Probe02, 10);
  sensors.setResolution(Probe03, 10);
  sensors.setResolution(Probe04, 10);


}//--(end setup )---


///////////////////The Program Loop//////////////////////////////////////////////////////////////////////
void loop(){ //****** LOOP: RUNS CONSTANTLY ******/


  DateTime now = rtc.now(); /////DateTime now;    // and record date/time of change

  val = digitalRead(REED);


  if ((val == LOW) && (old_val == HIGH))//Low means that the Reed switch is open (which happens when the magnet passess).

  {
    delay(10);    // Delay put in to deal with any "bouncing" in the switch.

    char buf1[50];

    Serial.print("Precipitation");
    Serial.print("= ");
    REEDCOUNT = REEDCOUNT + 10;
    old_val = val;

    Serial.print(REEDCOUNT);
    Serial.print(" mm of rain at ");

    sprintf(buf1, "%02d:%02d:%02d of %02d/%02d/%02d",  now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());
    Serial.println(buf1);

    logfile.print("Precipitation");
    logfile.print("= ");
    logfile.print("Precipitation");
    logfile.print(". ");
    logfile.println(buf1);


  }
  else {
    old_val = val; //If the status hasn't changed then do nothing
  }

  if ((millis() - syncTime) < SYNC_INTERVAL) return;
  logfile.flush();
  syncTime = millis();

  {
    //delay(1000);
    Serial.println();
    Serial.print("Number of Devices found on bus = ");  
    Serial.println(sensors.getDeviceCount());   
    Serial.print("Getting temperatures... ");  
    Serial.println();   


    sensors.requestTemperatures();  // Command all devices on bus to read temperature 

    Serial.print("Probe 01 temperature is:   ");
    printTemperature(Probe01);
    Serial.println();

    Serial.print("Probe 02 temperature is:   ");
    printTemperature(Probe02);
    Serial.println();

    Serial.print("Probe 03 temperature is:   ");
    printTemperature(Probe03);
    Serial.println();

    Serial.print("Probe 04 temperature is:   ");
    printTemperature(Probe04);
    Serial.println();

  }

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/
void printTemperature(DeviceAddress deviceAddress)
{

  float tempC = sensors.getTempC(deviceAddress);

  if (tempC == -127.00) 
  {
    Serial.print("Error getting temperature  ");
  } 
  else
  {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}// End printTemperature

Are you sure the SD card is good? Does it work on your computer?

Have you used the "SD Formatter" software to format the SD card in a way that the Arduino can use it? See this post for more info:

Have you been able to write anything to the SD card? Or read anything?

Try some of the SD example code included with the Arduino.

File > Examples > SD > CardInfo

Change SDChipSelect to the pin number for your SD card's chip select. I think 10 is correct for the board in the picture you attached.

Once you can get info about your SD card, try some of the other example sketches from the SD library. Remember to change chip select to 10.

Hi Gdunge, thanks for your answer.

The SD card in working when applying the examples you are mentioned but it is not retaining the same info I get when I read at the serial monitor.

I think I should add something on the sketch but I do not know where because it is doing what I want when I chech the reading at the serial monitor.

I attach a printed screen of the serial monitor reading and the matching sketch.

Thanks again.

/*-----( Declare Libraries )-----*/

#include <SPI.h>
#include <SD.h>          //Ensure that you downlaod these libraries and store them in your Arduino libraries folder 
#include <Wire.h>        //Remember no semi-colon after these commands
#include "RTClib.h"
#include <OneWire.h>
#include <DallasTemperature.h> //Get DallasTemperature Library here:  http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library

/*-----( Declare Constants and Pin Numbers )-----*/
const int REED = 9;     //The reed switch outputs to digital pin 9
int val = 0;            //Current value of reed switch
int old_val = 0;        //Old value of reed switch
int REEDCOUNT = 0;      //The intial count is zero

const int chipSelect = 10;
File logfile;
#define SYNC_INTERVAL 60000
#define ONE_WIRE_BUS_PIN 2
uint32_t syncTime = 0; // time of last sync()

/*-----( Declare objects )-----*/
RTC_Millis rtc; /////RTC_DS1307 RTC; // define the Real Time Clock object
OneWire oneWire(ONE_WIRE_BUS_PIN);// Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature.

/*-----( Declare Variables )-----*/
DeviceAddress Probe01 = { 
  0x28, 0x5A, 0xB7, 0x00, 0x00, 0x00, 0x80, 0x6D };// Assign the addresses of your 1-Wire temp sensors. 
DeviceAddress Probe02 = { 
  0x28, 0x5C, 0xB7, 0x00, 0x00, 0x00, 0x80, 0xDF };// See the tutorial on how to obtain these addresses:
DeviceAddress Probe03 = { 
  0x28, 0x12, 0x6D, 0x73, 0x06, 0x00, 0x00, 0x27 };// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html
DeviceAddress Probe04 = { 
  0x28, 0xB2, 0xCB, 0x5E, 0x06, 0x00, 0x00, 0x39 };

/////////////Program Set-up/////////////////////////////////////////////////////////////////////

void setup(void){ /****** SETUP: RUNS ONCE ******/

  Serial.begin(9600);// start serial port to show results
  pinMode (REED, INPUT_PULLUP);  //Activate the internal pull-up resistor

  /////////////Setting up the file on the SD Card///////////////////////////////

  Serial.println("Initializing SD card...");
  pinMode(10, OUTPUT);  // make sure that the default chip select pin is set to output


  if (!SD.begin(chipSelect)) {  // see if the card is present and can be initialized:
    Serial.println("Card failed, or not present");
  }
  Serial.println("card initialized.");  // create a new file

  char filename[] = "WEATHER STATION-B. TOBIN / A. CACHINERO";      //The file names must be in the 8.3 format
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE); 
      break;  // leave the loop!
    }
  }

  if (! logfile) {
    Serial.println("could not create file");
  }

  Serial.print("Logging to: ");
  Serial.println(filename);

  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
  /////rtc.adjust(DateTime(2015, 7, 7, 12, 40, 0));

  Serial.println("Rainfall, Reading/count, date, time");
  logfile.println("Rainfall, Reading/count, date, time"); 

  //Serial.begin(9600);
  Serial.print("Initializing temp. sensors");
  Serial.println("Reading 4 probes");


  sensors.begin();// Initialize the Temperature measurement library


  sensors.setResolution(Probe01, 10);// set the resolution to 10 bit (Can be 9 to 12 bits .. lower is faster)
  sensors.setResolution(Probe02, 10);
  sensors.setResolution(Probe03, 10);
  sensors.setResolution(Probe04, 10);


}//--(end setup )---


///////////////////The Program Loop//////////////////////////////////////////////////////////////////////
void loop(){ //****** LOOP: RUNS CONSTANTLY ******/


  DateTime now = rtc.now(); /////DateTime now;    // and record date/time of change

  val = digitalRead(REED);


  if ((val == LOW) && (old_val == HIGH))//Low means that the Reed switch is open (which happens when the magnet passess).

  {
    delay(10);    // Delay put in to deal with any "bouncing" in the switch.

    char buf1[50];

    Serial.print("Precipitation");
    Serial.print("= ");
    REEDCOUNT = REEDCOUNT + 10;
    old_val = val;

    Serial.print(REEDCOUNT);
    Serial.print(" mm of rain at ");

    sprintf(buf1, "%02d:%02d:%02d of %02d/%02d/%02d",  now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());
    Serial.println(buf1);

    logfile.print("Precipitation");
    logfile.print("= ");
    logfile.print("Precipitation");
    logfile.print(". ");
    logfile.println(buf1);


  }
  else {
    old_val = val; //If the status hasn't changed then do nothing
  }

  if ((millis() - syncTime) < SYNC_INTERVAL) return;
  logfile.flush();
  syncTime = millis();

  {
    //delay(1000);
    Serial.println();
    Serial.print("Number of Devices found on bus = ");  
    Serial.println(sensors.getDeviceCount());   
    Serial.print("Getting temperatures... ");  
    Serial.println();   


    sensors.requestTemperatures();  // Command all devices on bus to read temperature 

    Serial.print("Probe 01 temperature is:   ");
    printTemperature(Probe01);
    Serial.println();

    Serial.print("Probe 02 temperature is:   ");
    printTemperature(Probe02);
    Serial.println();

    Serial.print("Probe 03 temperature is:   ");
    printTemperature(Probe03);
    Serial.println();

    Serial.print("Probe 04 temperature is:   ");
    printTemperature(Probe04);
    Serial.println();

  }

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/
void printTemperature(DeviceAddress deviceAddress)
{

  float tempC = sensors.getTempC(deviceAddress);

  if (tempC == -127.00) 
  {
    Serial.print("Error getting temperature  ");
  } 
  else
  {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}// End printTemperature

Reading at serial monitor.pdf.pdf (232 KB)

Acachinero:
The SD card in working when applying the examples you are mentioned but it is not retaining the same info I get when I read at the serial monitor.

OK, if the examples work, then your card is connected correctly and it's working.

I think I should add something on the sketch but I do not know where because it is doing what I want when I chech the reading at the serial monitor.

I think you need to start REMOVING things from your sketch. We know your SD card is working, but your large complicated sketch cannot successfully use the SD card. This means there may be a problem with some part of your sketch.

Start commenting out chunks of code until the SD card is working.

You want to find out which chunk of code makes the SD card not work. Once you know that, you can start commenting out smaller pieces. You should be able to end up with a single line of code that makes the SD card fail.

At this point, if you don't know how to fix it, ask us again.

Another approach is to start over. Write a sketch that initializes the SD card. Then add code that opens a file. Then add code that writes to the file. Then add code that reads a sensor. Etc, etc. At some point, the SD card might fail, so the last thing you added made it fail. If you end up with a working sketch that does everything you want, then congratulations! Now you can compare the two sketches if you want to see if you can figure out what was wrong with the first one. Or just delete the first one and get on with your life :slight_smile:

I attach a printed screen of the serial monitor reading and the matching sketch.

I notice that the screen shot and the attached sketch don't match. The screen shot shows filename = "LOGGER00.CSV", which should work. The code shows it being set to a very long string, which will NOT work. File names on SD cards need to be in 8.3 form, or a maximum of 12 characters (not counting the null character that terminates the string, which would make it 13 characters).

Hi Gdunge, thanks for your answer. After few days attempting to solve this issue I see myself on the need of writing to you again:

I have been removing parts of the sketch one by one but it seems that I do not need to remove anything because I am just getting it worse and worse. I think that I need to add some code on the SDcard section which makes the data keep recording into it.

I need to keep all the sections of my sketch to get combined the rain gauge, temp. sensors and SDcard with the RTC. I know it is a complicated sketch, however it makes my project works without subtracting any code.

I think I need to add something into this part of the sketch

char filename[] = "LOGGER00.CSV";
 for (uint8_t i = 0; i < 100; i++) {
  filename[6] = i/10 + '0';
  filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE); 
    break;  // leave the loop!
    }
  }

  if (! logfile) {
    Serial.println("could not create file");
  }

  Serial.print("Logging to: ");
  Serial.println(filename);

It might be something related with

uint8_t r = card.init(SPI_HALF_SPEED);

so that I have tried to install SdFat library and to add this part of code from GitHub but after uploading to my library it says that the file does not contain a valid library.
The only thing that the SDcard creates is an excel sheet with a single row where only appears the rainfall data (just mm of rain) with either no time or temperature data.

Thank you.

My SD card sketch is very simple.

#include <SD.h>


const int chipSelect = 4;

Sd2Card card;

void setup()
{
    Serial.begin(9600);

 
    while (!Serial) 
    {
        ; // wait for serial port to connect. Needed for native USB port only
    }

    Serial.print("Initializing SD card...");

    // see if the card is present and can be initialized:
     if (!SD.begin(chipSelect)) {
        Serial.println("Card failed, or not present");

        // don't do anything more:
        return;
    }

    Serial.println("card initialized.");

}

void loop()
{

    File myFile = SD.open("Data.txt", FILE_WRITE);

    if (myFile)
    {
        for (int i = 0; i < 101; i++)
        {
            myFile.print(i);
            myFile.print(" multiplied by two is ");
            myFile.println(i * 2, DEC);
        }

        Serial.println("Finished");
        myFile.close();
    }
    else
    {
        Serial.println("Error opening Data.txt");
    }

    //do nothing else
    do 
    {
        
    }
    while(1);

}

For you, since you want a CSV file,
you will want to change

            myFile.print(i);
            myFile.print(" multiplied by two is ");
            myFile.println(i * 2, DEC);

to

            myFile.print(i);
            myFile.print(", multiplied by two is ,");
            myFile.print(i * 2, DEC);
            myFile.print(", multiplied by ten is, ");
            myFile.println(i * 10, DEC);

which will give you 5 columns

This is just an example

In setup you have

        // don't do anything more:
        return;

This will not stop processing but run loop directly (opening a file on the nonexistent SD).

Hey guys, thanks for your answer but i am afraid that your suggestions do not work on my sketch after trying different combinations.

I just need to get the temperatures lectures onto the SDcard.

/*-----( Declare Libraries )-----*/

#include <SPI.h>
#include <SD.h>          //Ensure that you downlaod these libraries and store them in your Arduino libraries folder 
#include <Wire.h>        //Remember no semi-colon after these commands
#include "RTClib.h"
#include <OneWire.h>
#include <DallasTemperature.h> //Get DallasTemperature Library here:  http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library

/*-----( Declare Constants and Pin Numbers )-----*/
const int REED = 9;     //The reed switch outputs to digital pin 9
int val = 0;            //Current value of reed switch
int old_val = 0;        //Old value of reed switch
int REEDCOUNT = 0;      //The intial count is zero

const int chipSelect = 10;
File logfile;
#define SYNC_INTERVAL 60000
#define ONE_WIRE_BUS_PIN 2
uint32_t syncTime = 0; // time of last sync()

/*-----( Declare objects )-----*/
RTC_Millis rtc; /////RTC_DS1307 RTC; // define the Real Time Clock object
OneWire oneWire(ONE_WIRE_BUS_PIN);// Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature.

/*-----( Declare Variables )-----*/
DeviceAddress Probe01 = { 
  0x28, 0x5A, 0xB7, 0x00, 0x00, 0x00, 0x80, 0x6D };// Assign the addresses of your 1-Wire temp sensors. 
DeviceAddress Probe02 = { 
  0x28, 0x5C, 0xB7, 0x00, 0x00, 0x00, 0x80, 0xDF };// See the tutorial on how to obtain these addresses:
DeviceAddress Probe03 = { 
  0x28, 0x12, 0x6D, 0x73, 0x06, 0x00, 0x00, 0x27 };// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html


/////////////Program Set-up/////////////////////////////////////////////////////////////////////

void setup(void){ /****** SETUP: RUNS ONCE ******/

  Serial.begin(9600);// start serial port to show results
  pinMode (REED, INPUT_PULLUP);  //Activate the internal pull-up resistor

  /////////////Setting up the file on the SD Card///////////////////////////////

  Serial.println("Initializing SD card...");
  pinMode(10, OUTPUT);  // make sure that the default chip select pin is set to output


  if (!SD.begin(chipSelect)) {  // see if the card is present and can be initialized:
    Serial.println("Card failed, or not present");
  }
  Serial.println("card initialized.");  // create a new file

  char filename[] = "LOGGER00.CSV";      //The file names must be in the 8.3 format
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE); 
      break;  // leave the loop!
    }
  }

  if (! logfile) {
    Serial.println("could not create file");
  }

  Serial.print("Logging to: ");
  Serial.println(filename);

  rtc.begin(DateTime(F(__DATE__), F(__TIME__)));
  /////rtc.adjust(DateTime(2015, 7, 7, 12, 40, 0));

  Serial.println("Rainfall, Reading/count, time, date");
  logfile.println("Rainfall, Reading/count, time, date"); 

  //Serial.begin(9600);
  Serial.print("Initializing temp. sensors");
  Serial.println("Reading 3 probes");


  sensors.begin();// Initialize the Temperature measurement library


  sensors.setResolution(Probe01, 10);// set the resolution to 10 bit (Can be 9 to 12 bits .. lower is faster)
  sensors.setResolution(Probe02, 10);
  sensors.setResolution(Probe03, 10);



}//--(end setup )---


///////////////////The Program Loop//////////////////////////////////////////////////////////////////////
void loop(){ //****** LOOP: RUNS CONSTANTLY ******/


  DateTime now = rtc.now(); /////DateTime now;    // and record date/time of change

  val = digitalRead(REED);


  if ((val == LOW) && (old_val == HIGH))//Low means that the Reed switch is open (which happens when the magnet passess).

  {
    delay(10);    // Delay put in to deal with any "bouncing" in the switch.

    char buf1[50];

    Serial.print("Precipitation");
    Serial.print("= ");
    REEDCOUNT = REEDCOUNT + 10;
    old_val = val;

    Serial.print(REEDCOUNT);
    Serial.print(" mm of rain at ");

    sprintf(buf1, "%02d:%02d:%02d of %02d/%02d/%02d",  now.hour(), now.minute(), now.second(), now.day(), now.month(), now.year());
    Serial.println(buf1);

    logfile.print("Precipitation");
    logfile.print("= ");
    logfile.print("10");
    logfile.print("mm at ");
    logfile.println(buf1);


  }
  else {
    old_val = val; //If the status hasn't changed then do nothing
  }

  if ((millis() - syncTime) < SYNC_INTERVAL) return;
  logfile.flush();
  syncTime = millis();

  {
    //delay(1000);
    Serial.println();
    Serial.print("Number of Devices found on bus = ");  
    Serial.println(sensors.getDeviceCount());   
    Serial.print("Getting temperatures... ");  
    Serial.println();   


    sensors.requestTemperatures();  // Command all devices on bus to read temperature 

    Serial.print("Probe 01 temperature is:   ");
    printTemperature(Probe01);
    Serial.println();

    Serial.print("Probe 02 temperature is:   ");
    printTemperature(Probe02);
    Serial.println();

    Serial.print("Probe 03 temperature is:   ");
    printTemperature(Probe03);
    Serial.println();

    

  }

}//--(end main loop )---

/*-----( Declare User-written Functions )-----*/
void printTemperature(DeviceAddress deviceAddress)
{

  float tempC = sensors.getTempC(deviceAddress);

  if (tempC == -127.00) 
  {
    Serial.print("Error getting temperature  ");
  } 
  else
  {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}// End printTemperature

Could anybody indicate me what i should add on my skecth? thanks

Reposting your original sketch isn't going to help.

We don't have your hardware.

With use of so many different libraries it would not surprise me that that some may be be conflicting. So unless you are able to figure out how to troubleshoot by removing parts of your code until you achieve a sketch that works, you are out of luck.

Hi, it's not the original code as this one has only 3 temperatures probes installed!
I said before I can't remove any line from the code! The libraries makes the project work as I want! I've been trying many different combinations but icant figure out how get the temperatures recorded as the rain gauge does!
Anyone polite have any suggestion? Thanks

Acachinero:
The libraries makes the project work as I want!

If you have a program that works as you want, where is the problem?

im not pretending to create a conflict in here! What I meant saying that the project works asi want it's because the serial monitor does what I want! It just the sd card which does not keep the temp!
D. Adams, u shouldn't bother in reply again unless u provide something fruitful apart from what U pretend!

Your welcome!

Whandall:
Your welcome!

You snarkyness when right over his head. Don’t poke the Bear.

Acachinero:
im not pretending to create a conflict in here! What I meant saying that the project works asi want it’s because the serial monitor does what I want! It just the sd card which does not keep the temp!
D. Adams, u shouldn’t bother in reply again unless u provide something fruitful apart from what U pretend!

Acachinero,
You have identified you problem as ‘My program does not write the SDCard’.

Write a simple sketch that verifies your hardware actually works. Write a sketch (maybe use the SD examples that are part of the Arduino environment as a base), to test the SD function.

If that works, then you know it is a software issue.

A lot of first time Arduino SD users encounter memory size issues. The Arduino Uno only has 2048 bytes of RAM. and 32k of FLASH( program storage).

Here is a good explanation by Robert Getzner. He documents his trials using SD cards.

Chuck.