downloaded from Parallax, Inc. Ironically, it was
originally written for Stamp microcontrollers — a
competitor to Arduinos. Since it just reads the data
coming in on the serial port, it’s really independent
of the specific microcontroller, as long as the
correct command words are sent over the USB
The Arduino writes successive rows of data
separated by commas to the serial port using the
Serial.print () command. The word “DATA” has to
be written in front of each row of data, with each
column of data separated by commas. That’s it.
That’s all that needs to be added to normal
Arduino code to start plotting data in Excel using
PLX-DAQ. Figure 3 shows a code snippet to write
data to PLX-DAQ.
I added a conditional flag to print the first two
columns of data containing the number of averages
for each data point and the specific time the data
item was taken, only when using PLX-DAQ.
As a quick test, I looked at the data printed to
the serial monitor as the three channels were read
and printed to the serial port. Figure 4 shows the
serial monitor response — just as we expected. It
has the right format to be read by PLX-DAQ.
When you download and install the PLX-DAQ
tool, it creates an Excel spreadsheet with an
embedded macro. You have to enable the macro
and allow it to run. The spreadsheet it opens up
has three tabs, or worksheets. By default, PLX-DAQ
will write all new data into the first worksheet. I set
mine up to plot the values in the three data
columns against the time column, using an X-Y
scatter graph. This is just one of the multiple types
of displays PLX-DAQ can create.
In the small dialog window that opens up in PLX-DAQ
(shown in Figure 5), there are two settings you have to
set: the COM port for the Arduino; and the baud rate. I
always use the highest baud rate I can get away with.
While most published example code I see uses 9600
baud, I never do this.
The highest baud rate I routinely get transferring into
PLX-DAQ is 56000. This is my default value. In the void
setup() function, I place the line
Serial.begin (56000);. You
also have to set this value in the PLX-DAQ dialog box.
When you click the “connect” button, PLX-DAQ sends
a rest command to the Arduino which starts the sketch
from the beginning and catches all the transmitted data.
This is effectively the start button.
Figure 6 shows an example of the Excel spreadsheet
with the five columns of data and the plot of the three
36 June 2015
FIGURE 3. An
example of the
the serial port
and place them
in columns in a
FIGURE 4. The characters printed to the serial port in the format read
for PLX-DAQ to parse it into Microsoft Excel.
FIGURE 5. The dialog box to set up PLX-DAQ. It automatically
opens when you open Excel and enable macros. You only need
to change the COM port and baud rate.