0% found this document useful (0 votes)
32 views34 pages

Cambien

The document is a mini project report on the DHT11 Temperature & Humidity Sensor, detailing its definition, technical specifications, structure, and applications. It discusses the sensor's operation with Arduino for temperature monitoring and highlights its components, including the resistive humidity sensor and NTC thermistor. The report also covers device connections, signal processing, and code implementation for effective temperature control systems.

Uploaded by

Thịnh Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views34 pages

Cambien

The document is a mini project report on the DHT11 Temperature & Humidity Sensor, detailing its definition, technical specifications, structure, and applications. It discusses the sensor's operation with Arduino for temperature monitoring and highlights its components, including the resistive humidity sensor and NTC thermistor. The report also covers device connections, signal processing, and code implementation for effective temperature control systems.

Uploaded by

Thịnh Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

HA NOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

MECHANICAL SCHOOL
DEPARTMENT MECHATRONICS


REPORT MINI PROJECT


SENSOR AND SIGNAL PROCESSING

SENSOR DHT11
Instructor: Dr. Tran Van Huong

Class ID: 152378

Team member: Chu Trong Tuan Bao

Duong Van Thinh

Nguyen Trung Duc

Ha Noi - 2024
Contents
Chapter 1: Introduction..................................................................................2

1. Definition..................................................................................2

2. Technical specifications..........................................................5

Overview........................................................................................5

Detailed Specifications:.................................................................5

3. Structure..................................................................................6

Chapter 2: Application of sensor...................................................................9

1. General introduction and practical application...................9

2. General operating principle of the product........................11

Chapter 3: Choose the right equipment......................................................12

1. Temperature sensor DHT11.................................................12

Operating Principle.....................................................................15

Signal conversion principle........................................................17

Typical application......................................................................19

2. Arduino UNO R3...................................................................20

Voltage..........................................................................................22

Function of the pins:...................................................................22

3. Screen LCD 16x2...................................................................25

Functions of pins:........................................................................26

Chapter 4: Device connection and simulation............................................28

Chapter 5: Code for project.........................................................................29

1|P a g e
Chapter 1: Introduction
1. Definition
This DFRobot DHT11 Temperature & Humidity Sensor features a
temperature & humidity sensor complex with a calibrated digital signal
output. By using the exclusive digital-signal-acquisition technique and
temperature & humidity sensing technology, it ensures high reliability and
excellent long-term stability.

Figure 1.1a.

Each DHT11 element is strictly calibrated in the laboratory that is


extremely accurate on humidity calibration. The calibration coefficients are
stored as programmes in OTP memory, which are used by the sensor’s
internal signal detecting process. The single-wire serial interface makes
system integration quick and easy. Its small size, low power consumption and
up-to-20-meter signal transmission making it the best choice for various
applications, including those most demanding ones. The component is 4-pin
single row pin package. It is convenient to connect, and special packages can
be provided according to users’ request.

2|P a g e
Figure 1.1b.

There are two different versions of the DHT11 you might come across.
One type has four pins, and the other type has three pins and is mounted to a
small PCB. The PCB mounted version is nice because it includes a surface
mounted 10K Ohm pull up resistor for the signal line. Here are the pin outs
for both versions:

Figure 1.1c.

3|P a g e
This sensor includes a resistive-type humidity measurement component
and an NTC temperature measurement component, and connects to a high
performance 8-bit microcontroller, offering excellent quality, fast response,
anti-interference ability and cost-effectiveness.

Figure 1.1d.
2. Technical specifications

Overview

Item Measuremen Humidity Temperature Resolutio Package


t Range Accuracy Accuracy n

DHT11 20-90%RH ±5%RH ±2℃ 1 4 Pin


0-50 ℃ Single
Row

4|P a g e
Detailed Specifications:

Parameters Conditions Minimum Typical Maximum


Humidity
Resolution 1%RH 1%RH 1%RH
8 Bit
Repeatability ±1%RH
Accuracy 25℃
0-50℃ ±5%RH
Interchangeability Fully Interchangeable
Measurement 0℃ 30%RH 90%RH
Range 25℃ 20%RH 90%RH
50℃ 20%RH 80%RH
Response Time 1/ 6 10 15
(Seconds) e(63%)25℃,
1m/s Air
Hysteresis ±1%RH
Long-Term Typical ±1%RH/year
Stability
Temperature
Resolution 1℃ 1℃ 1℃
8 Bit 8 Bit 8 Bit
Repeatability ±1℃
Accuracy ±1℃ ±2℃
Measurement 0℃ 50℃
Range
Response Time 1/e(63%) 6 10
(Seconds)

