Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING
PASCHIMANCHAL CAMPUS, POKHARA
Lamachaur, Pokhara-16

A MINOR PROJECT REPORT ON

“Temperature and Humidity Monitoring and Automation”

Submitted by:
Prakash Panta (PAS074BEX028)
Sajan Oli (PAS074BEX033)
Sher Singh Dhami (PAS074BEX039)
Sudip Raj Aryal (PAS074BEX045)

Submitted to:
Department of Computer and Electronics Engineering
Paschimanchal Campus
Falgun,2077

I
TEMPERATURE AND HUMIDITY MONITORING AND
AUTOMATION

Supervised by:

Hom Nath Tiwari

…………………………..
(Designation of supervisor)

A MINOR PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF THE


REQUIREMENT FOR THE DEGREE OF BACHELOR IN ELECTRONICS AND
COMMUNICATION ENGINEERING

Submitted to:

Department of Computer and Electronics Engineering


Paschimanchal Campus
Lamachaur, Pokhara -16

Falgun, 2077

II
ACKNOWLEDGEMENT

We would like to express our deepest appreciation to all those who provide us the possibility
to complete this report. It give us immense pleasure to express our deep sense of gratitude to
our supervisor Mr. Hom Nath Tiwari for his invaluable guidance, motivation, constant
inspiration and above all for his ever-co-operating attitude that enabled us in bringing up this
report in the present form. We are extremely thankful to Mr. Hari Prasad Baral, Head of the
Department of Electronics and Communication Engineering for all kinds of possible help and
advice during the course of this work.

III
ABSTRACT

This project designs an internet of things-based temperature & humidity monitoring and
automatic control system in the key areas like ICU, pharmacy and operation room etc, where
both the temperature and humidity must be monitored and controlled. Similarly this system
can be implemented on various manufacturing plant where temperature and humidity plays a
key role like chocolate industry. It is also useful in the various field like farming for the
analysis of temperature and humidity. In every temperature and humidity acquisition node, the
collected environmental data about the indoor humidity and temperature will be sent over the
DHT11 sensor network to the internet of things (IOT) gateway, through which data will be
uploaded via micro controller connected with the WIFI module and the proper steps can be
taken on the basis of the data presented. The real time data of temperature and humidity of any
closed system is presented in website which can be view form anywhere at any time. In this
project NodeMCU control the fan and heater of the system through relay. Relay acts as a
switch to on and off the fan and heater. If temperature is less than the desired value then
nodeMCU trigger on the heater through the relay and if the temperature is greater than desired
value than fan is on. By this process the temperature and humidity of any closed system is
monitor and controlled.

IV
ABBREVATION AND ACRONYMS
IOT – Interenet of things
NodeMCU- Node MicroController Unit
HTTP – Hypertext Markup Language
REST - Representational State Transfer
API – Application Programming Interface
CSS – Cascading Style Sheets
JSON – JavaScript Object Notation

V
TABLE OF CONTENTS

Chapter 1: INTRODUCTION
1.1 Overview
1.2 Objective
1.3 Hardware Components 1
1.3.1 Node MCU
1.3.2 DHT 11
1.3.3 Jumper Wires
1.3.4 Bread Board
1.3.5 Nichrome Wire
1.3.6 Simple DC Motor
1.3.7 Fan
1.3.8 USB Cable
1.3.9 Two Channel Relay
1.4 Software Requirements Tools

Chapter 2: LITERATURE REVIEW

Chapter 3: METHODOLOGY
3.1 Project Development
3.2 Block Diagram
3.3 Flow Chart
3.4 Circuit Diagram and Explanation

Chapter 4: OUTPUT

VI
Chapter 5: CONCLUSION AND FUTURE WORK
5.1 Results
5.2 Conclusions
5.3 Future Work

VII
VIII
CHAPTER 1. INTRODUCTION

1.1. Overview:
In the various field of production, health care and storage center we have to control the
temperature and humidity which is tedious job to watch and control every time manually. This
results in the unnecessary waste of time and not accurate at all.

