Difference between revisions of "Component: Temperature Humidity (DHT11 ) (Sensors)"
(XML import) |
|||
Line 22: | Line 22: | ||
==Examples== | ==Examples== | ||
− | + | ||
+ | Example Program showing how to sample the DHT11 sensor and show the temperature and humidity on an LCD. | ||
+ | |||
+ | {{Fcfile|DHT11_Example.fcfx|DHT11 Example}} | ||
Revision as of 10:54, 17 August 2016
Author | Matrix TSL |
Version | 1.0 (Release) |
Category | Sensors |
Contents
Temperature Humidity (DHT11 ) component
The DHT11 temperature and humidity sensor is a popular sensor allowing the ambient temperature and relative humidty to be monitored digitally. Humidity Range = 20% - 90% +/- 5% Temperature Range = 0 - 50 Degrees C +/- 2 Degrees C
Examples
Example Program showing how to sample the DHT11 sensor and show the temperature and humidity on an LCD.
Downloadable macro reference
GetTempWhole
Gets the whole number portion of the temperature returned by calling SampleSensor.
If temperature is 15.8 degrees C then this function would return 15.
Parameters
- This macro has no parameters
Return value
GetHumidityFloat
Gets the humidity returned by calling SampleSensor as a floating point number.
Parameters
- This macro has no parameters
Return value
GetHumidityString
Gets the humidity returned by calling SampleSensor as a string.
Parameters
- This macro has no parameters
Return value
GetTempString
Gets the temperature returned by calling SampleSensor as a string.
Parameters
- This macro has no parameters
Return value
GetHumidityWhole
Gets the whole number portion of the humidity returned by calling SampleSensor.
If humidity is 15.8 % then this function would return 15.
Parameters
- This macro has no parameters
Return value
GetTempReal
Gets the real number portion of the temperature returned by calling SampleSensor.
If temperature is 15.8 degrees C then this function would return 8.
Parameters
- This macro has no parameters
Return value
GetHumidityReal
Gets the real number portion of the humidity returned by calling SampleSensor.
If humidity is 15.8 % then this function would return 8.
Parameters
- This macro has no parameters
Return value
SampleSensor
Communicates with the DHT11 sensor and receives the temperature and humidity
readings.
Returns 0 for success, 1 for no communication detected and 2 for checksum error.
Parameters
- This macro has no parameters
Return value
GetTempFloat
Gets the temperature returned by calling SampleSensor as a floating point number.
Parameters
- This macro has no parameters
Return value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Data Pin
This property is of type Single digital pin and can be referenced with the variable name dpin.
No additional information
Use Checksum
This property is of type True or false and can be referenced with the variable name csum.
The checksum value is used to ensure the data being received is correct.
Yes = Only receive data if checksum is correct
No = Ignore checksum