5|P a g e
3. Structure
The DHT11 detects water vapor by measuring the electrical resistance
between two electrodes. The humidity sensing component is a moisture
holding substrate with electrodes applied to the surface. When water vapor is
absorbed by the substrate, ions are released by the substrate which increases
the conductivity between the electrodes. The change in resistance between the
two electrodes is proportional to the relative humidity. Higher relative
humidity decreases the resistance between the electrodes, while lower relative
humidity increases the resistance between the electrodes.
The DHT11 measures temperature with a surface mounted NTC
temperature sensor (thermistor) built into the unit.
With the plastic housing removed, you can see the electrodes applied to
the substrate

Figure 1.3a.
An IC mounted on the back of the unit converts the resistance
measurement to relative humidity. It also stores the calibration coefficients,
and controls the data signal transmission between the DHT11 and the Arduino

6|P a g e
Figure 1.3b.
DHT11 sensors typically require an external 10K pull-up resistor on the
output pin for proper communication between the sensor and the Arduino.
However, because the module already includes a pull-up resistor, you do not
need to add one.

Figure 1.3c.
Single-bus data format is used for communication and synchronization
between UNO and DHT11 sensor. One communication process is about 4ms.
Data consists of decimal and integral parts. A complete data transmission is
40bit, and the sensor sends higher data bit first. Data format: 8bit integral RH
data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data +
8bit check sum. If the data transmission is right, the check-sum should be the
last 8bit of "8bit integral RH data + 8bit decimal RH data + 8bit integral T
data + 8bit decimal T data".

7|P a g e
Figure 1.3d.
The DHT11 sensor consists of a capacitive humidity sensing element
and a thermistor to measure temperature. The capacitive humidity sensor has
two electrodes with a moisture-holding substrate serving as the dielectric
between them. Changes in capacitance occur with variations in humidity
levels. An IC measures and processes these changed resistance values and
converts them into a digital format.
To measure temperature, the sensor uses a thermistor with a negative
temperature coefficient, which reduces its resistance value as the temperature
increases. To achieve a higher resistance value even for the smallest
temperature changes, the thermistor is typically made of semiconductor
ceramics or polymers.
Chapter 2: Application of sensor
1. General introduction and practical application

Temperature is an extremely important factor that affects many aspects


of various fields. Therefore, it is crucial to monitor it closely to adjust the
temperature appropriately for each specific field. In the context of climate
change with unpredictable variations, this has become one of the most
challenging issues. However, with advancements in science and technology, it
is entirely possible to control these indicators. A temperature monitoring
system using Arduino is one of the effective solutions.

What is Arduino, and why did we choose it as the solution for our
laboratory temperature monitoring system? In the simplest terms, Arduino is a

8|P a g e
microcontroller board and an open-source electronics platform, primarily
based on the AVR ATMEGA328P microcontroller. A standout feature of
Arduino is its highly user-friendly development environment, with a
programming language that can be quickly learned even by those with little
knowledge of electronics and programming. Notably, the cost of using
Arduino is very low, and its open-source nature—from hardware to software
—makes it advantageous compared to similar applications.

As a result, Arduino is not only widely applied around the world but is
also increasingly popular in Vietnam, especially in agriculture and industrial
production. This solution is favored by a diverse range of users, from students
and beginners exploring the application of technology in industrial and
agricultural production, to scientists and innovators developing smart
technology products.

In practice, Arduino-based products have become widespread, such as


being used in laboratories or greenhouse projects to facilitate temperature
control. Due to its versatility, Arduino also has many applications in other
fields, such as transportation, industry, agriculture, healthcare, and more.
Below are some typical real-world applications:

Figure 2.1a. Ensure electronic devices operate well

9|P a g e
Figure 2.1b. Early warning to avoid fire and explosion

Figure 2.1c. Environmental monitoring to ensure good plant growth


2. General operating principle of the product

The Arduino-based temperature monitoring system will be installed


using the DHT11 sensor module to measure temperature. The data is then
transmitted by the ATMEGA328P microcontroller to an LCD screen while
simultaneously storing it on a computer. Notably, a default temperature can
be preset according to specific requirements. If the temperature exceeds the
preset limit or deviates from it, the device will issue an alert and activate the
system or motors to balance the temperature.

