Several questions about datalogging project

I am trying to create a special datalogger for reading tiny amounts o voltage diff,
however i have 2-3 questions about the datalogging problem.

first: i want to create several logs in the form of

//Open the Data CSV File
  File dataFile = SD.open("test.txt", FILE_WRITE);

test1,
test2,
etc
i have tried

 File dataFile = SD.open("test"+String(k)+".txt", FILE_WRITE);

but it's not working

second:
The dates on my output
all the text file on the Sd card are dated 1/1/2000
[file:///C:/Users/nerito/Pictures/arduino.jpg/img]

third :
any ideas how to uses floats on sd?

thank you in advance

arduino.jpg

lomanas123:
I am trying to create a special datalogger for reading tiny amounts o voltage diff,
however i have 2-3 questions about the datalogging problem.

first: i want to create several logs in the form of

//Open the Data CSV File

File dataFile = SD.open("test.txt", FILE_WRITE);



test1,
test2,
etc
i have tried 


File dataFile = SD.open("test"+String(k)+".txt", FILE_WRITE);



but it's not working

Couldn't you just go

      myFile = SD.open(filename, FILE_WRITE);
  myFile.print(test1);
  myFile.print(",");
  myFile.print(test2);
  myFile.print(",");

etc

second:
The dates on my output
all the text file on the Sd card are dated 1/1/2000
[file:///C:/Users/nerito/Pictures/arduino.jpg/img]
[/quote]

Your Arduino has no idea what the date is and I guess the 1/1/2000 is just windows putting a name to nothing.
Your best bet is to get a real time clock and use that to name your files according to date and time. I record the time in the data and just use the date for the filename - 20130218.csv

third :
any ideas how to uses floats on sd?

Just declare your variable as a float and myfile.print them to SD.

Just declare your variable as a float and myfile.print them to SD.

I was so used of converting everything to String that i didn't thought it
So thanks!!

In the otherhand the other two answers didn't not help because:

myFile = SD.open(filename, FILE_WRITE);
  myFile.print(test1);
  myFile.print(",");
  myFile.print(test2);
  myFile.print(",");

i don't want to write something different i want to give different filename!

For the date i have to find a way to change it automatically...

Thanks in advance!

you can use sprintf to print to a char array.

something like sprintf(filename, "test_%02d.csv", k); google for exact syntax.

That's a good idea, it worked and it is a clever one.

thanks.

Now anybody has an idea how to time the measuraments?

I thought sprintf() doesn't work ?

If you want to know the time of your recordings, you are going to need to get a real-time-clock module,
about $3 from ebay plus a little battery.

sprintf()
works correct
for char[];

about the time module have you got any suggections?
what to buy i mean

have bought four of these.

http://www.ebay.com.au/itm/270985342203?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

How cn you go wrong at $2-36 incl postage?

Hi,
I'm learning Arduino RTC, too.

There seems to be 2 ways to go:

a) DS1307: communication= I2C-bus, cheap, probably the right way to go, Nick's l
link is to one of these.
b) DS3234: communication = SP-bus, more accurate, more money...

There are Arduino libraries for both, maybe I2C is more easy?

Anyone knows and can suggest any external low noise ADC for arduino?

Today I got one of these - Search Results for 'ads1115' on Adafruit Industries -
not tested, not even read the datasheet, but it is capable of a few 100 samples @16 bit per second.
at 16 bits I expect low(er) noise

at least it is an external one :wink:

thanks but since i am in europe i can't order from adafruit and the ADC you suggested is the smallest i have ever seen. I will never be cable of soldering it

Hi,
for filedate/time google for something like this,I think it´s somewhere in the Fat16 Libs examples

/*
 * User provided date time callback function.
 * See Fat16::dateTimeCallback() for usage.
 */
void dateTime(uint16_t* date, uint16_t* time) {
  // User gets date and time from GPS or real-time
  // clock in real callback function
  
  // return date using FAT_DATE macro to format fields
  *date = FAT_DATE(year, month, day);
  
  // return time using FAT_TIME macro to format fields
  *time = FAT_TIME(hour, minute, second);
}

Just in case you have your arduino connected to a PC, you can set the date/time via serial. Of course not possible, if your arduino is not connectd.
Best, Robert