Our project entitled ‘Temperature and Humidity Monitoring System’ is a project that measures
the temperature and humidity of the indoor environment with the help of DHT11 sensor and
with the help of the micro controller and wifi (ESP8266) module. It presents the data in the
IOT(Internet of Things) platform and also automate the system . The main aim of the project
is to make the effective monitoring of the temperature and humidity in those indoor
environment and automate the system where the precision in the temperature and humidity is
needed like medicine manufacturing plant, chocolate manufacturing plant, hospitals etc.

1.2. Objective:
Our project on ‘Temperature and Humidity monitoring system’ is based upon providing the
assistance on monitoring and automating temperature and humidity in the multiple sectors.
The main objective of this project will be:

To monitor the humidity and temperature of the closed environment and ensure it’s
effective controlling.

1.3 Hardware Components Required:


Our project temperature and humidity monitoring and control system has the following main
components:
NodeMCU
DHT11
Jumper wires

1
Breadboard
Nichrome wire
Simple dc motor
Fan
USB type B cable
Two channel relay

1.3.1. NodeMCU
The NodeMCU ESP8266 development board comes with the ESP-12E module containing
ESP8266 chip having Tensilica Xtensa 32-bit LX106 RISC microprocessor. This
microprocessor supports RTOS and operates at 80MHz to 160 MHz adjustable clock
frequency. NodeMCU has 128 KB RAM and 4MB of Flash memory to store data and
programs. Its high processing power with in-built Wi-Fi / Bluetooth and Deep Sleep Operating
features make it ideal for IoT projects.

(1.3.1.): NodeMCU ESP8266 Pinout

2
1.3.2. DHT11 Sensor
The DHT11 is a commonly used temperature and humidity sensor. The sensor 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 sensor is also factory calibrated and hence easy to
interface with other microcontrollers.
The sensor can measure temperature from 0°C to 50°C and humidity from 20% to 90% with
an accuracy of ±1°C and ±1%. The sampling rate of this sensor is 1Hz .i.e. it gives one reading
for every second. DHT11 is small in size with operating voltage from 3 to 5 volts. The
maximum current used while measuring is 2.5mA.

fig(2.2.2): DHT11 sensor

1.3.3. Jumper wires


Jumper wires are simply wire that have connector pins at each end, allowing them to be used
to connect two points to each other without soldering. Jumper wires are typically used with
breadboards and other prototyping tools in order to make it easy to change a circuit as needed.
Jumper wires typically come in three versions: male-to-male, male-to-female and female-to-
female. The difference between each is in the end point of the wire. Male ends have a pin
protruding and can plug into things, while female ends do not and are used to plug things into.

3
Fig (1.3.3.): Jumper wires

1.3.4. Breadboard:
A breadboard is a solder less device for temporary prototype with electronics and test circuit
designs. Most electronic components in electronic circuits can be interconnected by inserting
their leads or terminals into the holes and then making connections through wires where
appropriate. The breadboard has strips of metal underneath the board and connect the holes on
the top of the board. The metal strips are laid out as shown below. Note that the top and
bottom rows of holes are connected horizontally and split in the middle while the remaining
holes are connected vertically.

Fig(1.3.4): Bread Board

1.3.5. Nichrome wire


Nichrome wire is used as a heating element because it is very stable, even at high temperatures.
Unlike other metals, it will not melt even when generating large amounts of heat. Ironically,
nichrome actually has low electrical resistance, the property that causes the wire to heat.

4
Fig (1.3.5): Nichrome wire

1.3.6 DC motor
Generally, dc motor is a machine that converts electrical energy into mechanical energy, and
uses the electricity generated to produce rotational motion and thereby to do work. They are
electric motor driven by direct current(DC).

Fig (2.2.6): DC motor

5
1.3.7. Simple fan
A simple fan made up of plastic is used in our project in accordance to cool the setup room
and maintain the temperature constant. The fan rotate in high speed and blows air which cools
the required area.

Fig (2.2.7): Simple plastic fan

1.3.8. USB Cable


The term USB stands for "Universal Serial Bus". USB cable assemblies are some of the most
popular cable types available, used mostly to connect computers to peripheral devices such as
cameras, camcorders, printers, scanners, and more. In our project we use USB cable to power
NodeMCU, motor and heater.

Fig (1.3.8): USB cable