10 | P a g e
This feature allows for both real-time monitoring and adjustment, as
well as storing essential data for research and tracking purposes. Additionally,
the system can be connected to smartphones or computers, enabling easy
control and the ability to integrate additional accessories or devices to meet
specific needs.

For instance, if the required temperature is set at 25°C, and the


temperature exceeds 25°C, a red LED will flash, signaling an increase in
temperature while the cooling system activates. Conversely, if the
temperature falls below 25°C, a blue LED will flash, indicating a drop in
temperature, and the system will activate a motor to raise the temperature.
This ensures that the temperature remains balanced, facilitating better control
for experiments and research.

In cases where the temperature rises suddenly and shows signs of a


rapid increase, the system’s buzzer will sound to signal a potential fire hazard.

Figure 2.2a. Connect the device to your smartphone

11 | P a g e
Chapter 3: Choose the right equipment
1. Temperature sensor DHT11

Figure 3.1a. Temperature sensor DHT11

The DHT11 is a widely used temperature and humidity sensor due to


its low cost and ease of data acquisition via 1-wire communication (using a
single data wire for transmission). The sensor is integrated with a signal pre-
processing unit, ensuring that the received data is accurate without requiring
any additional calculations.

The DHT11 temperature and humidity sensor consists of three main


components: a resistive humidity sensor, a thermistor (NTC - Negative
Temperature Coefficient) for temperature measurement, and an 8-bit
microcontroller responsible for converting the analog signals from the sensor
into a single digital output. This digital signal can be read by any
microcontroller or processor for analysis.

Figure 3.1b. Microcontroller in DHT11

12 | P a g e
Active voltage 3-5V (DC)
Consumed current 2.5 mA
Area of temper sensor 0-50°C
Size 15.5mm x 12mm x 5.5mm
Max fluency 1Hz means 1s the sensor takes a sample once
Max distance 20m

Figure 3.1c. Pins of DHT11

 VCC pin: This is the power supply pin for the sensor. Although the
supply voltage ranges from 3V to 5V, it is recommended to use a 5V
power supply because, with a 5V power source, the sensor range can be
extended up to 20 meters. For a 3V power supply, the cable length
should not exceed 1 meter; otherwise, voltage drop along the wire will
lead to measurement inaccuracies.
 DATA pin: This pin is used for communication between the sensor and
the microcontroller.
 GND pin: This pin is connected to the ground.
 N/C pin: Not connected.

Operating Principle

13 | P a g e
To measure temperature, these sensors use an NTC thermistor or
temperature sensor. The term "NTC" stands for "Negative Temperature
Coefficient," which means the resistance decreases as the temperature
increases, and vice versa.

 For temperature sensing, it has an NTC(Negative Temperature


Coefficient) temperature sensor (also called a thermistor ) mounted on
the surface inside the plastic casing.
 NTC temperature sensors are variable resistive sensors and their
resistance decreases with an increase in the surrounding temperature.
 Thermistors are designed with the sintering of semiconductor materials,
such as ceramic or polymers and they provide a large change in resistor
with a small temperature change.

Figure 3.1d. The curve representing the characteristics of the thermistor

The DHT11 measures relative humidity. Relative humidity is the


amount of water vapor in air vs. the saturation point of water vapor in air. At

14 | P a g e
the saturation point, water vapor starts to condense and accumulate on
surfaces forming dew.

The saturation point changes with air temperature. Cold air can hold
less water vapor before it becomes saturated, and hot air can hold more water
vapor before it becomes saturated.

The formula to calculate relative humidity is:

Relative humidity is expressed as a percentage. At 100% RH,


condensation occurs, and at 0% RH, the air is completely dry.

Figure 3.1e. Humidity sensor

15 | P a g e
 For Humidity Measurement, it uses a capacitive humidity sensor, which
has two electrodes and a substrate material in between.
 The substrate material is used for holding the moisture on its surface.
 As moisture content changes in our environment, they get saturated on
the substrate material, which in turn changes the resistance between
electrodes.
 This change in electrode resistivity is then calibrated using the humidity
coefficient (saved in OTP memory) and the final relative humidity
value is released.

Signal conversion principle


The DHT11 sends and receives data using a single DATA signal wire.
With this one-wire communication protocol, we must ensure that the DATA
line remains at a high level in idle mode. Therefore, in circuits using the
DHT11, the DATA wire must be connected to an external pull-up resistor
(commonly 4.7kΩ).

The analog signal, which is a voltage variation from the sensor, is


