Understanding DHT 11 Sensor
DHT11 is a low-cost digital sensor for sensing temperature and humidity. This sensor can be easily interfaced with any micro-controller such as Arduino, Raspberry Pi etc. to measure humidity and temperature instantaneously. It comes with a dedicated NTC to measure temperature and an 8-bit microcontroller to output the values of temperature and humidity as serial data. The DHT11 sensor has three pins- VCC, GND and Data Pin. A pull-up resistor of 5k to 10k ohms is provided for communication between sensor and microcontroller.
Circuit Diagram
Code
- From event add when green flag clicked.
- Create two variable temp & humidity for storing the temperature and humidity respectively.
- From control add forever
- From sensor palette of Arduino select get humidity and set it variable humidity do same for temperature
- From look palette add say () for() block.
- From operators add three join () () display temperature and humidity with some message.
Script
Output