6
1.3.9. Two channel relay
A relay is an electromagnetic switch operated by a relatively small current that can control
much larger current. Two channel relay is a relay interface board, it can be controlled directly
by a wide range of microcontrollers such as Arduino, AVR, PIC, ARM and so on. It uses a low
level triggered control signal (3.3-5VDC) to control the relay. Triggering the relay operates the
normally open (NO) or normally closed (NC) contacts. It is frequently used in an automatic
control circuit. To put it simply, it is an automatic switch to control a high-current circuit with
a low-current signal.5V relay signal input voltage range, 0-5V. VCC power to the system. JD-
VCC relay in the power supply. JD-VCC and VCC can be a shorted.

Fig(2.2.9): Two channel relay

1.4. Software Tools Requirements


The project uses the following software tools:
1.4.1. Django
Django is the tool for the back end programming. It is the python based free and open source
web framework. It also provides the inbuilt database db.squilite3 which we are using to store
the sensor data.

7
1.4.2. Asynchronous JavaScript
Asynchronous JavaScript is used to update the data to the web page in the real time. It fetches
the data from the database and updates the data without refreshing of the page.

1.4.3. PythonAnyWhere
PythonAnyWhere is a platform as a service that enables developers to build, run and
applications entirely in the cloud.

1.4.4. HTML
Html is used to define the structure and layout of a Web document by using a variety of tags
and attributes.

1.4.5. CSS
CSS is used to describe the style of an HTML document.

1.4.6. Django Rest Framework


Django Rest Framework is used to create the RESTful APIs which help in communication of
the sensors data to the database in JSON format.

8
CHAPTER 2. LETERATURE REVIEW

There are various journals where the temperature and humidity are monitored and alarming
system is used for controlling the parameters such as the journals in khartoumspace.uofk.edu,
researchgate.net. But we are using the automatic controlling of the parameters using fan and
heating element. Further more we have used the IOT based concept to show the data on the
web page hence we can monitor the data using internet.

9
CHAPTER 2. METHODOLOGY

2.1. Project Development method


The project was first started by learning about the sensors and module that we are using in the
project and their interfacing technique with the micro controller ,after that we focused on
learning about presenting the data of temperature and humidity on the IOT platform. After the
prior knowledge of mentioned aspects the circuit and algorithm is simulated on the simulation
software on the computer (Proteus) to test the errors and find out the correctness of the project.

The project done on the basis of frequent communication between the project members
through various online media up to the software simulation part and the hardware and circuit
joining was done by physical presence of all the team members.

We believe that after the completion of this project various manufacturing plant will be
benefited which needs the consideration of the factors like temperature and humidity.
Similarly in the health sector the hospital ICU, operation room can also collect the benefits
from this project. Also, we will get the opportunity to implement our knowledge to various
field of application. This will enhance our knowledge in the field of embedded electronics and
help to use sensors, modules and interface with micro controller.

10
2.2. Block diagram

The block diagram of our project is shown below:

fig: Block diagram

11
2.3. FLOW CHART
(Hardware Approach)

Read the
Send data to the
Temperature and
IOT Cloud
Humidity
in JSON

Wait for 5
seconds
Is
temperature
is within the pre- Turn OFF Fan
defined and Heating
range element OFF
?

No

Is
temperature Yes
greater than Turn ON Fan
upper limit
?
No

Heating Element turned


ON

12
(Software Approach)

START

Website Receives the


data in JSON format

Database is updated
with current data

Asynchronous
JavaScript fetches data
in every five seconds

Web page is updated in


with new data

13
2.4. Circuit Diagram and Explanation
Temperature and Humidity Monitoring System is the solution to those sectors that needs to
regularly know the values of temperature and humidity for their effective execution of tasks.
This design uses the NodeMCU which has wifi module (ESP8266) attached with it as the
micro controller, DHT11 as the humidity and temperature sensor, Jumper Wires, Bread Boards,
simple dc motor, plastic fan and Django for the development of IOT platform for displaying
data. This project displays the continuous humidity and temperature values on the device
screen for the monitoring propose, and also continuously control the closed system. Circuit
diagram is shown below:

fig:Circuit diagram

14
The D1 pin of nodemcu is connected to the DHT 11 sensor for reading the values of
temperature and humidity. The D2 and D0 pins of nodemcu are connected to the two inputs of
two channel relay. The output of the relay is connected to the DC motor fan and heating
element (Nichrome Wire). The 5V power is supplied externally through the USB cables
through our PC to run fan and heat Nichrome Wire and also to the nodemcu. The power to the
sensor and the relay is provided from the nodemcu.