converted into a digital format to be sent to the Arduino microcontroller. The
data is transmitted in a 40-bit frame that corresponds to humidity and
temperature information recorded by the DHT11. The first two 8-bit groups
are for humidity, representing the most significant 16 bits of this frame. Then,
the next two 8-bit groups are for temperature. This means there are two bytes
for humidity and two bytes for temperature. The 40 bits are structured as
follows:

 8 bits representing the integer part of the humidity

 8 bits representing the decimal part of the humidity

16 | P a g e
 8 bits representing the integer part of the temperature

 8 bits representing the decimal part of the temperature

 8 bits for the checksum


Example:

Consider the data received from the DHT11 sensor as:

00100101 00000000 00011001 00000000 00111110

This data can be parsed based on the above structure as follows

To check if the received data is correct, we need to do a small


calculation. Add up all the integer and decimal values of humidity and
temperature and check if the sum is equal to the checksum value, i.e. the last
8 bits of data.

00100101 + 00000000 + 00011001 + 00000000 = 00111110

This value is like 8 bit checksum and hence the data received is valid.
Now to get the humidity and temperature values, just convert the binary data
to decimal data.

Humidity = Decimal value of 00100101 = 37%

Temperature = Decimal value of 00011001 = 250C

17 | P a g e
Typical application

Figure 3.1f.

When the connecting cable is shorter than 20 metres, a 5K pull-up


resistor is recommended; when the connecting cable is longer than 20 metres,
choose a appropriate pull-up resistor as needed.

18 | P a g e
 A pull-up resistance of 5k ohm is recommended to place at the Data Pin
of the DHT11 sensor.
 At normal conditions, the data pin of DHT11 remains at the HIGH
voltage level and the sensor remains in low power consumption mode.
 To receive data from the DHT11 sensor, the microcontroller should
make the Data Pin low for at least 18us, so that the sensor could sense
it.
 Once the DHT11 sensor senses the low signal at the Data Pin, it
changes its state from low power consumption mode to running
mode and waits for the Data Pin to get HIGH.
 As the Data Pin gets HIGH again by the microcontroller, DHT11 sends
out the 40-bit calibrated output value serially.
 After sending the data, DHT11 returns to low power consumption
mode and waits for the next command from the microcontroller.
 The microcontroller has to wait for 20-40us to get a response from the
DHT11 sensor.
2. Arduino UNO R3

Hình 3.2a. Arduino Uno R3

19 | P a g e
Microcontroller ATmega328 (8bit)
Active voltage 5V DC
Fluency 16 MHz
Current consumption 30mA
Advise voltage 7-12V DC
Limit voltage 6-20V DC
Digital I/O pins 14 (6 pins PWM)
Analog pins 6 (resolution 10bit)
Max current per pin I/O 30 mA
Out max current (5V) 500 mA
Out max current (3.3V) 50 mA
Cache flash 32 KB (0,5KB use for bootloader)
SRAM 2 KB
EEPROM 1 KB

The Arduino UNO can utilize three 8-bit AVR microcontrollers:


ATmega8, ATmega168 and ATmega328. This "brain" can handle simple
tasks such as controlling LED blinking, processing signals for remote-
controlled cars, creating a temperature and humidity monitoring station with
data displayed on an LCD, and many other applications.

20 | P a g e
Figure 3.2b. Details of the pins of arduino

Voltage

The Arduino UNO can be powered with 5V through the USB port or
via an external power source with a recommended voltage of 7-12V DC and a
limit of 6-20V. Typically, using a 9V battery is the most reasonable option if
USB power is not available. Supplying power beyond the upper limit will
damage the Arduino UNO.

Function of the pins:

 GND (Ground): The negative terminal of the power supply for the
Arduino UNO. When using devices with separate power sources, these
GND pins must be connected together.

21 | P a g e
 5V: Provides a 5V output voltage. The maximum allowable current on
this pin is 500mA.

 3.3V: Provides a 3.3V output voltage. The maximum allowable current


on this pin is 50mA.

 Vin (Voltage Input): Used for supplying external power to the


Arduino UNO. Connect the positive terminal of the power source to
this pin and the negative terminal to the GND pin. This method is less
commonly used.

 IOREF: This pin allows you to measure the operating voltage of the
microcontroller on the Arduino UNO, which is always 5V. However,
you should not use this pin to draw 5V power, as it is not intended for
power supply purposes.

 RESET: Pressing the reset button on the board to reset the


microcontroller is equivalent to connecting the RESET pin to GND
through a 10kΩ resistor.

