Difference between revisions of "Serial Plotter in Arduino"

From ESE205 Wiki
Jump to navigation Jump to search
(Created page with "How to use Arduino Serial Plotter: The Arduino Serial Plotter allows you to graph serial data directly from your arduino to your laptop/computer in real time. Instead of displ...")
 
Line 1: Line 1:
 
How to use Arduino Serial Plotter:
 
How to use Arduino Serial Plotter:
 +
 
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 plot is much more informative than having to sort through a stream of data).  
 
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 plot is much more informative than having to sort through a stream of data).  
 +
 
Useful aspects of plotter:
 
Useful aspects of plotter:
 
- Data display sorted by color
 
- Data display sorted by color
Line 8: Line 10:
 
- Great for visualization of data
 
- Great for visualization of data
 
- Visual troubleshooting
 
- Visual troubleshooting
 +
 
How to access the plotter:  
 
How to access the plotter:  
 
After uploading your code…
 
After uploading your code…
 
   
 
   
 
How the Graph works:
 
How the Graph works:
 +
 
The vertical Y-Axis auto adjusts itself with the output value (as it increases or decreases) to encompass all the data. The plot itself (and X-axis with it) is updated every time a Serial.print() command updates with a new value to be plotted on the graph.
 
The vertical Y-Axis auto adjusts itself with the output value (as it increases or decreases) to encompass all the data. The plot itself (and X-axis with it) is updated every time a Serial.print() command updates with a new value to be plotted on the graph.
 +
 
Important things to know:  
 
Important things to know:  
 
Make sure the Baud Rate of both the Serial Plotter and the code is set to the same value, otherwise the graph will not generate.
 
Make sure the Baud Rate of both the Serial Plotter and the code is set to the same value, otherwise the graph will not generate.
Line 19: Line 24:
 
   
 
   
 
Like so^
 
Like so^
 +
 
In order to plot multiple values, you need to separate print statements with a comma, as shown here.
 
In order to plot multiple values, you need to separate print statements with a comma, as shown here.
 
Serial.print(Value);
 
Serial.print(Value);
 
Serial.print(",");
 
Serial.print(",");
Serial.println(Value2);  
+
Serial.println(Value2);
 +
 
Now you know most of how it works, the only thing left is to explore it yourself!  
 
Now you know most of how it works, the only thing left is to explore it yourself!  
 +
 
An example from my project, FootFrame:
 
An example from my project, FootFrame:

Revision as of 19:48, 29 April 2017

How to use Arduino Serial Plotter:

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 plot is much more informative than having to sort through a stream of data).

Useful aspects of plotter: - Data display sorted by color - Ability to plot multiple data values - Resizes automatically - Autoscroll enabled (similar to serial monitor) - Great for visualization of data - Visual troubleshooting

How to access the plotter: After uploading your code…

How the Graph works:

The vertical Y-Axis auto adjusts itself with the output value (as it increases or decreases) to encompass all the data. The plot itself (and X-axis with it) is updated every time a Serial.print() command updates with a new value to be plotted on the graph.

Important things to know: Make sure the Baud Rate of both the Serial Plotter and the code is set to the same value, otherwise the graph will not generate.

When displaying multiple values, they will be differentiated by color, with the first value (and every value from the print statement that prints it) printed by the first color, and the next the second color, etc.

Like so^

In order to plot multiple values, you need to separate print statements with a comma, as shown here. Serial.print(Value); Serial.print(","); Serial.println(Value2);

Now you know most of how it works, the only thing left is to explore it yourself!

An example from my project, FootFrame: