0% found this document useful (0 votes)
81 views

Arduino Nano DHT11 Temperature and Humidity Visual

The document describes how to use an Arduino Nano, DHT11 temperature and humidity sensor, and Visuino software to visually display temperature and humidity readings. It involves connecting the DHT11 sensor to the Arduino, using Visuino to add temperature and humidity elements to a packet component, and configuring the display properties for each element. Uploading code to the Arduino allows it to read sensor data and send it to Visuino for real-time visual display of the temperature and humidity readings.

Uploaded by

power system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Arduino Nano DHT11 Temperature and Humidity Visual

The document describes how to use an Arduino Nano, DHT11 temperature and humidity sensor, and Visuino software to visually display temperature and humidity readings. It involves connecting the DHT11 sensor to the Arduino, using Visuino to add temperature and humidity elements to a packet component, and configuring the display properties for each element. Uploading code to the Arduino allows it to read sensor data and send it to Visuino for real-time visual display of the temperature and humidity readings.

Uploaded by

power system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

technology workshop craft home food play outside costumes

Arduino Nano: DHT11 Temperature and Humidity Visual Instrumentation with


Visuino
by BoianM on December 21, 2015

Table of Contents

Arduino Nano: DHT11 Temperature and Humidity Visual Instrumentation with Visuino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Arduino Nano: DHT11 Temperature and Humidity Visual Instrumentation with Visuino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Connect the Humidity/Thermometer Sensor to Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 3: Start Visuino, and select the Arduino Board type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4: In Visuino: Add and connect DHT11 component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: In Visuino: Add Packet component and add 2 Binary Analog Elements in it . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 6: In Visuino: Specify how the Temperature will be displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 7: In Visuino: Specify how the Humidity will be displayed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Step 8: In Visuino: Specify unique packet header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 9: In Visuino: Connect the Packet component, and its elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 10: Generate, Compile, and Upload the Arduino code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Step 11: If not installed: Install the The DHT sensor library from Adafruit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Step 12: And play... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Intro: Arduino Nano: DHT11 Temperature and Humidity Visual Instrumentation with Visuino
DTH11/DTH21/DTH22 and AM2301 are very popular combined Temperature and Humidity Arduino sensors.

I already made one Instructable on how to use them and send text information for the Temperature and Humidity over Serial Port.

In this Instructable I will show you how you can use Packet communication and display the data in visual Thermometer and Gauge in Visuino.

Please note that the annotation on some of the pictures in this Instructable will work correctly on some browsers only after you click on the image to expand
it.

Please make sure you click on the image to see the annotation showing the correct spot on the image!

Step 1: Components
1. One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine)
2. One DHT11 Sensor module I got from this cheap 37 sensors set
3. 3 Female-Female jumper wires

Step 2: Connect the Humidity/Thermometer Sensor to Arduino


1. Connect Ground(Black wire), Power(Red wire), and Data(Gray wire) to the DHT11 Module (Picture 1 shows 2 different types of DHT11 sensor modules. As
you can see the pins may differ, so connect carefuly !)
2. Connect the other end of the Ground wire(Black wire) to Ground pin of the Arduino board(Picture 2)
3. Connect the other end of the Power wire(Red wire) to the 5V power pin of the Arduino board(Picture 2)
4. Connect the other end of the Data wire(Gray wire) to Digital pin 2 of the Arduino board(Picture 3, and 4)
5. Picture 5 shows where are the Ground, 5V Power, and Digital 2 pins of the Arduino Nano

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Step 3: Start Visuino, and select the Arduino Board type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .

Please be aware that there are some critical bugs in Arduino IDE 1.6.6.

Make sure that you install 1.6.7 or 1.6.5, otherwise this Instructable will not work!

The Visuino: https://www.visuino.com also needs to be installed.

1. Start Visuinoas shown in the first picture


2. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
3. When the dialog appears, select Arduino Nano as shown in Picture 2

Image Notes
1. Click on this "Tools" button

Step 4: In Visuino: Add and connect DHT11 component


1. Type "dht" in the Filter box of the Component Toolbox then select the "Humidity and Thermometer DHT11/21/22/AM2301" component (Picture 1), and drop it in
the design area
2. Connect the "Out" pin of the HumidityThermometer1 component to the "Digital" input pin of the Digital[ 2 ] channel of the Arduino component(Picture 2)

Image Notes
1. Select this component

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Step 5: In Visuino: Add Packet component and add 2 Binary Analog Elements in it
1. Type "pac" in the Filter box of the Component Toolbox then select the "Packet" component (Picture 1), and drop it in the design area
2. Click on the "Tools" button of the Packet1 component(Picture 2)
3. In the Elements editor, double click 2 times on the Binary Analog Element to add 2 of them (Picture 3, and 4)

Image Notes Image Notes


1. Select this component 1. Click here

Image Notes
1. Double-Click here 2 times

Step 6: In Visuino: Specify how the Temperature will be displayed