22 | P a g e
Figure 3.2c. The input and output pins of arduino
The Arduino UNO has 14 digital pins for reading or outputting signals.
They operate at two voltage levels: 0V and 5V, with a maximum input/output
current of 40mA per pin. Each pin has built-in pull-up resistors in the
ATmega328 microcontroller (these resistors are disabled by default). Some
digital pins have special functions as follows:
 Serial Pins: 0 (RX) and 1 (TX): Used for transmitting (TX) and
receiving (RX) TTL Serial data. The Arduino UNO can communicate
with other devices through these pins. Bluetooth connections, for
instance, are essentially wireless Serial connections. If Serial
communication is not needed, it is recommended not to use these two
pins unnecessarily.
 PWM Pins (~): 3, 5, 6, 9, 10, and 11: These allow for 8-bit PWM
output (values from 0 to 28−1, corresponding to 0V to 5V) using the
analogWrite() function. Simply put, these pins can output adjustable
voltages between 0V and 5V, instead of being fixed at either 0V or 5V
like the other pins.
 SPI Communication Pins: 10 (SS), 11 (MOSI), 12 (MISO), 13
(SCK): In addition to their general-purpose functions, these four pins
are used for data transmission with other devices via the SPI protocol.
 LED 13: The Arduino UNO has an orange LED labeled "L." When the
Reset button is pressed, this LED blinks as an indicator. It is connected
to pin 13. If this pin is used by the user, the LED will light up.
The Arduino UNO also has 6 analog pins (A0 to A5) providing 10-bit
resolution signals (0 to 210-1) for reading voltage values within the range of
0V to 5V. Using the AREF pin on the board, you can supply a reference
voltage for the analog pins. For example, if you supply 2.5V to the AREF
pin, the analog pins can measure voltages in the range of 0V to 2.5V with the

23 | P a g e
same 10-bit resolution. Additionally, the Arduino UNO features A4 (SDA)
and A5 (SCL) pins, which support I2C/TWI communication with other
devices.
3. Screen LCD 16x2
LCD display devices are used in many microcontroller applications and
offer various advantages that make them stand out compared to other display
devices. They can display a wide range of characters in a clear and intuitive
manner (letters, numbers, and graphic symbols, etc.), can be easily integrated
into application circuits in different ways, require minimal system resources,
and are cost-effective.

Figure 3.3a. Screen LCD 16x2


The 16×2 LCD is used to display status or parameters:

 The 16×2 LCD has 16 pins, including 8 data pins (D0 – D7) and 3
control pins (RS, RW, E).

 The remaining 5 pins are used to supply power and backlight for the
16×2 LCD.

 The control pins allow us to easily configure the LCD in command


mode or data mode.

24 | P a g e
 They also help configure the LCD in read or write mode.
The 16×2 LCD can be used in either 4-bit or 8-bit mode, depending on
the application being developed..

Functions of pins:

Figure 4.3b. Detail of the pins of LCD


Pi Symbol Describe
n
1 VSS The ground pin for the LCD is connected to the GND of
the control circuit when designing the circuit.
2 VDD The power supply pin for the LCD is connected to VCC
= 5V of the control circuit when designing the circuit.
3 VEE This pin adjusts the contrast of the LCD.
4 RS The Register Select (RS) pin: Connect the RS pin to
logic "0" (GND) or logic "1" (VCC) to select the register.
+ Logic "0": The bus DB0-DB7 will connect to the
instruction register (IR) of the LCD (in "write" mode) or
to the LCD address counter (in "read" mode).

25 | P a g e
+ Logic "1": The bus DB0-DB7 will connect to the data
register (DR) inside the LCD.
5 RW The Read/Write (R/W) pin: Connect the R/W pin to
logic "0" to set the LCD in write mode, or connect it to
logic "1" to set the LCD in read mode.
6 E The Enable (E) pin: After the signals are placed on the
bus DB0-DB7, the commands are accepted only when a
pulse is sent on the E pin.
+ In write mode: Data on the bus will be accepted by
the LCD into its internal register when a high-to-low
transition is detected on the E pin..
+ In read mode: Data will be output from the LCD to
DB0-DB7 when a low-to-high transition is detected on
the E pin, and the LCD will hold the data on the bus until
the E pin goes low.
7- DB0 - DB7 The eight data lines are used for communication with the
14 MPU. There are two modes for using these eight data
lines: + 8-bit mode: Data is transmitted over all 8 lines,
with the MSB being DB7.
+ 4-bit mode: Data is transmitted over 4 lines from DB4
to DB7, with the MSB being DB7
15 A VCC for the backlight
16 C GND for the backlight

