Arduino Serial Plotter
- It is called Serial Plotter and you can find it in your Arduino IDE under the tools menu. Using the Serial Plotter we can graph the output of our Arduino project in real time. The Serial Plotter is a software utility that takes incoming serial values over the USB and graphs them against an X/Y axis.
- The Arduino Serial Plotter allows you to graph serial data directly from your arduino to your laptop/computer in real time. Instead of displaying raw data via Arduino Serial Monitor, Arduino Serial Plotter allows you to display data in the form of a graph, allowing you to more accurately visualize your data (in many contexts, viewing a serial.
- The Serial Plotter view in Arduino IDE 1.6.6. The Arduino IDE software (short for Integrated Development Environment) is the foundation of what has made the Arduino platform so successful. With it, Makers can program a wide range of compatible microcontroller boards using Arduino’s relatively approachable programming language.
I need to plot serial data from Arduino.
Input Serial Plotter. This example shows you how to read and visualize on the serial plotter I2S audio data coming from an I2S microphone. Hardware Required. Serial Plotter built into the Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter) Circuit: * Arduino/Genuino Zero, MKRZero or MKR1000 board.
I require support for:
- Various data formats (e.g. signed, unsigned, 8 bits, 16 bits);
- Plots several data on the same axes;
- Exports / Imports file data.
As plotting serial data from Arduino is a common need, my question is:What programs/utilities are available for plotting serial data from Arduino that meet the needs above?
What are the advantages / disadvantages of the method you have suggested?
dda19 Answers
There are some good applications for visualizing the serial data, including:
MegunoLink ($29.95; Lite free) - plotting, logging, programming, reporting and more.
MakerPlot ($39) - digital & analog plotting, monitoring, custom interfaces and more.
ArduinoPlot (free) - simple plotting.
Robinson bmx serial numbers. arduino-plotter (free) - easy, light-weight plotting with support for all primitive types
Bridge Control Panel (free) - logging, plotting, and more.
RealtimePlotter (free) - 6 channels data plotting.
Real Time Serial Data Plotter (free) - CSV data plotting, logging and more.
SimPlot (free) - 4 channel plotting.
Arduino Serial Plotter (free) - built in Arduino Editor under Tools > Serial Plotter.
(This is a community wiki, you can expand the list.)
Advantages: It's very flexible, scriptable, and freely available.
Disadvantages: A bit complex to learn (but I figured out how to get started in a few minutes, and quite functional in an hour or two), runs in a terminal window (if you consider that a disadvantage).
Something I found very useful was to script it to reload my terminal program's logfile periodically so i got a dynamic graph as my experiment progressed.
Edit: Here is the GnuPlot script that plots it:
I use Matplotlib for any plotting I need to do.
It's not arduino specific in any way, but it is a very excellent Python plotting toolkit.
I've built a number of applications that plot data from a variety of microcontrollers in real-time to a graph, but that was really more of a two-step process: 1. Get data from device into computer, 2. plot realtime data.
Really, I think you should break your question into two parts:
- How do you get data from an Arduino/Any serial device into a computer easily.
- What is a good plotting library that is easy to use.
SerialPlot (free). It does everything you require and much more.
Other features:
- Zoom in on data
- Click on datapoints to see values
- Send commands back to Arduino
- Adjust total number of points plotted
- Ability to show each channel in its own autoscaled plot
- Interprets binary, ASCII and custom packets
- Demo mode lets you play with features
Responding to my own question here. I use Bridge Control Panel as mentioned.
Advantages: Lots of Features.
Disadvantages: Tricky to setup and very poor syntax/error reporting.
To use: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:
In Bridge the command to Read Data is:
RX8 is the read command[h=43] means the next valid byte is 'C' in ASCIIthen the High Byte of Key1then the Low Byte of Key1
It looks like this in Bridge:
akellyirlakellyirlYou can try serialchart. It's pretty strait forward program. It does exactly what you asked. The only disadvantage is that it requires data in CSV format (does not meet first point).
Screenshot from project page:
You might be interested in Telemetry
See on Github . It is a communication protocol, highly simple to use, with a clean interface, that enables bidirectionnal communication with Arduino/Mbed devices.
If you don't want to read this long post, see A walkthrough of all the awesome features in it
The power of this library comes from the desktop command line interface (that requires no programming skills in python).
It is able to open high-performance plots (much higher that what can be done with matplotlib) just by typing a command.
The protocol supports complexes data structures. For now arrays and sparse arrays can be send from the embedded board.
The plots opened from the command line interface understand the type of data, and for arrays, rather than plotting each sample versus time, sample will be plotted against its own index.
In a near future, it is planned to add support for spatial coordinates (xyz data), that will allow you to plot immediately spatial data. Once, again the plots will figure everything out, plot your data in 2D or 3D space and you can focus on developping your app.
I believe those features are simply unique for such a project.
Pytelemetry CLI
Once installed with pip
, the command line can be started with
Then you can connect
, ls
(list) received topics, print
data received on a topic, pub
(publish) on a topic, or open a plot
on a topic to display received data in real-time
PS : I am the author.
I developed it because I could not find a solution that would allow me to:
- write quickly PC scripts to control an Arduino
- debug quickly
- plot complex data (not just a time varying value)
all of the above without using proprietary solutions or bloated GUIs.
Using this library, the time to setup a communication between Arduino and PC went from usually half a day to 5 minutes.
Nobody had mentioned Processing which is super versatile. You can do a lot more than just plotting but if that's all you want to do you can use the gwoptics library; hook up Arduino and Processing as directed here.
AvamanderI made an equivalent tool in python that print real time data from ADXL345 accelerometer.https://github.com/mba7/SerialPort-RealTime-Data-Plotter
may be it will be helpful for someone
Just choose the serial com and speed and sent a serial data on the following format:
- 3 inputs, every input is a 2 bytes (Two's complement )
- 6 bytes seperated by a space
- the packet is a string terminated by 'n'
Could be easily adapted to change this format
You can use MATLAB Student Edition, this can save your time for further analysis, too.You can just open the COM port in MATLAB and plot the received signal and/or save the signal in the workspace or whatever. MATLAB makes everything easy!
CSV format is most versatile for any data (signed/unsigned, various size and precision).
Cross-platform (written in Java/Scala) tool Scsvlog can receive/parse CSV strings from serial port / socket, show values and draw charts (up to 8).
GreenonlineYou can try out the software I developed for that propose. It's aimed to be easy to use. See SerialGraphicator - Open Source Free Serial Port Client capable of graph values that are received in JSON format.
GreenonlineWhile I haven't used it myself, 'rqt_plot' running on the PC seems to be a popular way to plot data on a PC that comes over a serial port from an Arduino running a sketch that includes the rosserial_arduino library or the ros_arduino_bridge library.
- '7/24: Now that I have the Arduino set up using Kessel, I can visualize the data better using ROS tools'
- etc.
I know this is a very old question, but I recently created a mac application that solves this problem very well. You can find more information about it on www.bloonapp.com. There are some demo videos on the website that you can check out.
I know you were probably after more advanced GUI output, but I managed to replicate a task that one would normally do with an oscilloscope:
using the serial plotter in the Arduino IDE and an ADC module you can get for $3 on eBay. I admit it's a bit crude, but it might be worth playing with the tool for a while, before you invest in Python/Matlab/ect level solutions. It was exceedingly easy to use. It would not take much to add SD card recording to the process.
See: https://edwardmallon.wordpress.com/2016/08/15/using-the-arduino-uno-as-a-basic-data-acquisition-system/
Advantages:
- Easy to use
- Intuitive and flexible UI
- Open Source and free
- Different types of Graphs
- Very fast graph update rate
Disadvantages:
Arduino Serial Plotter Change Scale
- Stopped development
- Binary data format is not complete yet.
- Primitive graph controls like zoom, screenshot and ..
SVisual Monitoring and recording of signals for Arduino and not only.
Serial Plotter is a simple program that I've made with Electron that receives data in the following format:data1,data2,timestamp;
and converts it into a realtime chart.
Almost useful. It needs:
- logging serial data to a file OR
- graphing from a file and updating every xxx milliseconds.
Arduino Serial Plotter Not Working
Live Graph is a better option and I use it in conjunction with Tera Term which gets the data via the USB/serial link (and saves it to a log file which then Live Graph polls).
Live Graph is slightly buggy when caching data and I haven't found a way to set a moving window to display results. Also, showing multiple graphs requires manual scaling, but in spite of all this, it's still very useful. It's written in java so you'll need the JRE. I prefer this over having to install python like some of the other graphing programs do. another downside is that it opens 4 different windows, which is a pain when I want to flip between it and Tera Term.
Arduino Serial Plotter Example
I've yet to find software that's
- An executable (.EXE) so it has no external reliance
- Includes a terminal emulator or serial data logger
- Logs serial data
- Graphs multiple items from a CSV
- Allows for CSV AND tab-delimited data (which is way easier to read as it scrolls along while simultaneously monitoring the graph.
- Allows setting of different scales for each overlaid graph without having to scale everything to [0.1] or setting a multiplier, i.e. allowing setting an [y0.y1] range for each item graphed.
Arduino
Not the answer you're looking for? Browse other questions tagged serial or ask your own question.
Arduino Serial Example
This example reads audio data from an Invensense's ICS43432 I2S microphone
breakout board, and prints out the spectrum to the Serial console. The
Serial Plotter built into the Arduino IDE can be used to plot the audio
amplitude data (Tools -> Serial Plotter)
Circuit:
* Arduino/Genuino Zero, MKRZero or MKR1000 board
* ICS43432:
* GND connected GND
* 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero)
* WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero)
* CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero)
* SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero)
created 21 November 2016
by Sandeep Mistry
*/
#include <ArduinoSound.h>
// sample rate for the input
const int sampleRate =8000;
// size of the FFT to compute
const int fftSize =128;
// size of the spectrum output, half of FFT size
const int spectrumSize = fftSize /2;
// array to store spectrum output
int spectrum[spectrumSize];
// create an FFT analyzer to be used with the I2S input
FFTAnalyzer fftAnalyzer(fftSize);
voidsetup(){
// Open serial communications and wait for port to open:
// A baud rate of 115200 is used instead of 9600 for a faster data rate
// on non-native USB ports
Serial.begin(115200);
while(!Serial){
;// wait for serial port to connect. Needed for native USB port only
}
// setup the I2S audio input for the sample rate with 32-bits per sample
if(!AudioInI2S.begin(sampleRate,32)){
Serial.println('Failed to initialize I2S input!');
while(1);// do nothing
}
// configure the I2S input as the input for the FFT analyzer
if(!fftAnalyzer.input(AudioInI2S)){
Serial.println('Failed to set FFT analyzer input!');
while(1);// do nothing
}
}
voidloop(){
// check if a new analysis is available
if(fftAnalyzer.available()){
// read the new spectrum
fftAnalyzer.read(spectrum, spectrumSize);
// print out the spectrum
for(int i =0; i < spectrumSize; i++){
Serial.print((i * sampleRate)/ fftSize);// the starting frequency
Serial.print('t');//
Serial.println(spectrum[i]);// the spectrum value
}
}
}