How To Save Arduino Serial Data in TXT, CSV and Excel File Without Using Data Logger Shield - Vidyasagar Academy Akola
How To Save Arduino Serial Data in TXT, CSV and Excel File Without Using Data Logger Shield - Vidyasagar Academy Akola
Click here to register for summer batches of robotics. Click here for details of courses.
₹0.00
The use of data logger shield in Arduino is rather critical and everyone may not have
the data logger shield readily available to create the log of readings in Arduino.
So this article explains how to save Arduino Serial data in TXT, CSV and Excel file
without using data logger shield?
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 1/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Also refer our Arduino Tips & Tricks and Arduino Tested Projects. Download all
Library Files and Fritzing Parts file for better study with Arduino.
Now suppose we have create log of real time temperature and humidity, using DHT11
sensor with Arduino. For that we will use a simple code, as follows.
Contents [ show ]
/*
* Code for the article:
* How to save Arduino Serial data
* in TXT, CSV and Excel file
* without using data logger shield?
* Vidyasagar Academy, Akola
* www.vsa.edu.in
*/
#include <dht.h>
void setup()
{
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 2/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Serial.begin(9600);
}
void loop()
{
readdata = DHT.read11(output);
Serial.print(Temperature);
Serial.print(",");
Serial.println(Humidity);
Note: To run this code in Arduino IDE you will need DHT library. You can download it
from this link. To add the downloaded zipped file, open Arduino IDE and click on
“Sketch” menu. Then go to “Include Library” and then click on “Add .Zip Library, as
shown below.
It is important to note the following piece of code used to print the Serial data. This is
because we have to import the Serial data with comma delimited values in Excel file.
Serial.print(Temperature);
Serial.print(",");
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 3/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Serial.println(Humidity);
The first line in above code prints the “Temperature” value and the second line puts a
comma (,) after the Temperature value.
Then the third line prints “Humidity” value. Since we used Serial.println() in this third
line, due to carriage return, the next two values will be printed in next line and so on…
1. Download CoolTerm data logger software from this link (File size: 20MB).
2. After downloading, unzip the file and copy the folder inside the zip file on your
PC.
3. Open the folder and right click on CoolTerm.exe icon and create desktop
shortcut on your PC.
4. Now connect your Arduino board through data cable to your PC and upload the
code in Arduino UNO or Arduino nano.
5. Do not open Serial Monitor or Serial Plotter. Just note down the COM port to
which your Arduino is connected to. In my case, it is connected to COM3 port.
6. Now open CoolTerm application.
7. Click on “Options” menu and then click on “Port”. This field should show you the
COM port number to which your Arduino is connected to. Then click OK. Here I
am using the Baudrate as 9600.
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 4/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 5/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
9. Now a new window will open where you have write the name of the file.
10. Finally click on “Connect” button of CoolTerm application to start recording the
data entries in the text file, as shown below.
11. Once you have sufficient data entries, click on “Connections”, go to “Capture to
Text/Binary File” and click on “Stop”.
12. Then click on “Disconnect” button.
13. This will complete data logging process.
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 6/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
2. Now open Microsoft Excel and click “Open” in its menu. Then click on “All files”
in bottom right corner as shown below and select “Text Files (*.prn, *.txt, *.csv)”.
3. Now it will show you your text file generated by CoolTerm. Select the file and
click “Open”.
4. This will open text import wizard.
5. Select “Delimited” button and then click “Next”.
6. Now as shown below, deselect “Tab” option and select “Comma” option, then
click “Next”.
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 7/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
7. Finally click “Finish” and now your TXT file will be converted into two columns in
Microsoft Excel table, as shown below.
1. Since your data entries are imported into MS Excel in two columns, you can
now create graph of the entries.
2. Insert one row above the data entries and give headings to the two columns as
Temperature and Humidity, as shown below.
3. For that click on “Insert” menu and then select “Line” graph option.
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 9/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Just ignore all above methods and let us see the simplest possible method, as given
below.
27, 22
27, 22
28, 20
27, 23
29, 20
30, 21
29, 20
28, 20
28, 21
29, 20
29, 20
4. Now copy these readings from Serial Monitor and paste them in
a filename.txt file.
5. Then import this .txt file in MS Excel.
6. Create a header row and give labels to the two quantities like Temperature &
Humidity.
7. The click on “Data” tab in MS Excel and import your .txt file with “Comma
delimited” style, as shown below.
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 10/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Tags
Dattaraj Vidyasagar
PREVIOUS POST
NEXT POST
How analog pin works & how
AR-B8: Servo Motor Basic
PWM signal is obtained in
Code
Arduino UNO/Nano?
Leave a Reply
Logged in as waste mail. Edit your profile. Log out? Required fields are marked *
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 11/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Add Comment *
Post Comment
Search
Search
Courses
Want to design custom & low cost website? We build beautiful Personal
Websites and Educational Websites with .edu domain. Contact us with your
requirements.
Contact
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 12/13
6/20/24, 11:52 AM How to save Arduino Serial data in TXT, CSV and Excel file without using data logger shield? - Vidyasagar Academy Akola
Address: About Us
Copyright © 2024 - Vidyasagar Academy, All rights reserved. Designed by: Prof. Dattaraj
Vidyasagar
https://vsa.edu.in/how-to-save-arduino-serial-data-in-txt-csv-and-excel-file-without-using-data-logger-shield/?nsl-notice=1 13/13