26 | P a g e
Chapter 4: Device connection and simulation

Figure 4.1a.
 Pin 2 (Arduino) connects to the signal pin (pin 2) of the DHT11.
 VCC pin (DHT11) connects to the 5V pin (Arduino).
 GND pin (DHT11) connects to the GND pin (Arduino).
 VCC pin (LCD16x2) connects to the 5V pin (Arduino).
 GND pin (LCD16x2) connects to the GND pin (Arduino).
 SDA pin (LCD16x2) connects to pin A4 (Arduino).
 SCL pin (LCD16x2) connects to pin A5 (Arduino).

Figure 4.1b.

27 | P a g e
Chapter 5: Code for project
The provided code demonstrates how to read data from a DHT11
temperature and humidity sensor and display it on an I2C LCD screen using
an Arduino. Below is the step-by-step explanation of the code:
#include <SimpleDHT.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 SimpleDHT.h: A library for working with DHT11/DHT22 sensors to
read temperature and humidity data.
 Wire.h: Used to communicate with I2C devices.
 LiquidCrystal_I2C.h: A library for controlling I2C-based LCDs.
// for DHT11,
// VCC: 5V or 3V
// GND: GND
// DATA: 2
int pinDHT11 = 2;
SimpleDHT11 dht11(pinDHT11);
 pinDHT11: Specifies the pin connected to the DATA pin of the
DHT11 sensor (pin 2 in this case).
 dht11: Creates an instance of the SimpleDHT11 object to interface
with the sensor.
LiquidCrystal_I2C lcd(0x27, 16, 2);
 0x27: The I2C address of the LCD module. This may vary depending
on the LCD hardware.
 16, 2: Specifies that the LCD has 16 columns and 2 rows.
void setup()
{
Serial.begin(115200);

28 | P a g e
}
 Starts the Serial communication at 115200 baud rate, which is used for
debugging and printing messages to the Serial Monitor.
void loop() {
// start working...
Serial.println("=================================");
Serial.println("Sample DHT11...");
 Prints a separator (====) and a message indicating the sampling
process of the DHT11 sensor.
// read without samples.
byte temperature = 0;
byte humidity = 0;
int err = SimpleDHTErrSuccess;
if ((err = dht11.read(&temperature, &humidity, NULL)) !=
SimpleDHTErrSuccess)
{
Serial.print("Read DHT11 failed, err=");
Serial.println(err);delay(1000);
return;
}
 temperature and humidity store the readings from the DHT11 sensor.
 dht11.read(): Reads temperature and humidity. It returns
SimpleDHTErrSuccess if successful.
 If the reading fails, an error message is displayed, and the loop exits
using return.
lcd.begin();
// Turn on the blacklight and print a message.
lcd.backlight();

29 | P a g e
lcd.print("tempature ");
lcd.print((int)temperature);
lcd.setCursor(0, 1);
lcd.print("humidity ");
lcd.print((int)humidity);
 lcd.begin(): Initializes the LCD.
 lcd.backlight(): Turns on the LCD backlight.
 Displays "temperature" and its value on the first row of the LCD.
 Displays "humidity" and its value on the second row of the LCD.
delay (1000);
}
 Wait for 1 second (1000 milliseconds) before taking the next reading.

Chapter 6: Measurement results and noise calculation


Times Temperature Temperature Humidity Humidity
(Ađo, °C) deviation (Ađo, %RH) deviation
(Ađo − A , °C) (Ađo − A , %RH)
1 30.3 70%
2 30.1 69%
3 30.1 69%
4 30.1 70%
5 30.2 70%
6 30.1 70%
7 30.2 69%
8 30.0 69%
9 30.1 71%
10 30.2 71%

1. Temperature:

30 | P a g e
n

Average: A =
∑ Ai = ❑
i=1 10
n


n
( A¿¿ i− A ¿)
Standard deviation: σ = ∑ n
¿¿ =
i=1

2. Humidity:
20

Average: A =
∑ Ai = ❑
i=1 10
10


n
( A¿¿ i− A ¿)
Standard deviation: σ = ∑ n
¿¿ =
i=1

Conclusion:
 Temperature:
 Average value: °C
 Standard deviation: °C
 The noise level is low, indicating that DHT11 operates stably in a
consistent environment.
 Humidity:
 Average value: %RH
 Standard deviation: %RH
 The noise level is also low and within the acceptable range.

31 | P a g e
32 | P a g e
33 | P a g e

You might also like