Introduction: Sending Data From Arduino to Excel (and Plotting It)

Picture of Sending Data From Arduino to Excel (and Plotting It)

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

Picture of 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

Picture of 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...

Comments

adtu (author)2017-10-19

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

redux490 (author)2017-09-24

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

Micle84 (author)2017-09-17

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

sekramer10 (author)2017-08-27

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”);

?

Glitter_Country (author)2017-05-20

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

FitriF6 (author)2016-06-28

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

RanenM (author)FitriF62017-04-25

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

bogiva (author)RanenM2017-05-18

https://forum.arduino.cc/index.php?topic=437398.0

there u go my friend, somebody on the arduino community modify it so it is compatible with 64 bit system and newer version of Windows/ms office

AhsanK18 (author)2017-04-30

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

BallscrewBob (author)2017-04-22

The version from Parallax has been updated by a user in the Arduino forum

http://forum.arduino.cc/index.php?topic=437398.0

It is easier and fixes the COM limitations of the Parallax version.. Took me about 15 minutes to get it running data into a live graph

Mahmoud Adel (author)2017-02-24

I have that problem

when I open PLX-DAQ it error like pic

help please!!!

System Requirements


  • Microsoft Windows 98
  • Microsoft Office/Excel 2000 to 2010
  • May not work with newer software; no longer supported
AbdüssametB made it! (author)2016-05-26

when I open PLX-DAQ it error like pic

help please!!!

check your system

System Requirements


  • Microsoft Windows 98
  • Microsoft Office/Excel 2000 to 2010
  • May not work with newer software; no longer supported

I fixed this

kevinh165 (author)AbdüssametB2016-05-31

how??? please help

AbdüssametB (author)kevinh1652016-05-31

Use office in 32 bit

kevinh165 (author)AbdüssametB2016-05-31

Office 32bit or windows 32 bit?

AbdüssametB (author)kevinh1652016-05-31

Office 32 bit

SeanY27 (author)2017-03-22

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);

}

Bittu KumarS (author)2017-01-14

I don't know how to modify my program ,so that i can get data on spreadsheet. ,please help me..../*

*

Ultrasonic sensor Pins:

VCC: +5VDC

Trig : Trigger (INPUT) - Pin11

Echo: Echo (OUTPUT) - Pin 12

GND: GND

*/

int trigPin = 11; //Trig - green Jumper

int echoPin = 12; //Echo - yellow Jumper

int Object = 0;

long duration, cm ;

void setup() {

//Serial Port begin

Serial.begin (9600);

//Define inputs and outputs

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

}

void loop()

{

// The sensor is triggered by a HIGH pulse of 10 or more microseconds.

// Give a short LOW pulse beforehand to ensure a clean HIGH pulse:

digitalWrite(trigPin, LOW);

delayMicroseconds(5);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Read the signal from the sensor: a HIGH pulse whose

// duration is the time (in microseconds) from the sending

// of the ping to the reception of its echo off of an object.

pinMode(echoPin, INPUT);

duration = pulseIn(echoPin, HIGH);

// convert the time into a distance

cm = (duration/2) / 29.1;

if (cm < 10)

{

Serial.print("Object : ");

Serial.print(Object++);

Serial.println(" stk");

}

delay(20000);

}

HUKBMBEAR (author)2017-01-07
mabrao17 (author)2016-12-14

Would this work with an Arduino Microview?

Net-Devil (author)2016-11-30

Hey there.

I found out that the original PLX DAQ can only be used with Excel 32 bit versions. Error message is "object not available on this machine" due to selmaDAQ_Ver2.ocx that is not 64 bit compatible)

You can check out the new version I developed with full Office support (32 bit and 64 bit and versions up to Office 2016) on the official Arduino board here: https://forum.arduino.cc/index.php?topic=437398.0

If you have any questions I will try to answer them on the board of course :-)

The new module is now open code and can be enhanced if needed.

Greetings and don't be frustrated anymore! PLX DAQ is very cool and now works with all Office / Excel versions.

NetDevil

(I posted this to all "first search site result" websites I found with Google for PLX DAQ issues so the next users of PLX DAQ can find the new version as fast as possible :-) sorry for grave digging this thread)

JeremyW120 (author)Net-Devil2016-11-30

Does the new version in the link use the same Arduino code as above?

Net-Devil (author)JeremyW1202016-11-30

The code on your Arduino can still be used - no need to change anything. It is 100% compatible :-)

Only the code in the Excel VBA macro was changed but as a user you won't even recognize that. It's just working as usual but with all versions of Excel / Office now

enginterns (author)2016-10-04

Had anybody done it with newer version and with arduino Mega?

DaniDi9 (author)2016-10-04

Hi!

Thank you very much for your instructable, it's been really helpful and Ithink this way of connecting arduino with Excel is really interesting for the projects.

Anyway, I have tried communicating arduino with Mega with both arduino Uno and arduino Mega, but when I connect Mega, it doesn't work! Excel says me that connection is made, but nothing happens.

Does anyone know why this happens or if there is any solution?

Thank you!

suprarai (author)2016-08-21

I got error while pressing connect button on plx daq window "Stamp DAQ could not connect." I have 64 bit windows 10 OS. I have separate Microsoft office 64 bit installed. Initially i thought that this micro was incompatible with office 2013 version. But when tried to run on office 2007 version but on Win 10 OS, i still got the same error. So i highly suspect that the micro is somehow incompatible with Win 10.

FitriF6 (author)2016-06-28

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

FitriF6 (author)2016-06-28

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

guilherme-passos made it! (author)2016-06-15

tyvm, just what I needed to log temperature data until I have the time to make another software :D

Featheryry (author)2016-06-12


