-------------------------
📌Introduction
-------------------------
This topic shows how to interface Arduino UNO board with DHT11 digital humidity and temperature sensor where the measure humidity and temperature are displayed on 1602 LCD screen.
-------------------------
📌 Circuit Design
-------------------------
As show in the circuit schematic the DHT11 sensor has 4 pins: VCC (+5V), Data, NC(not connected pin) and GND (from left to right). A pull-up resistor should be added to the data pin with a value between 4.7K and 10K
-------------------------
📌 Writing a source code
-------------------------
In this interfacing I used DHT sensors library (DHT11, DHT21 and DHT22) from Adafruit. This library initiates the DHT11 sensor and reads the values of the humidity and temperature.
Since the DHT11 sensor resolution is 1, the values of the humidity and temperature are stored in two variables with type byte (8-bit unsigned), named them RH (for the humidity) and Temp (for the temperature).
The values of the humidity and temperature needs to be displayed on the LCD after the reading, and for that used two character arrays named: temperature (char temperature[] = “Temp = 00.0 C “;) and humidity (char humidity[] = “RH = 00.0 “;).
Humidity and temperature values are copied to the previous arrays before displaying it.
For example the temperature value is copied to the array temperature as follows:
1. temperature[7] = Temp / 10 + 48;
This line means the 7th character of the array is equal to the tens of temperature value
2. temperature[8] = Temp % 10 + 48; (Temp%10 equals to the remainder of Temp/10)
and this line means the 8th character of the array is equal to the ones of temperature value,
For example if the temperature value is 42 == 42 / 10 = 4 and 42 % 10 = 2.
The number 48 is used to convert decimal numbers to AscII because the LCD works with AscII format.
The line temperature[11] = 223; means adding the degree symbol (°).
-------------------------
📌 Tags
-------------------------
#arduino #dht11 #simulation
-------------------------
📌 The Code
-------------------------
Given In Comment Section
📌 Tune With us so you never miss any update
-------------------------------------------------------------------------------------------------------------------------------------------------------------
🏷️Telegram : https://t.me/electronicsdeveloper
🏷️Facebook : / electronicsdeveloper
🏷️Instagram : / electronics_developer
🏷️Tweeter : https://twitter.com/Electronics_Dev?s=09
🏷️LinkedIn : / electronics-with-shreyash
🏷️Pinterest : / electronics_developer
Copyright Disclaimer under Section 107 of the copyright act 1976
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Copyright Disclaimer under Section 107 of the copyright act 1976, allowance is made for fair use for purposes such as criticism, comment, news reporting, scholarship, and research. Fair use is a use permitted by copyright statute that might otherwise be infringing. Non-profit, educational or personal use tips the balance in favour of fair use.
---------------------------------------------------------------------------------------------------------------------------------------------------------------
About Electronics Developer : YouTube certified creative essentials and asset monetization
---------------------------------------------------------------------------------------------------------------------------------------------------------------