ESP32 - Serial Plotter
|1||×||ESP-WROOM-32 Dev Module|
|1||×||Micro USB Cable|
About Serial Plotter
Serial Plotter is one of the tools in Arduino IDE. ESP32 can read the temperature, humidity or any kind of sensor data, and send it to Serial Plotter. Serial Plotter receives data from ESP32 and visualizes data as waveforms. Serial Plotter can visualize not only single but also multiple sensor data in the same graph.
Data is exchanged between Serial Plotter and ESP32 via USB cable, which is also used to upload the code to ESP32. Therefore, To use Serial Plotter, we MUST connect ESP32 and PC via this cable.
Serial Plotter includes a selection box to select the serial baud rate and a graph:
- Y-axis: represents the values received from ESP32. The Y-axis automatically adjusts itself as the value increases or decreases.
How To Open Serial Plotter
On Arduino IDE, Go to Tools Serial Plotter
Plotting of Single Line in Graph
To print a single graph, we just need to send the data and terminate it by “\r\n” character.
In detail, we just need to use Serial.println() function
※ NOTE THAT:
Serial.println() automatically appends “\r\n” characters after data.
This example reads the value from an analog input pin and plots them on Serial Plotter
- If this is the first time you use ESP32, see how to setup environment for ESP32 on Arduino IDE
- Copy the above code and paste it to Arduino IDE
- Click Upload button on Arduino IDE to compile and upload code to ESP32 board
- Open Serial Plotter
- Select baurate 9600
- See graph on Serial Plotter
Plotting of Multiple Lines in Graph
When we want to plot multiple variables, we need to separate variables from each other by “\t” or " " character. The last value MUST be terminated by “\r\n” characters.
- The first variable
- The middle variables
- The last variable
This example reads the value from 4 analog input pins and plots them on Serial Plotter
Example of 3 Sine Waveforms
Multiple Sine Waveform Graph:
We are considering to make the video tutorials. If you think the video tutorials are essential, please subscribe to our YouTube channel to give us motivation for making the videos.
※ NOTE THAT:
Note that this tutorial is incomplete. We will post on our Facebook Page when the tutorial is complete. Like it to get updated.