amc2022:grouph:dht22_humidity_temperature_sensor
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
amc2022:grouph:dht22_humidity_temperature_sensor [2022/08/24 16:26] – created gustavo001 | amc2022:grouph:dht22_humidity_temperature_sensor [2022/08/30 18:16] – gustavo001 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====DHT22===== | =====DHT22===== | ||
+ | The DHT22 sensor is composed of two parts, the temperature and the humidity as shown in Figure #. The connection to the MCU is done using the Digital pins, because the sensor’s circuit converts analog signals to digital, and with the integration of the DHT.h library, found here((https:// | ||
+ | |||
- | {{ : | ||
- | |**//Figure #//** DHT22 sensing components. Source: https:// | ||
{{ : | {{ : | ||
|**//Figure #//** DHT22 Humidity sensing component. Source: https:// | |**//Figure #//** DHT22 Humidity sensing component. Source: https:// | ||
+ | |||
+ | === Temperature === | ||
+ | |||
+ | A thermistor is a semiconductor device that changes its resistance when the ambient temperature changes. The term is a conjunction of thermal and resistor, and while most resistors are subject to slight changes due to temperature variations, these devices are purposely engineered so that they are very susceptible to minimal temperature fluctuations. There are 1 type of thermistors, | ||
+ | The design and performance of the thermistor is selected by the manufacturer, | ||
+ | Therefore the coefficient B which defines the behavior | ||
+ | |||
+ | $$ Beta_{T1\over T2} = {T2 \cdot T1\over T2-T1} \cdot ln {R1 \over R2 }$$ | ||
+ | |||
+ | |||
+ | |||
+ | B = Material resistive value between two predetermined temperatures\\ | ||
+ | T1 = Base point temperature, | ||
+ | T2 = Second temperature point, for example 100o C, and in Kelvin 100o C + 273.15 = 373.15K\\ | ||
+ | R1 = Thermistors resistance at temperature T1 in Ohms\\ | ||
+ | R1 = Thermistors resistance at temperature T2 in Ohms\\ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | {{ : | ||
+ | |**//Figure #//** Graph showing the Relationship between resistance and temperature. Source : https:// | ||
+ | |||
+ | |||
+ | ===Humidity=== | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |**//Figure #//** DHT22 sensing components. Source: https:// | ||
+ | |||
+ | |||
Line 20: | Line 51: | ||
| Operating Voltage | | Operating Voltage | ||
| Data Protocol | | Data Protocol | ||
- | | Operating Temperature | + | | Operating Temperature |
| Temperature Accuracy | | Temperature Accuracy | ||
- | | Humidity Range | 0 to 100 % | | + | | Humidity Range | 0 to 100 % | |
| Humidity Accuracy | | Humidity Accuracy | ||
| Sampling Rate | 0.5 Hz - Once every 2 sec | | | Sampling Rate | 0.5 Hz - Once every 2 sec | | ||
Line 35: | Line 66: | ||
{{ : | {{ : | ||
|**//Figure #//** DHT22 Schematics. Source: https:// | |**//Figure #//** DHT22 Schematics. Source: https:// | ||
+ | |||
+ | |||
+ | |||
+ | ====Signal ==== | ||
+ | |||
+ | To read the data obtained by the module a protocol has to be observed. This protocol will function as an activation key that initiative the module, to send the information back to MCU and finalize the process. | ||
+ | |||
+ | - The micro controller sends a start signal for 500 microseconds | ||
+ | - The micro controller sends a HIGH logic 1 Signal | ||
+ | - DHT22 responds by pulling the bus low for 80 microseconds | ||
+ | - DHT22 pulls the bus HIGH for 80 microseconds. | ||
+ | - DHT22 pulls the bus LOW again. | ||
+ | |||
+ | |||
+ | Once the right sequence of the signal has been completed then DHT22 will start sending the information regarding both Temperature and Humidity. | ||
+ | Transmission of information is done through two set-ups called Logics. | ||
+ | |||
+ | - Logic 1 is a 48 to 55 microsecond LOW pulse followed by a 68 to 75 microsecond HIGH pulse. | ||
+ | - Logic 0 is a 48 to 55 microsecond LOW pulse followed by a 22 to 30 microsecond HIGH pulse. ((https:// | ||
+ | |||
+ | |||
+ | {{ : | ||
+ | |**//Figure #//** DHT22 Logic Signal formation. Source: https:// | ||
====Data ==== | ====Data ==== | ||
Line 75: | Line 129: | ||
If the highest bit of temperature is 1 as in: | If the highest bit of temperature is 1 as in: | ||
- | **_1_**000 0000 0110 0101, this means that the temperature is negative, therefore T = -10.1 °C((https:// | + | **_1_**000 0000 0110 0101, this means that the temperature is negative, therefore T = -10.1 °C((https:// |
- | + | ||
- | + | ||
- | + | ||
+ | In Figure # down below, we can see the whole siganling process between ESP32 and DHT22. | ||
+ | {{ : | ||
+ | |**//Figure #//** DHT22 bus transmission. Source: https:// | ||
+ | ====Code==== | ||
- | + | ====Results==== | |
- | | + | |
amc2022/grouph/dht22_humidity_temperature_sensor.txt · Last modified: 2022/09/09 17:22 by gustavo001