Humidity and Temp. Sensing Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

KARMAVEER KAKASAHEB WAGH INSTITUTE OF

ENGINEERING EDUCATION AND RESEARCH

MINI PROJECT REPORT


ON

“Digital Humidity and Temperature Sensing using Atmega328”

Submitted by

Chaitali Kailas Joshi(T1901303015)


Snehal Vaijnath Kamthekar (T1901303016)
Ankita Avinash Naik (T1901303024)

DEPARTMENT OF ELECTRONICS AND


TELECOMMUNICATION ENGINEERING

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:

Chaitali Kailas Joshi(T1901303015)


Snehal Vaijnath Kamthekar (T1901303016)
Ankita Avinash Naik (T1901303024)

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.

Prof. P.J.Mondhe Prof. Dr. D. M. Chandwadkar Prof. Dr. K.N. Nandurkar

Project Guide H.O.D. Principal


ACKNOWLEDGMENT

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:

1. Chaitali Kailas Joshi


2. Snehal Vaijnath Kamthekar
3. Ankita Avinash Naik
ABSTRACT

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

Ch. Content Page no


No

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.

The report will provide a comprehensive overview of the design,


implementation, and evaluation phases of the sensor system. It will delve into
critical aspects such as sensor calibration techniques, data processing
algorithms, hardware-software integration methodologies, and performance
evaluation procedures. Through this project, we aim to demonstrate the
practicality of developing sensor solutions leveraging off-the-shelf components
and microcontroller platforms. Such solutions hold promise in addressing the
escalating demand for cost-effective and reliable environmental monitoring
systems across diverse domains.

1
Literature Survey

The field of environmental sensing, particularly in the realms of humidity and


temperature monitoring, has witnessed significant advancements driven by both
academic research and industrial applications. A review of the existing literature
reveals a wealth of knowledge and innovative approaches aimed at addressing
the challenges associated with sensor design, calibration, and deployment.

1. Sensor Technologies: Various sensor technologies have been explored for


humidity and temperature measurement, each with its advantages and
limitations. Capacitive, resistive, and semiconductor-based sensors are
among the most commonly utilized technologies. Capacitive sensors, in
particular, offer high sensitivity and stability, making them suitable for
precise humidity measurements. However, they may require complex
signal processing algorithms for accurate readings. Resistive sensors, on
the other hand, are relatively simple and cost-effective but may exhibit
lower accuracy and stability compared to capacitive sensors.
Semiconductor-based sensors, such as the DHT11 module, offer a
balance between cost, performance, and ease of integration, making them
popular choices for practical applications.

2. Microcontroller Platforms: The choice of microcontroller platform


significantly influences sensor system design and implementation. While
numerous microcontrollers are available, certain platforms, like the
ATmega328P, offer a blend of affordability, versatility, and ease of
programming, making them well-suited for embedded applications. Past
research has showcased successful sensor system implementations using
ATmega328P microcontrollers for various environmental monitoring
tasks, highlighting their reliability and scalability.

3. Calibration Techniques: Accurate calibration is essential for ensuring the


reliability and precision of sensor measurements. Literature on calibration
techniques for humidity and temperature sensors encompasses both
laboratory-based methods and in-situ calibration procedures. Laboratory
calibration typically involves subjecting sensors to controlled
environmental conditions and comparing their outputs against reference
standards. In-situ calibration, on the other hand, involves adjusting sensor
readings based on real-world observations, taking into account factors
such as drift and environmental variability.

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.

5. Applications and Case Studies: Literature abounds with examples of


realworld applications of humidity and temperature sensor systems across
various sectors. From industrial automation and agriculture to healthcare
and building management, sensor-based solutions have demonstrated
their utility in optimizing processes, enhancing productivity, and ensuring
safety and comfort. Case studies showcasing successful deployments of
sensor networks provide valuable insights into the practical challenges
and opportunities in implementing environmental monitoring systems.

Overall, the literature survey underscores the interdisciplinary nature of


environmental sensing, encompassing aspects of sensor technology,
microcontroller platforms, calibration techniques, data processing, and real-
world applications. By leveraging insights from existing research and
innovative approaches, this project aims to contribute to the ongoing efforts in
developing cost-effective and reliable sensor solutions for humidity and
temperature monitoring.

3
System Details

3.1 Project Specifications

1. Atmega 328p Microcontroller: The ATmega328P microcontroller


will serve as the central processing unit for data acquisition,
processing, and interfacing. Its widespread availability, low cost, and
compatibility with Arduino IDE make it an ideal choice for this
project. Additionally, its ample memory and I/O capabilities allow
for efficient handling of sensor data and communication tasks.

fig: Atmel 89C51

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

3. Analog-to-Digital Converter (ADC): The analog output signals from


