Best Approach for Data Logging Using Arduino

I am pretty new to the field and have a question about data logging using Arduino. If I want to save a series of Arduino outputs into csv or excel format, there seems to be two approaches: (1) use the SD.h library and save directly into a SD card or (2) print outputs in the serial monitor and copy and paste into excel at the end of the test.

I am wondering which one is a better way to go in terms of processing speed and robustness? Also, is there another way that is better than both of the approaches I mentioned?

Thanks a lot!

It depends on the use case. How much data data should be logged and how often? Should you device be autonomous or connection to a desktop is OK? etc

The best way is to use a Mini SD Card shield and log all of your data in the SD card in .txt or .csv format. It will be quick, auto generated and free from errors, so that looks like the best way.

Thanks for the response guys!

alesam - I am logging the data at around 100Hz for around 10 minutes. The device is connected to a laptop.

How much data your logging per each sample?

For each sample, I am logging 9 unsigned long variables.

I'd start from using a serial port top transfer data. You can set it up serial speed to 250000 or even higher.

yichuj:
there seems to be two approaches:(1) use the SD.h library and save directly into a SD card or (2) print outputs in the serial monitor and copy and paste into excel at the end of the test.

or a third: (3) record directly to the PC hard drive in .CSV format, using a proper terminal programme, or perhaps (4) recording directly to Excel, using the PLX macro.

Since you imply you are connected to the PC, I can't see the point of using an SD card on Arduino.

By proper terminal, I mean RealTerm, or similar, all of which are free. I don't know anything about recording at that speed, but I suspect an on-board SD would be the slowest means. I heard rumour that the latest version of the IDE allows you to record via its Serial Monitor.

I think I have gotten a grasp on this. Thanks a lot guys!