Thanks a lot! You are
really helpful! Guys you can also visit
https://plus.google.com/103156713044838092165/pos... to get
genuine and cheap windows keys to activate your windows.

MiteshN made it! (author)2016-03-07

i am getting error while pressing connect button on plx daq window "Stamp DAQ could not connect. please check port setting" what does this means. please help me.........

pvashwin (author)MiteshN2016-03-26

Mitesh, I have a similar problem, please update if you have been able to solve it.

Thanks !

bpéter2 (author)pvashwin2016-06-06

I also have this problem, do you have solution?

Thanks. :)

MiteshN (author)pvashwin2016-03-27

@pvashwin nope, its not solved yet.

StevenT78 (author)2016-05-25

Hi, is it possible to create a solution using this product, and distribute it to others without they themselves having to have PLX-DAQ installed on their laptops? An example would be an excel addin that as soon as a user runs it, it starts plotting (assuming they have a board connected and all the other requirements).

robvarmas made it! (author)2016-04-07

Excellent instructable! I made it but I want to add more variables to Excel... I try it and I add the column name but I can´t write de sensor value to the HT11 (Temperature and Humidity Sensor) and I want to add this variables to Excel and plot it in real time... Actually I print the HT11 sensor values in LCD... Somebody know how can I do it?

OmarS80 made it! (author)2016-05-06

the following link helps for adding more data columns, by adding Serial.print(",") between each data variable

http://robottini.altervista.org/arduino-and-real-time-charts-in-excel

BhargavM2 (author)2016-04-26

All the connections are fine. Have one to each and every comments listed hereby.

R > is blinking to red and green. Tx pin on Arduino UNO is also blinking on the same time. BUT NOTHING IS ADDED TO EXCEL SHEET

poe.yong.7 (author)2016-04-19

everytime for the first click on the 'connect' i encounter '"StampDAQ could not connect. please check port setting" problem but then the connection button become green for the second time i click.... however, though connected already, excel still remain empty all the time while the 'R' keep flashing...

Do you know what is the problem? kind of very frustating....

pp1307 (author)2016-04-10

great CrtSuznik! Very nice and useful instructable!!

ttjarvina (author)2016-04-07

it doesnt work, need to edit the script to suit your pc

RobertM363 (author)2016-03-31

So I am attempting to read in a voltage. I then want to log that voltage over time and graph the change. I am currently using excel 2003 and the voltage I am reading is coming from a circuit with a source, photo-resistor, and 10k resistor in series. I can read output in the serial monitor so I know the circuit is working. Please take a look at my Arduino code:

[code]int val = 0;

int row = 0;

void setup() {

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

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

Serial.println("LABEL,Time,Data"); //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() {

float value = analogRead(3);

float voltage = value * (5.0 / 1023.0);

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

Serial.println(voltage);

row++;

if(row>360){

row = 0;

Serial.println("ROW,SET,2");

}

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(750); //add a delay

}[/code]

I get the feeling my code should work. When I open PLX-DAQ three sheets open: Simple data, Simple data with plots, and Interactive bar graph, also, the active x program pops up and I am able to connect to the Arduino through port 3.. C is green R flashes red and T is green. However, when I do click connect nothing happens. I was under the impression that data should have started filling the first two coulombs, is this not correct? I also tried clicking new, three new sheets pop up, here I tried again to connect and no data started to flow in. I tried labeling coulomb a and b with Time and Data and then connecting but still no data.

So my question is this. Is there a problem with my code or is there some kind of data acquisition setup I have to go through in excel to get data coming in to new sheets or any sheet for that matter. Please help, been wrestling with this for a few days now...

SergeiDiGriz (author)2016-01-27

Thanks for sharing this... I am trying to use this with UV and Ozone sensors via a radio transmitter into COM-4. I am testing with serial input first using the following code, but only one line of data appears next to the time and that doesn't seem to relate to the sensors... any help would be gratefully accepted :-)

//always starts in line 0 and writes the thing written next to LABEL
#define LDR_PIN A1
#define OZONE_PIN A3

void setup() {

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

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

Serial.println("LABEL,TIME,LDR,OZONE,..."); //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

pinMode (LDR_PIN, INPUT);
pinMode (OZONE_PIN, INPUT);

}

void loop() {

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

int LDR_VALUE = analogRead(LDR_PIN);
Serial.print(LDR_PIN, LDR_VALUE);
Serial.print(",");
int OZONE_PIN_VALUE = analogRead(OZONE_PIN);
Serial.print(OZONE_PIN, OZONE_PIN_VALUE);

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(1000); //add a delay

}

JersonM1 (author)2016-01-08

How do I use this for ADXL345 accelerometer? The code that I am using is this one.

https://gist.github.com/e-Gizmo/7818304

SophiaZ4 (author)2016-01-06

This works great. Thank you! I tested on office 2013, it worked perfectly.

ΑνεστηςΠ (author)2015-11-15

hello

i can't make to works...

i want to measure more than 1 battery voltage and sending data to excell.My problem is that i can't sending data to 3 column...

void setup() {

Serial.begin(128000);

Serial.println("CLEARDATA");

Serial.println("LABEL,TIME,Battery1,Battery2");

}

void loop() {

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

int sensorValue = analogRead(A0);

float voltage = sensorValue * (5.0 / 1023.0);

Serial.println(voltage);

delay(1000);

sensorValue = analogRead(A1);

voltage = sensorValue * (5.0 / 1023.0);

Serial.println(voltage * 3 );

delay(1000);

}

About This Instructable

189,531views

810favorites

License:

More by CrtSuznik:Attiny Programmer (using Arduino UNO)EASY Arduino OLED sensor data displayControl ESP8266 over the internet (from anywhere)
Add instructable to: