Logging Arduino Serial Output to CSV/Excel (Windows/Mac/Linux)

20 kg load cell
Written by Indrek Luuk

I have written a plug-in for Arduino IDE to save serial data as a CSV file that you can open in any spreadsheet application - like Microsoft Excel or LibreOffice.

Download:
ArduSpeadsheet Arduino IDE plug-in

Video Tutorial

In this video, I will show you how to install and use the plug-in.

Installation

Extract the zip file and copy the "ArduSpreadsheet" folder into your Arduino "tools" folder next to the Arduino "libraries" folder. If it doesn't exist, then you can create it yourself.

On Windows:
C:\Users\<username>\Documents\Arduino\tools
On Mac:
/Users/<username>/Documents/Arduino/tools
ArduSpeadsheet in Arduino 'tools' folder

Now restart your Arduino IDE, and you should see "ArduSpreadsheet" under the "Tools" menu.

ArduSpreadsheet in the Arduino IDE tools menu

Arduino code

You can use the Arduino Serial library to send data for logging.

The baud rate parameter has to match with the selection in the ArduSpreadsheet window.

void setup() {
  Serial.begin(9600);
}
ArduSpeadsheet Arduino IDE plug-in
For column separation, you can pick one of the three symbols:
  • tab - '\t'
  • comma - ','
  • semicolon - ';'

You can indicate the end of the row by calling "Serial.println()" or printing out a newline symbol '\n'.

Example

int rowCount = 500;
int rowNumber = 0;

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

void loop() {
  if (rowNumber < rowCount) {
    Serial.print(++rowNumber);
    Serial.print('\t');
    if (rowNumber % 2 == 0) {
      Serial.print("even\t");
    } else {
      Serial.print("odd\t");
    }
    Serial.println(random(16000), HEX);
  }
}

The above code will produce this result:

ArduSpeadsheet Arduino IDE plug-in

Running ArduSpreadsheet as a stand-alone program

To run it as a stand-alone program, you need to install Java 1.8 or newer.

I have included execution scripts for Windows, Mac, and Linux (all they do is execute the Main method inside ArduSpreadsheet.jar).

On Windows

Double-click on the "Windows_ArduSpreadsheet.bat." You may get a warning that you are executing an unrecognized app.

ArduSpreadsheet in the Arduino IDE tools menu

Click on "More info" and then "Run anyway."

ArduSpreadsheet in the Arduino IDE tools menu

On Mac

To get it running on Mac, you first need to give execution privileges to the script file.

Open Terminal application and "cd" into the "ArduSpreadsheet" folder. Now execute:
$ chmod a+x Mac_ArduSpreadsheet.command

Then double-click on the "Mac_ArduSpreadsheet.command."

Mac OS will warn that the application is from an unknown developer.

ArduSpeadsheet Arduino IDE plug-in

Open "System Preferences..." and then "Security & Privacy."

You should see:
"Mac_ArduSpreadsheet.command" was blocked from use because it is not from an identified developer.
ArduSpeadsheet Arduino IDE plug-in

Click "Open Anyway" and then "Open"

ArduSpeadsheet Arduino IDE plug-in

Now you can Open ArduSpreasheet by double-clicking on the "Mac_ArduSpreadsheet.command."

On Linux

Open Terminal application and "cd" into the "ArduSpreadsheet" folder. Now execute:
$ chmod a+x Linux_ArduSpreadsheet.sh

Now you should be able to run the application by either executing the script from the command line or double-clicking on the "Linux_ArduSpreadsheet.sh."