Introduction: Plotting Data From Arduino

About: Technologist, Electronic Engineer, sometime Coderdojo mentor.

Arduino doesn't have much in terms of debug and analysis capability built in, so it can be very useful to have a facility to plot data that's sent from Arduino over the Serial Port.

There are several ways to do that including Processing, Python + Matplotlib etc.. but none of these methods work effectively with very little setup and offer expected features such as Zoom, Scroll, Write to File, Save Setup etc.

I want to show you how to produce the kinds of plots illustrated in my Frequency Detection Instructable.

The Software I used to produce those plots is Bridge Control Panel.

It's released as a part of Cypress Semiconductor's PSOC Programming Utilities.

==============
By the way. If you like this Instructable, you might also like to read My Blog covering various projects and Tutorials.

==============

Step 1: Bridge Control Panel

Download and Install the Bridge Control Panel.

You need to write the Arduino Data over the Serial Port one byte at a time. For an int data type that would look as follows:

    // RX8 [h=43] @1Key1 @0Key1
    Serial.print("C");
    Serial.write(data>>8);
    Serial.write(data&0xff);

We Signal that we're sending a data byte then send each byte of the int.

The Syntax for the Bridge Command is shown in the comment and in the Picture of the Bridge Window.

Notice we have successfully connected to Arduino on COM6.

The command to Read Data is:  RX8 [h=43] @1Key1 @0Key1

RX8 is the read command
[h=43] means the next valid byte is "C" in ASCII
then the High Byte of Key1
then the Low Byte of Key1

[Chart -> Variable Settings]   panel is illustrated in the Picture.

In here you need to tell Bridge Key1 is Type:int , signed. The TICK means this is in use.

If you have made any mistakes here the command in the Editor Window will show the Errors in BLUE.

Finally you need to setup the comm's protocol in   [Tools -> Protocol Configuration F7]

Make sure the Baud Rate matches the one specified in Arduino.

To Capture Data press REPEAT in the Window.

Step 2: Plots

That's it.

Enjoy making great plots and enjoy a useful debugging tool.

You can also SAVE data for further processing by MATLAB or EXCEL etc..
Microcontroller Contest

Participated in the
Microcontroller Contest