get () from DHT sensor at pin ()

Description

The block reports the temperature or humidity from the DHT sensor connected to the selected pin.

 

There are lots of pins to which the sensor can be connected:

  1. Digital Pin: D3
  2. Analog Pins: A1 and A2
  3. Servo Pins: S1 and S2
  4. Touch Pins: T1, T2, T3, T4, and T5

The pin can be selected from the dropdown.

 

Example

Learn to Interface DHT11 (Temperature and Humidity) sensor and measure Temperature and Humidity with Arduino

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

  1. From  event add  when green flag clicked.
  2. Create two variable temp & humidity for storing the temperature and humidity respectively.
  3. From  control  add  forever
  4. From sensor palette of  Arduino  select get humidity and set it variable humidity do same for temperature
  5. From  look  palette  add  say ()  for() block.
  6. From operators add three join () ()  display temperature and humidity with some message.

Script

Output

 

Read More
All articles loaded
No more articles to load
Table of Contents