The Arduino serial monitor is usable when you want to watch data from an Arduino. However, it does not have a built-in method for saving the data. Here are some ideas if you want to build an Arduino data logger with or without a PC.
Important note on Arduino Data Logger examples
With all of these examples, please remember that whenever you open the Arduino’s serial port, the board will reset. So if your log file shows “Initializing SD card…” with a few data lines in between, it is because there is a reset happening.
Initializing SD card…initialized. Temp: 34, Time: 03:24:44 Temp: 33, Time: 03:24:45 Temp: 34, Time: 03:24:46 Tem Initializing SD card…initialized. Temp: 34, Time: 03:24:50 Temp: 34, Time: 03:24:51 Temp: 33, Time: 03:24:52 Temp: 34, Time: 03:24:53
In that code you can see data logging started and then restarted. What happened is that after programming, the board starts logging. Then when you open the Serial Monitor, the data logger restarts.
To solve this issue, either disable auto-reset, add a 3-4 second delay at the start of setup(), wait for a character to be received, or wait for a button press. That will give you time to open the Serial Monitor.