How to Save Arduino Serial Data in TXT, CSV, and Excel File

Hi everyone! Welcome to my blog, where today we’re diving into an essential topic for those working with Arduino: logging serial data efficiently. I’ll be guiding you through logging serial data into CSV or text files using a nifty tool called Cool Term. Let’s get started!
Why Log Serial Data?
When you’re undertaking a project involving Arduino, logging serial data is crucial. Whether you’re debugging an issue, analyzing data trends over days, or just need to keep a history of what’s been happening, logging data in a readable format like TXT or CSV is invaluable.
Unfortunately, the default Arduino serial terminal doesn’t directly allow saving data into these formats. However, there are other ways around this, and I’ll show you how!
Getting Started with Arduino and Serial Data
First things first, ensure you have your Arduino set up correctly and your sketch uploaded. If you’re here, I assume you have some familiarity with Arduino. If not, there are plenty of resources that cover the basics.
// Sample Arduino sketch for demonstrationvoid setup() {Serial.begin(9600);}void loop() {Serial.println("This is test data.");delay(1000);}
Once you have your sketch running on your Arduino, you can open the serial terminal to see the data being printed. Here’s where we face the issue—this data isn’t easily exported in a usable format directly from the Arduino IDE.
Introducing Cool Term

To circumvent this limitation, we utilize a software called Cool Term. What’s so great about Cool Term? Well:
- No Installation Needed: It’s a portable application, meaning you just need to download and extract it.
- Data Logging: Allows for easy capture of serial port data into text or CSV files.
- Real-Time Data Display: See your data populate in real-time, much like the Arduino Serial Monitor.
Downloading and Setting Up Cool Term
- Download Cool Term from the official website. Make sure to get the Windows version if you’re on a Windows machine since that’s what I’m using for this tutorial.
> Cool Term is available for Windows, macOS, and Linux. - After downloading, extract the files. Being a portable application, there’s no installation process involved.
- Open Cool Term. You’ll be greeted with a straightforward interface.
Configuring Cool Term for Data Logging
Before we capture data, ensure the Arduino IDE serial terminal is closed. Cool Term can’t access the data if another program is using the serial port.
Step-by-Step Configuration
- Select the Serial Port:
- Click on the “Options” button.
- Under “Serial Port Selection,” choose the correct port. Typically, Arduino is connected via “COM” ports (e.g., COM4 on Windows).
> **Note:** Make sure to check your Device Manager if you're unsure of which COM port your Arduino is connected to. - Set Baud Rate:
- Ensure the baud rate matches your Arduino sketch (9600 in our example).
- Start Data Capture:
- Navigate to “Connection” and select “Capture to Text/Binary File.”
- Choose to start capturing, and you’ll be prompted to save your file. For clarity, save as a
.txtor.csv.
- Connect and Capture:
- Click “Connect” in Cool Term. Your data should start populating and saving to the file in real-time.
Working with Data Files

Now that your data is saved, it’s time to explore its potential in applications like Excel, which is great for data visualization.
Opening Data in Excel
- Open Excel and navigate to “File” > “Open.”
- Browse for your saved
.txtor.csvfile. - Import Data:
- Ensure to select the option for “Delimited” data.
- Specify the delimiter used when saving the file (commonly a comma for CSV files).
> Excel will guide you through interpreting your data, making it easy to visualize and analyze.
Generating Graphs
Excel provides simple tools to create graphs from your data. Here’s how to get started:
- Highlight your data columns.
- Navigate to “Insert” > “Recommended Charts” or choose a specific chart style.
- Customize your chart to emphasize your data insights.
Alternative Methods for Real-time Viewing
While Cool Term is excellent, for those who prefer different interfaces, Sublime Text can be used to see real-time updates of captured data.
Using Sublime Text for Real-time Data Viewing
- Open the saved data file (.txt or .csv) in Sublime Text.
- With the file open, new data captured by Cool Term will automatically update the document.
Final Thoughts
Cool Term is a robust tool for logging serial data, offering flexibility and ease of use without unnecessary installations. Whether you’re debugging or just keeping track of a project, capturing your Arduino data efficiently is an indispensable skill.
Key Points to Remember
- Ensure your Arduino IDE serial terminal is closed before using Cool Term.
- Accurate baud rate settings are crucial for proper data capturing.
- Alternatives like Sublime Text can enhance your workflow if you have specific preferences.
As you further your projects and explore data logging, I hope this guide serves as a solid foundation. If you have questions or suggestions, feel free to get in touch.