1. Select the first element in the Elements editor(Picture 1)
2. In the Object Inspector set the value of the Name property to "Temperature"(Picture 1)
3. In the Object Inspector, for the Instrumentation property, click on the "Down Arrow" and select the "Thermometer" from the list(Picture 2)
4. In the Object Inspector expand the "Instrument" property, then the "Scale" sub property(Picture 3)
5. Set the "Auto" sub property to False to disable the automatic scaling(Picture 3)
6. Set the "Min" sub property to the minimal temperature that we will display as example -20(Picture 3)
7. Set the "Max" sub property to the maximal temperature that we will display as example 100(Picture 3)

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Image Notes Image Notes
1. Select this element 1. Set this property
2. Set this property

Image Notes
1. Set these 3 properties
2. Set these 3 properties

Step 7: In Visuino: Specify how the Humidity will be displayed


1. Select the second element in the Elements editor(Picture 1)
2. In the Object Inspector set the value of the Name property to "Temperature"(Picture 1)
3. In the Object Inspector expand the "Instrument" property, then the "Scale" sub property(Picture 2)
4. Set the "Auto" sub property to False to disable the automatic scaling(Picture 2)
5. Set the "Max" sub property to 100(Picture 2)

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Image Notes Image Notes
1. Set this property 1. Set these 2 properties
2. Select this element

Step 8: In Visuino: Specify unique packet header


To make sure that Visuino will find the starting point of the packet, we need to have a unique header. The Packet component uses special algorithm to ensure that the
header marker does not appear in the data.

1. Select the Packet1 component (Picture 1)


2. In the Object Inspector Expand the HeadMarker property (Picture 1)
3. In the Object Inspector click on the "..." button (Picture 1)
4. In the Bytes editor type some numbers, as example 55 55
5. Click on the OK button to confirm and close the editor

Image Notes
1. Click here

Step 9: In Visuino: Connect the Packet component, and its elements


1. Connect the "Out" output pin of the Packet1 component to the "In" input pin of the Serial[ 0 ] channel of the Arduino component(Picture 1)
2. Connect the "Temperature" output pin of the HumidityThermometer1 component to the "In" pin of the Elements.Temperature element of the Packet1
component (Picture 2)
3. Connect the "Humidity" output pin of the HumidityThermometer1 component to the "In" pin of the Elements.Humidity element of the Packet1 component (
Picture 3)

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Step 10: Generate, Compile, and Upload the Arduino code
1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

If you get compiler error in the Arduino IDE, this means that you don't have the DHT sensor library https://github.com/adafruit/DHT-sensor-library installed
in the Arduino IDE.

Look at the Next Step to see how to install it!

Image Notes
1. Click here or press F9 to generate the code

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Image Notes
1. Click here to compile and upload the code.
If you get error see the next step on how to fix

Step 11: If not installed: Install the The DHT sensor library from Adafruit
If you don't have the DHT sensor library from Adafruit already installed, follow these steps:

1. In the Arduino IDE menu, select |Sketch|Include Library|Manage Libraries...| (Picture 1)


2. Type "dht" in the filter box (Picture 2)
3. Select the "DHT sensor library by Adafruit" library, and click the Install button (Picture 2)
4. Click on the Close button (Picture 3)
5. In the Arduino IDE, click on the Upload button, to compile and upload the code

Image Notes
1. Click here to install
2. Type "DHT" here

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Image Notes
1. Click here to close

Step 12: And play...


1. In Visuino select the ComPort, and then click on the "Format:" drop down box, and select Packet1(Picture 1)
2. Click on the "Connect" button(Picture 2)
3. If you select the "Instruments" tab, you will see the Thermometer and the Gauge showing the Temperature and Humidity(Picture 3)
4. If you select the "Scope" tab, you will see the the Scope plotting the Temperature and Humidity over time(Picture 4)

You can see the connected and running Humidity and Temperature sensor on Picture 5.

Congratulations! You have created a Temperature and Humidity measuring project in Arduino, with Visual Instrumentation.

On Picture 6 you can see the complete Visuino diagram.

Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

Image Notes Image Notes


1. Select the Serial Port 1. Click here to connect
2. Select Packet1

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
File Downloads

DHT11InstructablePacket.zip (950 bytes)


[NOTE: When saving, if you see .tmp as the file ext, rename it to 'DHT11InstructablePacket.zip']

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/
Related Instructables

How to share
data of Arduino The Super
Arduino Nano: OLED Arduino "Talking" Temp
temperatura Simple Arduino
Temperature temperature and Greenhouse / Humidity on a
and Humidity humidity meter from DHT22 Control - Weather Web
over the Internet TFT LCD w/ Server by
DHT11/DHT21/DHT22
by kariaa Humidity and
with Xively by relays by sspence
Sensor Module Temperature by
jackbell16 sspence
with Visuino by RichardP4
BoianM

Advertisements

Comments

http://www.instructables.com/id/Arduino-Nano-DHT11-Temperature-and-Humidity-Visual/

You might also like