myRIO Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

DHT11, RHT11 - Temperature & Humidity Sensor

Sensor Type: DHT11, RHT11 - Temperature & Humidity Sensor

LabVIEW or C: LabVIEW

Version of LV: 2013

Description:

DHT11 is a composite sensor contains a calibrated digital signal output of the temperature and humidity.

DHT11 sensor uses a single-wire bi-directional protocol.

Download DHT11 datasheet from web for more information and specifications.

Instructions:

The API is implemented on FPGA.

To get the measured temperature and humidity values from DHT11 use 'DHT11 Read (FPGA).vi' in API folder from 'DHT11 (FPGA).lvlib.

There is also 'Example - DHT11 (FPGA).vi' in Example folder. The 'Example - DHT11 (FPGA).vi' must be compiled in order to be used from the FPGA Interface.

DHT11 - Digital Temperature and Humidity Sensor_Project.png

Wiring Diagram:

DHT11.png

Comments
Member yuhuayeh
Member

Hello

When I run the DHT11 Read(FPGA).vi

There is always an error -8002 (timeout error)

Can you give me a solution?

Thank you so much!

Active Participant Wolfgang_Z.
Active Participant

The API throws the timeout error -8002 if there is no response from DHT11 sensor.  Reasons could be faulty wiring, to long lines, no resistor, defect sensor... If you think no of the reasons are apply then you can increase the "Timeout (Ticks)" constants in the "DHT11 Read (FPGA).vi" but this is only necessary if your sensor is out of specifications.  Regards, Wolfgang

Member muji25
Member

is it compatible with any fpga?

Active Participant Wolfgang_Z.
Active Participant

This example should work with every NI FPGA board with DIO lines that support running in a Single Cycle Timed Loop.

Member shpalacio
Member

I can't seem to make it work with the myrio library, I cant control inputs or outputs in this example outside de DHT11 (EX: turn on a LED @ certain temperature)

Active Participant Wolfgang_Z.
Active Participant

There are three ways to use the myRIO:

  1. Only in RT mode with a predefined FPGA Shipping Personality like the Default Personality. In this case you do not program the FPGA. You are using the myRIO functions for programming.
  2. Create your own FPGA VI like in the DHT11 example and your own RT VI. Then you cannot use the myRIO functions on RT like the Express Vis.
  3. You customize the myRIO Default FPGA Personality. In this case you can use the DHT11 sensor on FPGA and the myRIO functions on RT together.

         To do that click in LabVIEW on Project >> Create Project >> Templates >> myRIO >> myRIO Custom FPGA Project

         In the RT VI of the sample project you can see that they nix Express VIs from the myRIO functions palette with FPGA Read/Write-Nodes.

          Example.PNG

Member Denden876
Member

Hi Everyone,

 

I have downloaded the files and connected myRIO to DHT11 as specified above. I am encountering two problems anyway:

 

  • It looks like I cannot get a FPGA target as shown in the screenshot
    image.png
  • The other problem, which I am guessing is related to the first one, is checksum error (8001) when I am running the main viimage.png

So the program work only when it suits it.

 

Could you please help me to find a solution?

 

Best regards

 

Denis

Contributors