Sending Data From Arduino to Excel (and Plotting It)

282,707

827

68

I've searched extensively for a way that I could plot my Arduino sensor reading in real time. Not only plot, but also display and store the data for further experimentation and corrections.

The simplest solution I’ve found was to use excel, but with a twist.

Also if you find this instructable interesting, perhaps you'll like another one I've made (about displaying live Arduino sensor readings on a Nokia 5110 LCD):

https://www.instructables.com/id/Arduinonokia-lcd-...

Step 1: What You'll Need

For this you will need:

-Windows (tested on xp)

-Arduino IDE

-Microsoft office (tested on 2010)

-PLX-DAQ (expansion for excel)

-Arduino (tested on UNO, but any board should work)

I am assuming that you’ve already got an Arduino, Windows, Arduino IDE and Excel. Here’s the link to download PLX-DAQ:

https://www.parallax.com/downloads/plx-daq

You only need to download and install it, it should work fine. After installation, it will automatically create a folder named PLX-DAQ on your Desktop in which you will find a shortcut named PLX-DAQ Spreadsheet.

When you want to use your Arduino to send data to excel, just open up the shortcut.

Step 2: Arduino Part

Now that we’ve got all that downloaded and installed, let’s start with the Arduino part.

Here’s a basic template I created that will display the time in column A and your sensor measurements in column B.

Of course, this is just a basic template, which is pretty straight forward and you can tweak it to suit your needs.

I’ve added explanations in the Arduino code so you (and I, after not working with it for a while) know which part of the code does what.

Here’s the sketch:

//always starts in line 0 and writes the thing written next to LABEL

void setup() {

Serial.begin(9600); // the bigger number the better

Serial.println("CLEARDATA"); //clears up any data left from previous projects

Serial.println("LABEL,Acolumn,Bcolumn,..."); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)

Serial.println("RESETTIMER"); //resets timer to 0

}

void loop() {

Serial.print("DATA,TIME,TIMER,"); //writes the time in the first column A and the time since the measurements started in column B

Serial.print(Adata);

Serial.print(Bdata);

Serial.println(...); //be sure to add println to the last command so it knows to go into the next row on the second run

delay(100); //add a delay

}

Obviously if you upload this code, it won’t work on it’s own!

You need to add a formula for Adata, Bdata and … . This template is just for reference so you know how to use the program. Just add Serial.read() function, name it Adata, Bdata and … and it should work.

Step 3: Sending the Data to Excel

Of course PLX-DAQ has more functions, which you can explore on your own by reading the instructions in the rar folder that you downloaded.

If you want excel to graph your data but can’t be bothered to read the instructions, here’s a short version of what you can do:

-use the (modified) code from my instructable

-connect your Arduino as you normally would

-DO NOT OPEN THE SERIAL MONITOR in Arduino IDE, it will not work with excel if you do

-open the shortcut to your PLX-DAQ Spreadsheet

-excel will say “This application is about to initialize ActiveX…”, just click OK

-a new window named Data Acquisition for Excel will appear

-select the usb port your Arduino is connected to (if it doesn’t work at first, go through the list of ports)

-where it says Baud, just select the number you put in your code at Serial.begin(), in my case that would be 9600

-create an empty graph

-select which columns of data you want on the graph for the x and y axis (the way to do this is a little different depending on your version of excel, but it’s not too hard to figure out)

-click collect data on PLX-DAX and it should start collecting the data

-excel will plot the information as it gets sent from the Arduino to excel in real time

Depending on how precise you want your graph to be, you can change the characteristics of the graph. You can closely examine a section of the graph by shutting down data collecting, right click on the x or y axis and set it to a smaller frame. (normally it’s set to automatic)

You can also right click on the curve that connects the points on your chart and select the color and thickness of the curve.

That’s it for the basics. I hope I’ve helped a few of you out by writing this. I know it took me quite some time to find this and to get it working.

P.S.
If you liked this instructable, perhaps you'll like another one I've made: https://www.instructables.com/id/Arduinonokia-lcd-d...

If you enjoyed this Instructable, consider visiting my Fundrazr page here. And of course, share.

10 People Made This Project!

Recommendations

  • Pets Challenge

    Pets Challenge
  • Backyard Contest

    Backyard Contest
  • Colors of the Rainbow Contest

    Colors of the Rainbow Contest

68 Discussions

