If you use Arduino, perhaps to handle the lower-level driving work of your DIY Robocar, you may have noticed the Serial Plotter tool, which is an easy way to graph data coming off your Arduino (much better than just watching numbers scroll past in the Serial Monitor).
The Auto Plotter ARP-10 option is added to the processor unit. It permits automatic or manual acquisition of up to 10 targets, tracks them at specified plot intervals, presents alphanumeric target data, and triggers a collision alarm for targets violating preset CPA/TCPA limits. Thanks very much for purchasing cutting plotter. For ensuring you to make best use of your machine, please reading this manual carefully and thoroughly before starting to use it. Please turn off the power quickly if you encounter anyproblems, and refer to this manual or contact your dealer. Special Declaration.
You may have also noticed that the Arduino documentation gives no instructions on how to use it ¯_(ツ)_/¯. You can Google around and find community tutorials, such as this one, which give you the basics. But none I’ve found are complete.
So this is an effort to make a complete guide to using the Arduino Serial Plotter, using some elements from the above linked tutorial.
First, you can find the feature here in the Arduino IDE:
It will plot any data your Arduino is sending out in a Serial.print() or Serial.println() command. 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 Serial.println() is updated with a new value.
It also has some nice features:
- Plotting of multiple variables, with different labels and colors for each
- Can plot both integers and floats
- Auto-resizes the scale (Y axis)
- Supports negative value graphs
- Auto-scrolls the X axis
But to make it work well, there are some tricks in how to format that data. Here’s a complete(?) list:
- Plot one variable: Just use Serial.println()
Auto Plotter Manual Pdf
Serial.println(variable)
;
- Plot more than one variable. Print a comma between variables using Serial.print() and use a Serial.println() for the variable at the end of the list. Each plot will have a different color.
- Plot more than one variable with different labels. The labels will be at the top, in colors matching the relevant lines. Use Serial.print() for each label. You must use a colon (and no space) after the label:
Auto Plotter Manual Online
- Add a ‘min’ and ‘max’ line so that you can stop the plotter from auto scaling (Thanks to Stephen in the comments for this):
- Or if you have multiple variables to plot, and want to give them their own space:
Auto Plotter Manual Download
Of course, now the numbers on the y-axis don’t mean much, but you can still see the waveforms.