Introduction: Arduino – DHT11 and Serial Plotter V2.0
In order to visualize your data, the latest release of Arduino IDE 1.6.6 comes pre-installed with a plotter called the Serial Plotter, which you can use to view your data behavior in real time than just seeing numbers on the serial monitor.
The Arduino Serial Plotter takes the incoming stream of data over serial, the plotter updates each time the serial line pops new values and displays them in a plot.
To benefit the Serial Plotter you need to download the latest version of Arduino IDE.
You will need the following to make the circuit.
· 1 x Arduino Uno
· 1 x DHT11
· 2 x 10KΩ Resistor
· 1 x Microswitch
· Jumper Wires
Step 1: Schematic:
Here’s how to connect the DHT11 and Microswitch to Arduino.
Step 2: Source Code:
Here’s the codes for this project.
1. Download the DHT Library from Adafruit repository.
2. Unzip the DHT library and rename the extracted folder to DHT.
3. Copy this folder to the following path to install the DHT library.
C:\Program Files (x86)\Arduino\libraries
Step 3: Demonstration:
Once the sketch has been uploaded to Arduino, go to above path to open the Serial Plotter.
And now you should see the graph on the Serial Plotter once the Arduino pops new values. By default you should see the temperature readings first on the Plotter screen, when the switch button is pressed Humidity readings should be updated to the Serial Plotter and vice versa.
Step 4: Output:
As you have already noticed, we cannot differentiate between the temperature and humidity readings on the Serial Plotter as they appear on the same line. Basically we cannot read two different readings simultaneously. I believe the tool is partial for the moment, but fair enough to visualize single sensor data rather than multiple ones. Let’s hope for improvements soon.
I hope you like the post and hope you found it helpful to get acquainted with Arduino and its Serial Plotter.
Thanks for reading.