amc2020:group_n:dht22
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| amc2020:group_n:dht22 [2020/07/28 20:40] – [3. Technical Specifications and Setup of the Sensor] jonas001 | amc2020:group_n:dht22 [2021/08/24 17:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | < | ||
| + | < | ||
| + | <a href=" | ||
| + | <span style=" | ||
| + | ↩ Back to the main page | ||
| + | </ | ||
| + | </a> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| ====== DHT-22 Air Temperature and Humidity Sensor ====== | ====== DHT-22 Air Temperature and Humidity Sensor ====== | ||
| Line 81: | Line 91: | ||
| ===== 3. Technical Specifications and Setup of the Sensor ===== | ===== 3. Technical Specifications and Setup of the Sensor ===== | ||
| - | The DHT-22 comes with 4 pins and can be plugged into a breadboard. Pin 1 (VDD) is connected to the power supply, pin 2 (DATA) is the 1-wire data-bus and is connected to GPIO 15, pin 3 (NC) is not connected, and pin 4 (GND) is connected to 0 Volts. Information on the technical specifications can be found in table 1. | + | The DHT-22 comes with 4 pins and can be plugged into a breadboard. Pin 1 (VDD) is connected to the power supply, pin 2 (DATA) is the 1-wire data-bus and is connected to GPIO 15, pin 3 (NC) is not connected, and pin 4 (GND) is connected to 0 Volts (figure 3). Information on the technical specifications can be found in table 1. |
| ^**//Table 1//** Technical specifications, | ^**//Table 1//** Technical specifications, | ||
| Line 95: | Line 105: | ||
| | Repeatability | | Repeatability | ||
| The specifications are also available in the {{https:// | The specifications are also available in the {{https:// | ||
| + | |||
| + | ^{{: | ||
| + | |**//Figure 3//** Connection of ESP32 and DHT-22.| | ||
| ==== 3.1 Pullup Resistors ==== | ==== 3.1 Pullup Resistors ==== | ||
| Line 104: | Line 117: | ||
| $$R_{max}=\left(\frac{1}{80000\Omega}+\frac{1}{4700\Omega}\right)^{-1}=4439.2\Omega$$ | $$R_{max}=\left(\frac{1}{80000\Omega}+\frac{1}{4700\Omega}\right)^{-1}=4439.2\Omega$$ | ||
| - | When the sensor data pin and the GPIO of the ESP32 are connected through a longer cable (>50cm), it is advisable to use another external pullup-resistor. This is due to the fact that the wire acts as a capacitor, and the longer the wire is, the larger the capacitance. After a 0V pulse, the wire-capacitor has to be charged again before the data-bus reaches the full 3.3V potential. That means, instead of having a clean pronounced voltage signal, which can be interpreted as a 0 or 1, the signal looks like the charging curve of a capacitor (see figure | + | When the sensor data pin and the GPIO of the ESP32 are connected through a longer cable (>50cm), it is advisable to use another external pullup-resistor. This is due to the fact that the wire acts as a capacitor, and the longer the wire is, the larger the capacitance. After a 0V pulse, the wire-capacitor has to be charged again before the data-bus reaches the full 3.3V potential. That means, instead of having a clean pronounced voltage signal, which can be interpreted as a 0 or 1, the signal looks like the charging curve of a capacitor (see figure |
| $$R' | $$R' | ||
| Line 110: | Line 123: | ||
| $$R' | $$R' | ||
| - | As the total pullup resistance decreases, the current increases and the wire-capacitor is charged faster (that means 3.3V on the data-bus is reached faster as well), which steepens the charging curve of the capacitor and thus makes the signal more “square”, | + | As the total pullup resistance decreases, the current increases and the wire-capacitor is charged faster (that means 3.3V on the data-bus is reached faster as well), which steepens the charging curve of the capacitor and thus makes the signal more “square”, |
| - | ^{{: | + | ^{{: |
| - | |**// | + | |**// |
| ==== 3.2 Other Issues and Problems that occurred ==== | ==== 3.2 Other Issues and Problems that occurred ==== | ||
| Line 129: | Line 142: | ||
| === 3.2.3 Upload-issues using the ESP32 DevkitC VB === | === 3.2.3 Upload-issues using the ESP32 DevkitC VB === | ||
| - | When using the ESP32 instead of an Arduino, the Arduino IDE can give a time out error (figure | + | When using the ESP32 instead of an Arduino, the Arduino IDE can give a time out error (figure |
| - | ^{{: | + | ^{{: |
| - | |**// | + | |**// |
| This seems to be an issue caused by the power supply to the DHT-22 during the upload process. Other users reported to have fixed the problem by | This seems to be an issue caused by the power supply to the DHT-22 during the upload process. Other users reported to have fixed the problem by | ||
| Line 283: | Line 296: | ||
| Between the printing of the results (line 3, 4, 5) and the start of the next measurement process (line 6) a time difference of 2.04 seconds could be observed. 2 seconds are due to the delay in the main loop (code section 10), the rest is due to the print() functions which consume comparably much time. | Between the printing of the results (line 3, 4, 5) and the start of the next measurement process (line 6) a time difference of 2.04 seconds could be observed. 2 seconds are due to the delay in the main loop (code section 10), the rest is due to the print() functions which consume comparably much time. | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <a href=" | ||
| + | <span style=" | ||
| + | Back to the top ⤴ | ||
| + | </ | ||
| + | </a> | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
amc2020/group_n/dht22.1595961628.txt.gz · Last modified: 2021/08/24 17:34 (external edit)