Today we are going to show you how to use DHT11, a low cost but efficient sensor capable of reading temperature and humidity;
1st Step - Install the library
This sensor uses an 8-bit controller to communicate in the format: [8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data + 8bit check sum] which gives 40 bits of data, and for make our life easier we will use a library to do the work of processing this data, the DHT-sensor-library (follow the instructions in the repository to install).
2nd Step - Connect with Arduino
At this moment it is important to note that if you have the sensor in its roughest form, follow the diagram in Figure 2 (1 - VCC, 2 - DATA, 3 - NC, 4 - GND) add to the scheme a 10KR resistor connecting pin 1 and 2 (VCC to DATA).
If you have an encapsulated sensor, follow the vendor's pinout, which in this case (1 - DATA, 2 - VCC, 3 - GND), as shown in Figure 3
3rd Step - Test
To test just open the Arduino IDE, go to FILE> EXAMPLES> DHT and open DHTtester and upload it to Arduino. There, open the Serial Monitor and see the magic.
Fig 1 - DHT11 sensor in its raw form
DHT11 specifications:
- Model: DHT11
- Power supply: 3.0 to 5.0 VDC (5.5 Vdc maximum)
- Current: 200uA to 500mA, in standby from 100uA to 150 uA
- Humidity measurement range: 20 to 90% RH
- Temperature measurement range: 0º to 50ºC
- Measurement humidity accuracy: ± 5.0% RH
- Temperature measurement accuracy: ± 2.0 ºC
- Response time: <5s
- Dimensions: 23mm x 12mm x 5mm (including terminals )
- Power supply: 3.0 to 5.0 VDC (5.5 Vdc maximum)
- Current: 200uA to 500mA, in standby from 100uA to 150 uA
- Humidity measurement range: 20 to 90% RH
- Temperature measurement range: 0º to 50ºC
- Measurement humidity accuracy: ± 5.0% RH
- Temperature measurement accuracy: ± 2.0 ºC
- Response time: <5s
- Dimensions: 23mm x 12mm x 5mm (including terminals )
More information can be found in the DATASHET (Important to Read)
1st Step - Install the library
This sensor uses an 8-bit controller to communicate in the format: [8bit integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data + 8bit check sum] which gives 40 bits of data, and for make our life easier we will use a library to do the work of processing this data, the DHT-sensor-library (follow the instructions in the repository to install).
2nd Step - Connect with Arduino
At this moment it is important to note that if you have the sensor in its roughest form, follow the diagram in Figure 2 (1 - VCC, 2 - DATA, 3 - NC, 4 - GND) add to the scheme a 10KR resistor connecting pin 1 and 2 (VCC to DATA).
Fig 2 - Direct connection diagram (OBS. Connect to pin 2 of the Arduino, not to 4)
If you have an encapsulated sensor, follow the vendor's pinout, which in this case (1 - DATA, 2 - VCC, 3 - GND), as shown in Figure 3
Fig 3 - Diagram with the sensor already encapsulated with the resistor
To test just open the Arduino IDE, go to FILE> EXAMPLES> DHT and open DHTtester and upload it to Arduino. There, open the Serial Monitor and see the magic.
DHT11 (Temperature + Humidity) with Arduino
Reviewed by AJ Alves
on
sábado, fevereiro 14, 2015
Rating:
Nenhum comentário:
Postar um comentário