the DHT11 module are converted into digital format using an
internal or external analog-to-digital converter (ADC) integrated
with the ATmega328P microcontroller. This conversion process
enables the microcontroller to process and analyze the sensor data
accurately.

4. User Interface: The sensor system features a user interface


component, typically a 16x2 LCD display, which provides a
convenient means of visualizing sensor readings and interacting with
the system. The LCD display presents the measured humidity and
temperature values in a user-friendly format, allowing users to
monitor environmental conditions easily. Additionally, user
interaction may be facilitated through buttons or other input devices
for configuration and control purposes.

fig: 16x2 LCD Display

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:

16Mhz Crystal Oscillator

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. Enclosure and Mounting: To protect the system components from


environmental factors and facilitate installation, the sensor system
may be housed in a sturdy enclosure. The enclosure provides
physical protection against dust, moisture, and mechanical damage,
ensuring the longevity of the system. Mounting options such as
wallmounting brackets or DIN rails may be incorporated to simplify
installation in various environments

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

1. LCD Display Block:


● Requirement: The LCD display block is required to present
temperature and humidity readings obtained from the
DHT11 sensor module in a user-friendly format.
● Design Considerations:
● Compatibility: The LCD display should be compatible with
the microcontroller used in the system (Atmega 328p).
● Size and Form Factor: The display should be compact and
suitable for integration into the overall system design.
● Visibility: The display should have sufficient contrast and
backlighting for clear visibility in different lighting
conditions.
● Options Available:
● Character LCD: 16x2 or 20x4 character LCD displays are
commonly used in embedded systems.
● Graphic LCD: Offers more flexibility in displaying graphical
elements, but may not be necessary for this application.
● Selected Option with Justification:
● Character LCD: A 16x2 character LCD display was selected
for its simplicity, cost-effectiveness, and suitability for
displaying temperature and humidity readings in a concise
format.
● Design Details:
● Component Selection: HD44780-based 16x2 character LCD
display.
● Connection to Microcontroller: Parallel interface connection
using 4-bit mode for data transfer.
● Power Supply: Typically requires +5V and GND
connections.
● Contrast Adjustment: Potentiometer connected to adjust the
contrast of the display.
2. DHT11 Sensor Block:
● Requirement: The DHT11 sensor block is required to
measure humidity and temperature in the surrounding
environment.
● Design Considerations:
● Accuracy: The sensor should provide accurate and reliable
measurements within the specified range.

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 <dht.h> dht


DHT;
#define DHT_PIN 17

#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);

int t = DHT.temperature; int h


= DHT.humidity;
Serial.print("Temperature = ");
Serial.print(t);
Serial.print(", Humidity = ");
Serial.print(h);

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:

● Home Automation: The system can be used in home automation


projects to monitor indoor environmental conditions such as
temperature and humidity. It can trigger actions such as turning on
fans or dehumidifiers based on predefined thresholds, improving
comfort and energy efficiency.
● Greenhouses and Agriculture: In agricultural settings, the system
can monitor temperature and humidity levels in greenhouses to
optimize growing conditions for plants. It can help farmers prevent
crop damage due to extreme weather conditions and ensure optimal
plant growth.
● Weather Stations: The system can be deployed as part of a weather
station to monitor local weather conditions. It can provide real-time
23
data on temperature and humidity, which can be used for weather
forecasting, research, and educational purposes.
● HVAC Systems: The system can be integrated into heating,
ventilation, and air conditioning (HVAC) systems in buildings to
monitor indoor environmental parameters. It can help HVAC
technicians optimize system performance, improve energy
efficiency, and maintain indoor air quality.
● Industrial Monitoring: In industrial environments, the system can
be used to monitor temperature and humidity levels in
manufacturing facilities, warehouses, and storage areas. It can help
prevent equipment malfunction, product spoilage, and damage to
sensitive materials.
● Educational Projects: The simplicity and affordability of the system
make it suitable for educational projects and workshops aimed at
teaching students about microcontroller programming, sensor
interfacing, and environmental monitoring concepts.
sensor interfacing, and environmental monitoring concepts.

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.

Firstly, its cost-effectiveness makes it accessible to a wide range of


users, from hobbyists to professionals, allowing for affordable
implementation in various projects. Additionally, the compact design
and low power consumption of the system components enhance its
suitability for both portable and stationary applications.

Furthermore, the ease of implementation and integration simplifies the


development process, reducing time-to-market and making it an
attractive choice for educational purposes and rapid prototyping. The
system's reliability and accuracy ensure dependable performance
across different environments, enhancing its applicability in diverse
scenarios.

With its ability to monitor temperature and humidity levels in real-


time, the system finds applications in fields such as home automation,
agriculture, weather monitoring, HVAC systems, industrial
monitoring, and educational projects. Its versatility and effectiveness
make it a valuable tool for addressing environmental monitoring
challenges and fostering innovation in various domains.

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

You might also like