15
CHAPTER 3: OUTPUT

After the completion of this project, the project is expected to give the following output:

Effective measurement of the temperature and humidity of the indoor environment

Effective presentation of the measured value of temperature and humidity in the computer
screen.

16
17
CHAPTER 4. CONCLUSION AND FUTURE WORK

4.1. Results:
The experimental model was made according to the circuit diagram and block
diagram and the results were as expected. If our desire temperature of any closed system is in
the range of 25 to 27 degree celcius, our project continuously monitor the temperature and
humidity of that system and maintain the temperature at desired range i.e. 25 to 27 degree
celcius. If the temperature is greater than desired value, fan turn on automatically and if the
temperature is less than desired value, the heater on and hence maintain in constant desired
temperature. And the real time value of temperature and pressure is display in website
correctly in the website which can be view form anywhere.

4.2. Conclusions:
This system is beneficial in different areas like hospital and ICU room where temperature and
humidity plays key role.

It is very helpful in agriculture sectors as well, in agriculture where we need the constant
temperature like off-seasonal vegetables productions.

Sime it is automatic system and work on feedback mechanism, it is more accurate and
doesnot require any person to monitor.

In modern era of technologies, this automatic system is very helpful for the different
sectors. It is low cost and easily operatable project that can be handel by a operator having
little knowledge.

4.3. Future Work:

Temperature and Humidity monitoring system and automation designed in this project can be
further enhanced where we can set the temperature at our desired values from the website
which provides the flexibility of using the project anywhere we want.

18
THANK YOU

REFERENCES

R. Grundy, "Recommended Data Center Temperature & Humidity," AVTECH, 14


November 2005. [Online]. Available: https://avtech.com/articles/3647/recommended-
data-center-temperature-humidity
D.-R. UK, "DHT11 Humidity & Temperature Sensor”, 30 July 2010. [Online]. Available
www.droboticsonline.com
Django: https://www.djangoproject.com/
Rest API: https://www.django-rest-framework.org/
NodeMCU: https://components101.com/development-boards/nodemcu-esp8266-pinout-
features-and-datasheet

19
APPENDIX-1

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <DHT.h>
#include <Adafruit_Sensor.h>
const char *ssid = "netis_F5A56E";
const char *password = "p@$$word";

#define DHTPIN D1
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
float t = 0.0;
float h = 0.0;

unsigned long previousMillis = 0;


const long interval = 5000;

void setup() {
delay(1000);
Serial.begin(9600);
dht.begin();

WiFi.mode(WIFI_OFF); //Prevents reconnection issue (taking too long to connect)


delay(1000);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("");

20
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());

pinMode(D0, OUTPUT);
pinMode(D2, OUTPUT);
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
float newT = dht.readTemperature();
if (isnan(newT)) {
Serial.println("Failed to read from DHT sensor!");
}
else {
t = newT;
Serial.println(t);
}
float newH = dht.readHumidity();
if (isnan(newH)) {
Serial.println("Failed to read from DHT sensor!");
}

21
else {
h = newH;
Serial.println(h);
}

HTTPClient http;

http.begin("http://sajan33.pythonanywhere.com/api/temp/1/");
http.addHeader("Content-Type", "application/json");
String putData1 = "{\"temp\":\"" + String(t) + "\"}";

int httpCode1 = http.PUT(putData1);


String payload1 = http.getString();

Serial.println(httpCode1);
Serial.println(payload1);
http.begin("http://sajan33.pythonanywhere.com/api/hum/1/");
http.addHeader("Content-Type", "application/json");
String putData2 = "{\"hum\":\"" + String(h) + "\"}";

int httpCode2 = http.PUT(putData2);


String payload2 = http.getString();

Serial.println(httpCode2);
Serial.println(payload2);

http.end();

delay(5000);

22
if(t>26){
digitalWrite(D0, HIGH);
digitalWrite(D2, LOW);
}

else if(t<25){
digitalWrite(D2, HIGH);
digitalWrite(D0, LOW);
}

else{
digitalWrite(D2, HIGH);
digitalWrite(D0, HIGH);
}
}
}

23

You might also like