0
None
fred1896

7 weeks ago

Hello all, just wanted to point out that if anyone is thinking of using this instructable but they realised that PLX-DAQ only supports older versions, there is another version by someone else that (I think) works with windows 10 etc, though i dunno really 'coz the forum was written in 2015 (but comments were saying something 'bout windows 10 so it prob'ly still works) or something and I haven't actually tried it myself but i thought that might be useful......

0
None
HelloImaGirl

Question 2 months ago on Introduction

Does this method work if we are trying to record down moisture of the soil?

0
None
rmetzner49

1 year ago

Not sure what to say ... the App doesn't support COM ports > 15, so it's not very useful for Arduinos that use higher numbers. My ESP32-Dev uses COM33 and 115,200 baud, neither of which are supported by PLX-DAQ.

1 reply
0
None
garzormetzner49

Reply 6 months ago

Do you know that you can change the COM number of your device in the control panel? Also the baudrate can be changed.

0
None
SAAEEDA

Question 7 months ago

How do I collect reading from 200 probes, this one have only 26?

0
None
glj1946

Question 10 months ago

PLX-DAQ throws an error. I am using MS Office 2010 on a Windows 10 laptop. Where do I get the object that is missing on my computer?

PLX-DAQ error.jpg
0
None
Ghostrider513

12 months ago on Introduction

Doesn't work. Win 10 and Excel 2010 doesn't recognize PLX-DAQ Spreadsheet

0
None
SeanY27

2 years ago

I need some help! I'm making a temperature logger using an arduino yun board and the DS18B20 digital thermometer. I'm new to arduino so any help is greatly appreciated. The data doesn't seem to move over to the excel file, or if it does, it gets stuck on the first row.

#include <OneWire.h>

#include <DallasTemperature.h>

// Data wire is plugged into pin 2 on the Arduino

#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices

// (not just Maxim/Dallas temperature ICs)

OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.

DallasTemperature sensors(&oneWire);

void setup(void)

{

// start serial port

Serial.begin(9600);

Serial.println("CLEARDATA");

Serial.println("LABEL,Current Time,Temp");

sensors.begin();

}

void loop(void)

{

// call sensors.requestTemperatures() to issue a global temperature

// request to all devices on the bus

Serial.print("DATA,TIME"); //Capturing Local Time

int TempVal = sensors.getTempCByIndex(0);

sensors.requestTemperatures(); // Send the command to get temperatures

Serial.print("TempVal");

Serial.print("");

// You can have more than one IC on the same bus.

// 0 refers to the first IC on the wire

delay(1000);

}

1 reply
0
None
PedroA173SeanY27

Reply 1 year ago

Through a rapid checkout of your code, I can see a few thinks that are just NO OK.

Instead of

Serial.print("DATA,TIME");

You should tipe

Serial.print("DATA,TIME,");

In order to fully understand the meaning of that comma you should read the PLX-DTQ. It pretty short and quite useful.

Then, instead of

Serial.print("TempVal");

Serial.print("");

Just type:

Serial.println("TempVal");

Again, to understand that carriage return, refer to the PLX-DTQ helpfile.

0
None
adtu

1 year ago

Im having issues in printing all the values in excel through my MPU6050.Please help.

0
None
redux490

1 year ago

Hi,

I am trying to get a 2nd piece of data to read of it, but for some reason I only can see the temperature.

Is there something I am missing?

Thank you in advance

Naamloos.png
0
None
Micle84

1 year ago

Has any one created code to send data from Arduino to Numbers (Mac version of excel)?

0
None
sekramer10

1 year ago

Is it possible to use the SET and GET commands with an Arduino variable for an arbitrary excel address? For example:

Serial.println("CELL, GET, FROMHEET, AnySheet, C, 9”);

would be something like :

Serial.println("CELL, GET, FROMHEET, AnySheet, ExcelColumn, ExcelRow”);

?

0
None
Glitter_Country

2 years ago

Excel(2016) will stop working shortly after I connect. What can I do about this?

0
None
FitriF6

2 years ago

can i use it with windows 10 ?? I really need it.. huhu

2 replies
0
None
RanenMFitriF6

Reply 2 years ago

Hi, did you ever find a solution for windows 10?

0
None
AhsanK18

2 years ago

i have problem when i fixed the code the problem created the "serial was decleaed a scope " how should i fix it ?