- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Serial Plotter in Arduino
The Serial Plotter is available in Arduino Versions 1.6.6 and above. It is a handy tool for visualizing rapid incoming data, say from a sensor. With Serial Monitor, you may not be able to register the changes in the data, especially if the data is changing too quickly. Serial Plotter will visually show you the changes. What's more, the Serial Plotter can also plot multiple values at a time. I think an example will best explain this.
Have a look at the code below. We are generating random numbers, but these could very well be readings from Analog or digital sensors.
Example
void setup() { Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.print(random(100)); Serial.print(","); Serial.println(random(200)); }
The Serial Monitor output of the above program is very rapidly changing and difficult to interpret −
Here's the Serial Plotter output of the above program −
As you can see, Arduino automatically figured out that two values are being sent, using the comma delimiter, and created two separate line graphs. This keeps on changing real-time and helps you visualize the changing patterns.
Please note that space can also be used as a delimiter instead of a comma. In fact, the really cool thing is that you can also have text labels in your printed output, and the Serial plotter will find the numerical values to plot. For instance, the following code will produce the same output on the Serial Plotter as the one above.
Example
void setup() { Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: Serial.print("R1: "); Serial.print(random(100)); Serial.print(","); Serial.print("R2: "); Serial.println(random(200)); }
- Related Articles
- Software Serial in Arduino
- Difference between hardware serial and software serial in Arduino
- View Serial Output in Arduino
- Serial Filtering Library in Arduino
- Stop Autoscroll in Serial Terminal in Arduino
- Read values sent by Serial Monitor to Arduino
- How to Use a Serial Monitor with Arduino IDE 2.0?
- How to change the baud rate of the Serial Monitor in Arduino?
- Serial Killings in India
- What is Serial Transmission?
- Serial Line Internet Protocol (SLIP)
- Serial Killer: Meaning and Types
- Display interface using serial transfer in 8085 Microprocessor
- What is Asynchronous Serial Transfer in computer architecture?
- Difference between Serial and Parallel Transmission
