A few months ago, with version 1.6.6, the Arduino IDE introduced a great new feature. It is called Serial Plotter and you can find it in your Arduino IDE under the tools menu. Using the Serial Plotter we can graph the output of our Arduino project in real time.

The Serial Plotter is a software utility that takes incoming serial values over the USB and graphs them against an X/Y axis. The vertical Y axis auto adjusts as the value of the output increases or decreases. The X axis is not time, but each tick on it is equal to an executed serial println command. In simpler words, each time a Serial.println command is executed a new point is added in the graph. Unfortunately we cannot have a graph with more than 500 points but I hope that in a future version of the Arduino IDE, we will be able to have more points.

——————–
WHERE TO BUY
——————–

1. Cheap Arduino Uno: https://educ8s.tv/part/ArduinoUno

2. DHT22 sensor: https://educ8s.tv/part/DHT22

3. Photoresistors: https://educ8s.tv/part/Photoresistors

4. Jumper wires: https://educ8s.tv/part/JumperWires

5. Wires: https://educ8s.tv/part/Wires

6. Resistor: https://educ8s.tv/part/Resistors

7. Small Breadboard: https://educ8s.tv/part/SmallBreadboard

[adsense]

Let’s now see how we can use the Serial Plotter in our projects. In my opinion, this tool is great for debugging and visual representation of data. The graphing feature of the Serial Plotter allows you to quickly see relative changes in your data without looking at a stream of number values or copying and pasting the data to Excel or Google Sheets. In this first example I have connected a photoresistor to an analog pin of Arduino. In the Serial Plotter we can see how the voltage across the photoresistor changes along with the changes in luminosity. In order to achieve this result all we have to do, is to enter the command Serial.println(analogValue) and open the Serial Plotter. Impressive isn’t it?

Now let’s see another example. Since version 1.6.7 of the Arduino IDE, the Serial Plotter offers a new feature. It can graph 2 or more values at the same time. I have connected a DHT22 sensor which can accurately measure the temperature and the humidity. As you can see, in the graph we now have two lines, the blue represents the temperature and the orange one the humidity. If I touch the sensor, the graph shows us a great visual representation of what’s happening. The humidity rises quickly and the temperature slowly. If I remove my finger the values are returning to their original state with different speeds and we can clearly see that without having to read a single number. Forget about multiple values in the serial monitor which are difficult to understand their meaning. Now with the Serial Plotter we can understand easily what’s going on with our project in a few seconds. Let’s see, how to plot two or more values in the Serial Plotter. First, we print the first value, the temperature in this case with the Serial.print command. Next we have to print a space with Serial.print command. Next we print the humidity with the Serial.println command. That’s it. You can plot many values at once, you have to print each value with the Serial.print command, separate the values with a white space, and print the last value with the Serial.println command. You can find the code of all the examples we saw in link in the description of the video.

——————–

CODE OF THE PROJECT
——————–

 

 

 

SUBSCRIBE ON YOUTUBE

——————–

Never miss a video: Subscribe to educ8s.tv