Ultimate Guide To Adruino Serial Plotter
Ultimate Guide To Adruino Serial Plotter
by Jonathanrjpereira
The Arduino Serial Plotter function has been added to the Arduino IDE, allowing you to natively graph serial data
from your Arduino to your computer in real time. If you’re tired of seeing your Arduino’s analog sensor input data
pour onto your screen like The Matrix, this looks like a prettier way to visualize what’s going on. A Serial plotter is
an offline tool allowing you too Visualize data and troubleshoot your code offline without having to use third-party
services like Processing or Plotly. Since there is no official documentation on the Arduino website regarding the
use & functionality of the Serial Plotter, I decided to documents its uses and features.
Features
Applications
Parts Required
Arduino - AliExpress or
Arduino Starter Kit - AliExpress
Now that you have installed the latest version of the Arduino IDE(1.6.7 or above) its time to understand how the
Serial Plotter actually works. The Arduino Serial Plotter takes incoming serial data values over the USB
connection and is able to graph the data along the X/Y axis, beyond just seeing numbers being spit out on to the
Serial Monitor. The vertical Y-axis auto adjusts itself as the value of the output increases or decreases, and the X-
axis is a fixed 500 point axis with each tick of the axis equal to an executed Serial.println() command. In other
words the plot is updated along the X-axis every time the Serial.println() is updated with a new value.
Remember to set the Baud Rate of the Serial Plotter so that it matches that of the code.
Multiple Plots
When displaying multiple waveforms, every separate variable/value/parameter is displayed using a different colour
like shown below.
Inorder to plot multiple variables or waveforms simultaneously a 'space' is printed between the two print
statements.
Serial.print(temperature);
Serial.print(" ");
Serial.println(humidity);
OR
Serial.print(temperature);
Serial.print("\t");
Serial.println(humidity);
In this case the values of the variables 'temperature & humidity will have separate waveforms plotted on the same
graph simultaneously.
The main purpose of having the Serial plotter is that you do not need to be connected to the Internet in-order to
visualize the data from a sensor or your project. And hence for the purpose of Data Visualization the Serial plotter
excels at its job.
Whether its a singular wave or a multiple plot graph the Serial Plotter auto-resizes itself and color codes each
wave. In-order to test the Data Visualization function you can follow the following steps:
https://youtu.be/lRu-Z6gGrvc
One of the best uses of the Serial Plotter is to robot turns right hence the two motors have different
troubleshoot the code & circuit. Faulty connections or value's;Right=50,Left=100. You can see the Red
incorrect coding logic can sometimes return an waveform decreasing and the Yellow waveform
undesired output. In such cases where there too remaining constant speed which represents the right
many lines of code or too many wires to debug the turn.
Serial Plotter can show the exact point of error.
Troubleshooting whether a wire was not connected
With the help of the Serial Plotter you can check if a properly or a component was malfunctioning or your
sensors reading is incorrect or even if the sensor is coding logic was incorrect would have cost you a lot
not connected properly to the Arduino. The Serial of time. But with the help of the Serial Plotter the
Plotter will also help debugging code by displaying amount of time it takes to troubleshoot the problem
the values various conditional statements and can be significantly reduced by analyzing the
variables or even the states of the pins of the waveforms.
Arduino.
class="title">Function Generator.ino
The Arduino IDE has for long needed the addition of the Serial Plotter. It has increased the functionality of the
Arduino IDE but still lacks some features:
Autoscroll Toggle
Simultaneous use of Serial Plotter & Serial Monitor.
X-axis Scale/Time scale required.
As these features are added to the Arduino IDE, I will continue to make changes and add new steps to this
Instructable.
First of all thank you for showing how to use the plotter function.
I have one question:
Is it somehow possible to plot the data and simultaneously save the data with i.g. CoolTerm? If I try
to do it, the Arduino sketch will give me an error telling me that the monitor can´t be opened while
the plotter is open.
Thanks in advance.
Best regards
Florian
I am not familiar with CoolTerm. But in my experience if something is sharing the same serial port
as the serial monitor/plotter while they are open could result in a similar error.
It could also be that your serial monitor is already opened & hence the plotter cannot be opened
simultaneously.
Hi there ! can i know how to save the data or graph collected from the seriel monitor/plotter?
Hi, thank you for this, I've just started with the serial plot and just discovered you can
Serial.print(UpperLimit); //constant max X
Serial.print(" ");
Serial.print(LowerLimit);// constant min X
Serial.print(" ");
Serial.println(Value X);
this locks the graph and stops it from auto scaling :D
Cool. I may add this to the Instructable.
Very helpful - thanks! This is so much easier than trying to read long columns of numbers. One
little detail I found: if you plot more than 4 lines, the plotter will reuse the same colors, so it can get
a bit confusing unless you know which line is which.
I created this plotter for multiple values. It has a legend, based off of name:value pairs that the
Arduino sends via Serial.println();
http://www.onebeartoe.com/development-tools/serial-plotter/
I agree about the lack of plotting facilities. I made this https://www.instructables.com/id/Arduino-
Developmen...
over three years ago to address that issue plus add in a lot of other visualisers which can all be
used simultaneously. Still freely available to those who contact me for the link.
Awesome, thanks! Got it working.
Hey I have sent you the 3-month Pro/Premium Membership. All the best & Follow.
Thanks.
Thanks for this. Nice clear explanation of a great tool. I have just one question. You say "The main
purpose of having the Serial plotter is that you do not need to be connected to the Internet in-order
to visualize the data from a sensor or your project." It would never occur to me to connect to the
Adruino Serial Plotter: Page 9
internet for data visualization. For visualization I think Excel, Processing, writing my own plot code
in Python, whatever. IDE plotting is mostly a better choice than those but none of them need the
Internet. What Internet data visualization tool am I missing that is so popular that you just assume
it?
Assume a person(someone like me) who is not familiar with Processing or Interfacing an Arduino
with Excel or has no experience with languages such as Python needs to visualize the data from
his/her Arduino. The Serial Plotter is a useful tool too such a person. Since I had no knowledge
regarding Processing,Python,etc I took too online(Internet based) open source data visualization
platforms(Plotly, Sparkfun Data,etc) too visualize my data. These platforms are very easy to use if
you have a wifi shield as you only need to copy & paste a few lines of code available in their
documentation & user guides. Now considering the fact that this tutorial is made for newbies who
do not possess a wifi shield and have basic coding skills; this Instructable is made to cater to their
data visualization needs.
I totally agree and I will be using this mode a lot even though I am not a newbie. Your tutorial will
be a great help and thanks for writing it. I just don't understand what any of this this has to do with
being connected to the Internet. Most of the other visualization tools don't need an Internet
connection either. I use this mode mostly because it is the simplest visualization method for
looking at Arduino generated data because it is built in to the IDE.
Have you found a way to plot more than two channels using Serial Plotter?
I have included the instructions to plot more than two channels/waveforms. Its highlighted as
'Multiple Plots'
you are right about time this feature was added. Besides running the plotter with a time stamp, how
about simultaneous recording :)) Or perhaps some of this is possible by adding a real time clock? ?
??
any ideas???
I guess they could also Integrate and arduino Graphics, which would create a graphical output;
kind of like integrating some processing like functions within the Arduino IDE.
Thankyou
Ah, thanks for sharing. I already wondered what the new plotter option was good for / how to use it.