Humidity and Temp. Sensing Report
Humidity and Temp. Sensing Report
Humidity and Temp. Sensing Report
Submitted by
YEAR 2024-2025
KARMAVEER KAKASAHEB WAGH INSTITUTE OF
ENGINEERING EDUCATION AND RESEARCH
CERTIFICATE
This is to certify that the project work titled “Digital Humidity and
Temperature Sensing using Atmega328”, has been successfully completed
during the academic year of 2024-2025 by the following students:
This project conforms to the standards laid down by SPPU and has been
completed in satisfactory manner as a partial fulfillment for the bachelor‘s
degree in Electronics & Telecommunication Engineering, SPPU.
We would like to thank our Head of Department, Prof. Dr. D. M. Chandwadkar for all the
guidance and help provided to us for this project. We express our humble gratitude for being
with us and for all the help needed.
We would extend deep gratitude towards Prof. Dr. S. A. Patil (Ugale) for guidance and
selection of our project. Madam has given us very important guide lines that helped us for
strengthening the objective of our project.
Finally, we would like to express our sincere gratitude towards Prof. P.J. Mondhe for
helping us to complete our project.
Name of student:
This report delineates the conception, execution, and evaluation of a digital humidity and
temperature sensing solution employing the DHT11 module interfaced with an Atmega328
microcontroller. With a primary focus on affordability and dependability, the project involved
meticulous calibration of sensor readings, efficient analog-to-digital conversion techniques,
and robust data transmission protocols. Hardware-software integration constituted a
significant aspect of implementation, encompassing sensor interfacing and microcontroller
programming to ensure seamless operation.
Evaluation efforts concentrated on assessing the system's accuracy, reliability, and precision
across a spectrum of environmental conditions. The project's success underscores the viability
of leveraging the DHT11 module and the Atmega328 microcontroller to engineer a versatile
sensor system applicable across domains such as environmental monitoring, industrial
automation, and residential management. This endeavor not only showcases the feasibility of
cost-effective sensor solutions but also underscores their potential impact in addressing
realworld challenges.
CONTENT
1 Introduction 1
2 Literature Survey 2
3 System Details 4
3.1 Project Specifications 4
3.2 Block Diagram 9
3.3 Description of blocks / functional details of each block 10
4 4.1 Hardware design/ Design of various blocks 11
4.2 Software 14
4.3 PCB design 17
4.4 Enclosure Design 18
5 Testing 19
6 Results 20
7 Advantages and Applications 21
8 Conclusion 23
9 Future Scope 24
10 References 25
Introduction
In today's interconnected world, the need for accurate and cost-effective sensor
systems for monitoring environmental parameters like humidity and
temperature is increasingly vital. These systems are integral to a wide array of
applications, spanning from industrial processes optimization to ensuring
comfort and safety in residential settings. However, striking a balance between
affordability and reliability remains a challenge in the development of such
sensor solutions.
In this context, this report outlines the development of a digital humidity and
temperature sensor system, utilizing the DHT11 module interfaced with an 8051
microcontroller. The project's core objective is to engineer a sensor system that
is not only economically viable but also robust and user-friendly. By harnessing
the capabilities of the 8051 microcontroller and the simplicity of the DHT11
module, the endeavor seeks to deliver a solution capable of accurately
measuring humidity and temperature while ensuring accessibility to a broad
spectrum of users.
1
Literature Survey
2
4. Data Processing and Analysis: Effective data processing and analysis
techniques are indispensable for extracting meaningful insights from
sensor data. Signal processing algorithms, statistical methods, and
machine learning techniques have been employed for data filtering, trend
analysis, and anomaly detection in environmental sensor networks. These
techniques play a crucial role in enhancing the reliability and utility of
sensor systems in diverse applications.
3
System Details
2. DHT11 Sensor Module: The heart of the system is the DHT11 sensor
module, which integrates both humidity and temperature sensing
capabilities into a single device. The module employs a capacitive
humidity sensor and a thermistor to measure relative humidity and
temperature, respectively. It provides digital output signals that can
be easily interfaced with microcontrollers for data acquisition.
4
fig: DHT11 Sensor
5
5. 16 MHz Crystal Oscillator: The 16 MHz crystal oscillator provides
the clock signal necessary for timing and synchronization of the
microcontroller's operations. It ensures precise timing accuracy,
enabling the microcontroller to execute instructions and perform
tasks at the required intervals. The crystal oscillator's stable
frequency contributes to the overall reliability and performance of
the sensor system.
fig:
6. Power Supply: A stable and reliable power supply is essential for the
proper operation of the sensor system. The power supply circuitry
ensures that all components receive the necessary voltage and current
levels for optimal performance. This may involve voltage regulation,
filtering, and protection mechanisms to safeguard against voltage
fluctuations and electrical noise.
6
fig: 5v Power Adapter
7
fig: 40 Pin DIP IC Socket Base Adaptor
These system components work synergistically to create a comprehensive
digital humidity and temperature sensor system capable of accurately measuring
environmental parameters and providing valuable insights for a wide range of
applications.
8
3.2 Block Diagram
LCD Display:
● This block represents the LCD display module used in the
system.
● The LCD display is responsible for presenting the temperature
and humidity readings obtained from the DHT11 sensor in a
userfriendly format.
● It provides visual feedback to the user, allowing easy monitoring
of environmental conditions.
9
DHT11:
● This block represents the DHT11 sensor module.
● The DHT11 sensor measures humidity and temperature in the
surrounding environment.
● It communicates with the microcontroller to provide sensor data,
which is then processed and displayed on the LCD display.
Crystal Oscillator:
● This block represents the crystal oscillator component.
● The crystal oscillator generates a stable clock signal required for
the operation of the microcontroller.
● It ensures precise timing and synchronization of the
microcontroller's operations, facilitating accurate data
processing and system functionality.
10
4.1 Hardware design/ Design of various blocks
11
● Interface: The sensor should have a simple digital interface
for easy integration with the microcontroller.
● Power Consumption: Low power consumption is desirable to
minimize energy usage and extend battery life.
● Options Available:
● DHT11: Low-cost digital sensor with integrated humidity
and temperature sensing capabilities.
● DHT22: Higher accuracy and wider measurement range
compared to DHT11, but at a higher cost.
● Selected Option with Justification:
● DHT11: Chosen for its affordability, simplicity, and adequate
performance for the intended application. While the DHT22
offers higher accuracy, the DHT11 meets the project
requirements at a lower cost.
● Design Details:
● Component Selection: DHT11 sensor module with integrated
humidity and temperature sensors.
● Connection to Microcontroller: Single-wire digital interface
for communication with the microcontroller.
● Power Supply: Typically operates at +5V DC with low
power consumption.
● Measurement Range: Humidity range of 20% to 90% RH,
temperature range of 0°C to 50°C.
3. Crystal Oscillator Block:
● Requirement: The crystal oscillator block is required to
provide a stable clock signal for timing and synchronization
of microcontroller operations.
● Design Considerations:
● Frequency: The oscillator frequency should match the
operating frequency of the microcontroller.
● Stability: The oscillator should provide stable and accurate
timing to ensure reliable operation of the system.
● Options Available:
● 16 MHz Crystal Oscillator: Commonly used frequency for
microcontrollers such as PIC16F877A.
● Other Crystal Frequencies: Different crystal frequencies are
available depending on the specific microcontroller and
application requirements.
● Selected Option with Justification:
● 16 MHz Crystal Oscillator: Selected based on compatibility
with the PIC16F877A microcontroller, which typically
operates at frequencies in the range of 1-20 MHz’s The 16
12
MHz frequency provides a balance between speed and power
consumption for the microcontroller.
● Design Details:
● Component Selection: 16 MHz crystal oscillator with
appropriate load capacitance.
● Connection to Microcontroller: Connected to the
microcontroller's oscillator pins (OSC1 and OSC2) for clock
signal input.
● Stability: Stable operation ensured by proper circuit layout
and decoupling capacitors.
13
4.2 Software Algorithm:
1. Include Libraries:
Import the necessary libraries for interfacing with the DHT
sensor (dht.h) and the Liquid Crystal display (LiquidCrystal.h).
These libraries provide predefined functions and data structures
to facilitate communication with the respective hardware
components.
2. Define Pins:
Define the pin connected to the DHT sensor (DHT_PIN) and
specify the pins connected to the Liquid Crystal display. This
step ensures that the Arduino knows which physical pins are
used for communication with the sensor and the display.
3. Setup Function:
● Initialize Serial Communication: Start serial communication
with the default baud rate of 9600 baud. This enables
communication between the Arduino board and the computer,
allowing debugging messages to be sent to the serial monitor.
● Initialize Liquid Crystal Display: Create an instance of the
Liquid Crystal class, specifying the pins connected to the display
and its dimensions (16 columns by 2 rows). This initializes the
display for further use.
● Display Welcome Message: Clear the display and set the cursor
to the first column of the first row. Print a welcome message,
such as "WELCOME...", to greet the user upon powering up the
system.
4. Loop Function:
Read Sensor Data: Call the read11() function of the DHT object
to read data from the DHT sensor connected to the specified pin
(DHT_PIN). Store the result in the Ch variable, which indicates
the success of the sensor reading operation.
14
Delay for Sensor Stabilization: Pause execution for 100
milliseconds to allow the sensor to stabilize after reading data.
This ensures accurate and reliable sensor readings by giving the
sensor sufficient time to settle.
Print Sensor Readings to Serial Monitor: Output the temperature
and humidity readings obtained from the sensor to the serial
monitor. This allows real-time monitoring and debugging of
sensor data through the Arduino IDE.
Store Sensor Readings: Extract the temperature and humidity
readings from the DHT object and store them in variables t and
h, respectively. These variables hold the current sensor readings
for further processing and display.
Update LCD Display: Clear the Liquid Crystal display and set
the cursor to the desired position for printing sensor data. Print
the temperature and humidity readings on the display, along with
appropriate labels and units, to provide visual feedback to the
user.
Delay Before Next Iteration: Pause execution for 1 second (1000
milliseconds) before restarting the loop. This delay controls the
update rate of the sensor readings on the display, preventing
rapid flickering and providing a smoother user experience.
5. End of Loop Function: This marks the end of the loop function,
and the Arduino sketch continues to loop indefinitely,
continuously reading sensor data and updating the display as per
the defined logic.
Code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 6, 7, 8);
15
void setup()
{ Serial.begin(9600);
lcd.begin(16, 2); lcd.clear();
lcd.setCursor(0, 0);
lcd.print("WELCOME...");
// lcd.setCursor(0, 1);
// lcd.print("___________");
}
void loop()
{
int chk = DHT.read11(DHT_PIN);
delay(100);
Serial.print("Temperature = ");
Serial.println(DHT.temperature);
Serial.print("Humidity = ");
Serial.println(DHT.humidity);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temperature=");
lcd.print(t);
lcd.print((char)223);
lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Humidity=");
lcd.print(h); lcd.print("%");
delay(1000);}
16
4.2 PCB design
17
18
19
Fig: Circuit Diagram
5. Testing
20
6. Results
21
Advantages:
22
● Cost-Effectiveness: The use of a DHT11 sensor module, 16x2 LCD
display, and a 12 MHz crystal oscillator offers a costeffective
solution for measuring temperature and humidity in various
environments. These components are readily available and
affordable, making the system accessible for a wide range of
applications.
● Ease of Implementation: The chosen components have simple
interfacing requirements and are easy to integrate with the
PIC16F877A microcontroller. This simplifies the hardware design
process and reduces development time, making it suitable for
hobbyists, students, and DIY enthusiasts.
● Compact Design: The compact form factor of the system
components allows for space-efficient implementation in
embedded systems, IoT devices, and portable gadgets. This makes
it suitable for applications where size and weight constraints are
important considerations.
● Low Power Consumption: The selected components, including the
DHT11 sensor module and LCD display, are designed for low
power consumption. This ensures energy efficiency, making the
system suitable for battery-powered applications such as remote
environmental monitoring or portable weather stations
Applications:
Conclusion
24
In summary, the developed digital humidity and temperature sensor
system represents a versatile and practical solution for environmental
monitoring tasks. By leveraging the PIC16F877A microcontroller
along with readily available components such as the DHT11 sensor
module, LCD display, and crystal oscillator, the system offers several
notable advantages.
Future Scope:
25
1. Enhanced Functionality: The system can be expanded to
incorporate additional sensors for measuring parameters such as
air quality, light intensity, or soil moisture. This would provide
more comprehensive environmental monitoring capabilities for a
wider range of applications.
2. Wireless Connectivity: Integration of wireless communication
modules such as Wi-Fi or Bluetooth would enable remote
monitoring and control of the sensor system. Users could access
real-time data and receive alerts on their smartphones or other
devices, enhancing convenience and accessibility.
3. Data Logging and Analysis: Implementing data logging
capabilities would allow the system to store historical sensor
readings for analysis and trend prediction. This feature could be
utilized in research, predictive maintenance, or environmental
modeling applications.
4. Cloud Integration: Integration with cloud platforms such as
AWS IoT or Google Cloud IoT would enable scalable data
storage, analysis, and visualization. This would facilitate data
sharing, collaboration, and integration with other cloud-based
services and applications.
5. Energy Harvesting: Exploring energy harvesting techniques such
as solar or thermal energy harvesting could enable self-powered
operation of the sensor system, reducing reliance on external
power sources and enhancing autonomy.
References:
1. https://www.alldatasheet.com/view.jsp?Searchword=89c51
26
%20datasheet&gad_source=1&gclid=CjwKCAjwrcKxBhB
MEiwAIVF8rGX1SqwKwNg9993fmqDmte3cX9YTqivqlngb
I6gCi2fhQoJKGWwz-hoCJusQAvD_BwE
2. https://www.alldatasheet.com/view.jsp?Searchword=Dht11
%20datasheet&gad_source=1&gclid=CjwKCAjwrcKxBhB
MEiwAIVF8rB2o_lcipyioZWtoFiXWDsEyggvweckDdoYQDZCcwq
s8qYZSaRBBoCQdQQAvD_BwE
3. https://www.vishay.com/docs/37484/lcd016n002bcfhet.pdf
Appendix
1. Bill of Material
27
2. Datasheets Atmega 328p:
https://www.alldatasheet.com/datasheetpdf/pdf/241077/
ATMEL/ATMEGA328P.html
DHT11:
https://www.alldatasheet.com/datasheet-pdf/pdf/1132088/ETC2/DHT11.html
16 x2 LCD Display:
https://www.vishay.com/docs/37484/lcd016n002bcfhet.pdf
28