You are on page 1of 27

WEATHER TRACKING SYSTEM USING IoT

A MINOR PROJECT REPORT

Submitted in partial fulfilment of the requirements for the award


Of

BACHELOR OF TECHNOLOGY
IN
ELECTRONICS AND COMMUNICATION ENGINEERING

JUNE 2020

Submitted by.
Ornab Debnath (BETN1EC17007)

Under the Guidance


Of
Mr BUPENDRA DHAKKAD
(Assistant Professor)

DEPARTMENT OF MECHANICAL ENGINEERING


ITM UNIVERSITY, GWALIOR, MADHYA PRADESH, INDIA
474001

1
DECLARATION

I hereby declare that the project entitled “WEATHER TRACKING SYSTEM USING
IoT” submitted for the B. Tech. (ECE) degree is my original work and the project has not
formed the basis for the award of any other degree, diploma, fellowship or any other similar
titles.

Signature of the Student


Place:
Date:

2
CERTIFICATE

This is to certify that the work titled “WEATHER TRACKING SYSTEM USING IoT”
submitted by “ORNAB DEBNATH” in partial fulfilment for the award of degree of
“BECHELORS OF TECHNOLOGY IN ELECTRONICS AND
COMMUNICATION ENGINEERING” of School of Engineering and Technology,
ITM University Gwalior has been carried out under my/our supervision.

As per my best Knowledge and belief, the project

1. Has duly been completed.


2. Is up to the standard both in respect and constants and language.
3. Fulfils and requirements of the ordinance relating to Bachelors of technology Degree of
the University.

Mr BUPENDRA DHAKKAD
Professor
Electronics and Communication Engineering Department
ITM University Gwalior

Dr. Ranjeet Singh Tomar Dr. Ranjeet Singh


Tomar
HOD, Mechanical Engineering Dean, SOET
ITM University, Gwalior ITM University, Gwalior

3
ACKNOWLEDGEMENT

A Statement of thanks is not evident to inculcate my deep sense of gratitude and obligation to all
those are helped us in one way or another in completion of thesis. I would like to take this
opportunity to thank many people who helped and encouraged me throughout this study.

I would like to thanks my guide Dr.Ranjeet Singh Tomar (Head of Department) Department
of Electronics and Communication Engineering, ITM University Gwalior, for providing me to
work under his guidance, his valuable suggestion and comments, expertise and fruitful advice has
helped me a lot throughout this experimental process. I extend my heartfelt thanks to him.

I wish to express my sincere thanks to Mr BUPENDRA DHAKKAD (Asst. Professor)


Electronics and Communication Engineering Department, ITM University Gwalior, who has
been a constant source of inspiration for us throughout this work.

A Special word of appreciation goes to all the Staff members of Mechanical Engineering
Department who have helped us in this study.

Above all I thank our parents whose love and affectionate blessing has been a constant source of
inspiration in making this manuscript into a reality. I render my gratitude to God almighty for
giving me their strength to complete this work.

ORNAB DEBNATH

4
ABSTRACT

Internet of Things (IoT) is being applied in different areas in the agriculture sector including
smart fisheries, smart poultry, etc. that allows a system to collect data through
heterogeneous sensors, analyze them to predict the situation in advance, make the
appropriate decision, notification to the user and finally take actions through actuators
automatically. The application of IoT in a poultry farm allows real-time monitoring of the
context of the farm through a notification to email, predict the context in advance, advise the
right decision at the right time that saves poultry lives, minimize the loss, improve the
productivity and quality. Monitoring weather of the poultry farm is one of the important
issues that require monitoring the status of the temperature, humidity, etc. that has an impact
on raw materials and quality of food, health condition of the poultry, feeding in time, food
management, etc. Considering the fact, improvement of the management and increase the
efficiency of the farm, an IoT based weather monitoring system for a poultry farm has been
proposed in this report. DHT11 is used to measure the temperature and humidity in the
proposed system. The collected data is transmitted to the server, stored in a database, and
compared with threshold values continuously. If the stream of data crosses the threshold
values and remains higher the system sends an alert message to the email and signal to a
buzzer. To validate, the proposed system has been implemented that sends an alert message
to the email and signal to buzzer successfully.

5
Introduction

In the agricultural field, modern technologies are applied in present days to make the system
more versatile, automatic, and user friendly. Smart farming is a high technology system of
growing food cleanly in a sustainable way and increase the quantity and quality of the
products. There are two types of conceptions in smart farming. They are smart agriculture
and AgriTech. Our project is under smart agriculture as it is related to the application of the
Internet of Things (IoT) which can be utilized in various devices to connect. IoT helps in
agriculture to introduce advanced sensors that can be utilized to connect with the cloud via
cellular/satellite network. This helps us to know the real-time data from the sensor and make
effective decisions.

The main purpose of controlling the humidity and temperature in modern-day poultry
production is to produce a healthier bird that can grow more efficiently and adapt themselves
to live in the most desirable and least stressful environment. Healthy chicken grows rapidly
and has a good demand in the market. In poultry farms, too little moisture can cause
dehydration and respiratory illness where excessive moisture can lead to caking and ammonia
[2]. Heat stress occurs which affects the behavior, welfare, growth, and immunity of the
poultry which decreases egg production as well as lower the quality of egg and meat which
causes a massive economic loss. This also lowers the reproductive performance and reduces
feed intake which led to lower body weight [3].

The application of IoT acts as a blessing as it makes a great contribution to the development
of modern poultry farming. IoT helps to store the data in one place so that farmers can easily
check the data, analyze them, and help to make the right decision. This helps to reduce the
risk in business and improve business efficiency. IoT makes better control over the internal
operations which reduces production loss and ensures a good quality of products to the
customer. In poultry farms, it is very necessary to maintain the correct temperature and
humidity to save the food, keep the medicine and chemicals from damage, and for many
other purposes.

Our project used DHT11 sensors connected with the NodeMCU module to collect the
temperature and humidity in the poultry farm. This helps the farmer to know the weather
condition of the poultry farm which can affect the quantity and quality of the poultry. IoT
helps us to know the real-time weather condition by using the sensors data which are
collected from the environment [4]. The sensor monitors the condition of the poultry farm
and sends the data to the ThingSpeak, which eliminates the physical presence of the farmer
on the farm. They can access the data from anywhere using the ThingSpeak. The system
gives more focused on precision farming which is one of the most famous applications in IoT
agriculture. This helps the farmer to generate the data that is collected from the sensors and
analyze that information to take intelligent and quick decisions. If any disturbing weather
condition is found such as the temperature crosses the threshold limit it starts the buzzer on
and sends an alert email to the user email address. The alert system helps to notify the farmer
about the impacts of increasing temperature so they can take essential steps. The database in
the system helps to store the data that are collected from the sensors. This helps the farmer to
make a better decision related to poultry farms to maintain the quality and enhancing the
product quantity.

The DHT11 sensor used in the system is lightweight. It responds instantly, no anti-
interference, and give extremely accurate results. It is an ultra-low-cost digital temperature
6
and humidity sensor with a high-cost performance advantage. It gives high reliability and
excellent long term stability [5]. The NodeMCU is a low cost, low energy consuming module
that is integrated to support for Wi-Fi network. This is flexible to design and operate. The
previously used existing model system was costly and human involvement was required. This
developed system is budget-friendly and does not require any human engagement. The
system is easy to operate and no training is required.

7
WEATHER TRACKING SYSTEM USING IoT

Modern technology act as a catalyst that helps the farmer to enhance their products with good
quality and quantity. IoT based weather monitoring system act as a blessing for poultry farm
as it can monitor the environmental parameter temperature and humidity automatically.

Proposed System Architecture

Fig.1: Proposed system architecture

8
In Figure 1 the proposed system architecture shows the flow of the project system. When the
DHT11 sensor is connected with the module NodeMCU it transmits the reading from the
sensor and sends it to the server using the NodeMCU gateway. The functionality of the
system schemes under NodeMCU which acts as the main processing unit where the sensor is
connected with it [17]. The server sends data to the cloud using the internet which sends
notification of different poultry farming methods to the farmer. This helps to build a
community in the cloud where farmers can share their experience and knowledge. Every time
the sensor sends the data it is compared with the threshold value and monitored carefully.
Once the temperature crosses the threshold value it sends sent an alert email notification to
the user email from the server and sends a signal to the buzzer. The system helps the farmer
to take the necessary steps to control the temperature in the poultry farm [18]. The main
motive of the system is to give the user the correct reading of the sensor whenever they are
accessing the webserver from anywhere.

In figure 2 the flow chart diagram elaborates on the functionality of the working model. This
explains the data transmission in the system from the sensor to the server and then to the
cloud system. The procedure of sending an alert email notification to the user email address
and sending a signal to the buzzer is also explained in detail.

9
Required Hardware and Software Tools:

DHT11 Humidity
and

Temperature Sensors:

It is used to measure temperature and humidity. As it is cheaper and not complex so it is


easier to use.
Inside DHT11 there is a thermistor and humidity sensing component. Two electrodes are
present in
humidity sensing components with moisture-holding substance. DHT11 using the capacitive
humidity sensor discloses the digital signal on the data pin [19]. It is popular for absorbing
low power. So, no extra power is needed. It takes less than 5 seconds to respond. The
humidity measuring range is between 20% ~ 90% RH and temperature measuring range is
between 0 ~ +50; During the conversion of data into digital form, it uses 2.5mA which is the
maximum current. The Humidity measuring accuracy is ±5.0% RH and Temperature
measuring accuracy is ±2.0. The size of DHT11 is 15.5mm x 12mm x 5.5mm [20]. After
every 2 seconds, new data can be retrieved. One of the major advantages is it has a long
transmission system. The sensor has sometimes three or four pins- VCC, GND, Data Pin, and
a not connected pin. To correspond with the microcontroller, the sensor uses a pull-up resistor
10
of 5k to 10k ohms. It is used in environmental monitoring, in controlling climate
automatically, in the local weather station and others.

Fig 3: DHT11 sensor

NodeMCU ESP8266: It is a small Wi-Fi module that is used to build a wireless network connection
for microcontrollers or processes. This is cheaper to use for developing IOT connections. The ESP
module has 22 pins for connection. It has a frequency range between 2.412 - 2.484 GHz. It has a
programmable GPIO which is available here. It allows maximum current 15 mA to per pin. It has an
operating voltage between 3V to 3.6V. It has 10 GPIOs D0- D10, PWM functionality, IIC, and SPI
communication and many other facilities in one board.

11
As it is connected to the internet both update and fetch data is possible. It also has a PCB antenna. The
board has 128 KB RAM and 4MB of Flash memory which can adjust with the large string that builds the
web page, JSON/XML data, and everything that is included in the IoT devices. As it has 802.11b/g/n
HT40 Wi-Fi transceiver this allows it to set up a network and also connect to the Wi-Fi network and
collaborate with the internet. Other devices can also connect with the component. It has two buttons RST
for reset purpose and FLASH for upgrading firmware. It is used in the weather stations, IoT applications,
wireless control systems, security ID tags, and many others.

Fig.4: NodeMCU ESP8266 12E

Passive Buzzer: It is used for alarm purposes. It has three-pin where one pin provides power to the device, and
another pin controls it. The passive buzzer is connected with the NPN transistor and then connected in the circuit.
It is small in size, it has a good frequency and cost-friendly. In some cases, passive buzzer can be used to
multiplex with the LED.

Fig.5 : Passive Buzzer

12
Arduino IDE:
The Arduino IDE (Integrated Development Environment) is open-source software for an electronic
platform to run both hardware and software. It is simple and easy for the user to use. For its easy
accessible use, it has been used in many different projects. There are some benefits of using this
software. It is much cheaper than another microcontroller platform. As it has cross-platform so it runs on
Windows, Macintosh OSX, and Linux operating systems. It has a flexible and clear programming
environment. For input and output procedures the Arduino IDE provides many software libraries. It
supports both C, C++ language though the program is built in JAVA. Users can access the software both
in online and offline mode

Fig 6:
Arduino IDE

Thing Speak:
Thing Speak is developed for the IOT based application and API. By using the HTTP and
MQTT protocol the data can be stored and retrieved. This is done by Internet or via a Local
Area Network. Thing Speak analysis and visualizes the user data using Matlab. Thing Speak

13
enables the creation of sensor logging applications, location tracking applications, and a social
network of things with status updates.

Figure 7: Thing Speak


IFTTT
It is a platform where it brings services of different apps and devices together. By signing up
into an IFTTT account it helps to perform the task in a specific way. It also creates chains of
simple conditional statements, called applets which are connected within other web services
such as Gmail, Facebook, Telegram, Instagram. The services run on web-based applications,
on iOS and Android. IFTTT helps in better functionality, improved search function, pre-
bundled applet suites and others.

Figure 8: IFTTT

14
MySQL:

MySQL is the database system used with PHP. It is used on the web and runs on a server.
This is very fast and reliable to use. The database is free to download and use. It is developed,
distributed, and supported by Oracle Corporation. It is useful for both small and large
applications. In MySQL the data is stored in the form of a table. It stores information
categorically.

Figure 9: MySQL
phpMyAdmin:
phpMyAdmin is a free software tool written in PHP. It intended to handle the administration
of MySQL over the Web. It supports operations on MySQL and MariaDB. It uses operations
like databases, tables, columns, relations, indexes, users, permissions, etc. It imports data
from CSV and SQL. It supports most of the features of MySQL. Here the data can be
searched globally in the database and subset it.

15
Figure 10: phpMyAdmin

Implementation

The design in figure 12 comprises the internet based system which include sensor,
NodeMCU and passive buzzer to complete the system. The system can generate real time
based data to the cloud and automatically takes the reading from the environment such as
humidity and temperature. The research is focused on the integration of wireless sensor
and mobile network. The system will help to control the temperature and humidity for the
benefits of the product.

4.1 Implementation Architecture


NodeMCU ESP8266 is an inexpensive Wi-Fi microchip which can act as a
microcontroller [20]. The system uses a DHT11 sensor to measure the temperature and
humidity. The sensor and the buzzer are connected with the NodeMCU by using the
jumper wires. Once the code is uploaded in the Arduino IDE Software the system
becomes active. Microcontroller gets the analog value from the sensor and converts it into
digital value. The data is send to the server and stored in the database. The value is then
shown in the serial monitor and in Thing Speak where it is plotted in the form of graphs
with present date and time. The changes of the reading are shown in a separate dialog
box. When the temperature is above 30 it will send the alert email to the user email
address and immediately will send a signal to the buzzer as well. The data is stored in a
separate database which is created using MySQL. The phpMyAdmin is used to store the
data manually in the MySQL database.
16
Fig.11: Implementation architecture

In figuare 13 we can see DHT11 is directly connected with the NodeMCU. The
ground connection of DHT11 is connected with the GND of NodeMCU. The data out of
DHT11 is connected with the D3 of NodeMCU. The VCC of DHT11 is connected with the
3V of NodeMCU. The connection of Passive buzzer is also shown in the diagram clearly.
This states the electric circuit is simple and easy to understand. It explains all the connections
with the components clearly and gives a visual display of the system.

Fig.12: Circuit Diagram

17
4.2 Notification to Email:
For an alert message first we have to sign in to the IFTTT account and create an applet. Then
go to “My Service” and select “Webhook”. From there we have to go to the “Documentation”
and in the “event” we write down “High_Alert_Message” and click “Test it”. After that we
sign in to ThingSpeak and choose ThingHTTP. From here we create a new ThingHTTP and
fill up with required details information. Here we place the URL from the IFTTT and
Channel ID in the body which build a path connection. Then go the the react and create a new
react. Here we give our threshold value, condition type which is numeric, choose the option
and save it. After that every time the threshold value is crossed an alert message is sent to the
user email.

18
Final Result

NodeMCU has been used in the system and is programmed to detect the humidity and
temperature every seconds. The code is run in the Arduino IDE and the reading is sent to the
serial monitor and ThingSpeak. In the given below, image value in the Serial monitor of
Arduino IDE is shown.

Fig.13: Serial monitor

19
Figure 17 and Figure 18 discusses is the interface in the ThingSpeak where the value is
shown in the web browser. The humidity and temperature is shown in the two separate graphs
containing two individual dialog boxes where the numeric value of the reading is shown.
Every time the value changes that is updated in the dialog box as shown in Figure 19.

Fig.14: ThingSpeak Temperature Graph

Fig.15: ThingSpeak Humidity Graph

20
Fig.16: ThingSpeak Dialog Box

In the experiments reading of the temperature in degree Celsius and humidity in percentage
were taken from the sensor for different locations. A specific time periods were followed for
detecting humidity and temperature level for different time of the day. For each different
place it has been monitored for an hour after every five minutes to see the changes in
humidity and temperature and then the value has been average and inserted to plot the graph.

21
Conclusion

IoT is an innovative technology especially in poultry farming. This helps to change from the
routine of traditional farming into smart farming. It monitors continuously environmental
parameters like humidity and temperature to improve health and growth of the chicks and
chicken. Using IoT helps the farmer to monitor the internal environment of poultry farm and
get all details of the farm from anywhere and anytime. Excessive temperature and humidity
can cause many problems in the raw materials, products, foods and many other major sectors.
If this is not observed carefully it can bring problems like giving birth to many
microorganisms, growth of poultry hampers, quality and quantity of meat and egg decreases
and many other. The system helps in giving the readings properly with accurate results. The
alert message makes the system more beneficial because it aware farmers from any sudden
increase in the temperature and helps them to take necessary steps. The separate database
stored for the system makes it more helpful, so that it can prevent data from getting lost. The
system is both environment and cost friendly. It does not emit any harmful radiation and does
not affect the environment. The system functionality and performance has a good satisfaction
which makes it more effective and long lasting. The data collected in the system is based on
real time measurements of temperature and humidity.

22
References

1. A. Ranjan, R. Sinha, I. Devi, A. Rahim and S. Tiwari, "Effect of Heat Stress on Poultry
Production and their Managemental Approaches," International Journal of Current
Microbiology and Applied Sciences, vol. 08, no. 02, pp. 1548-1555, 2019.
2. S. Mitkari, A. Pingle, Y. Sonawane, S. Walunj and S. Anand, "IOT Based Smart Poulty
Farm," International Research Journal of Engineering and Technology (IRJET), vol.
06, no. 03, pp. 2380-2384, 2019.
3. D.R.CHARLES, "Temperature for Broilers," Cambridge University, vol. 42, no. 3, pp.
249-258, 2007.
4. L. J. Lara and M. H. Rostango, "Impact of Heat Stress on Poultry Production,"
Nation Center for Biotechnology Information (NCBI), vol. 3, no. 2, pp. 356-369,
2013.

5. E. Hitimana, G. Bajpai, R. Musabe and S. Louis, "Remote Monitoring and Control of


Poultry Farm using IOT Techniques," International Journal of Latest Technology in
Engineering, Management & Applied Science (IJLTEMAS), vol. VII, no. V, pp. 87-
90, 2018.
6. G. C, H. H, A. G. Shires and P. H P, "Internet of Things (IOT) based Weather,"
International Journal of Engineering Research & Technology (IJERT), 2018.
7. N. Patil, Y. Sawant, T. Kaur, S. Kate and C. Wagh, "IOT Based Weather Monitoring
for Agriculture," International Journal on Recent and Innovation Trends in Computing
and Communication.
8. A. M. Bhagat, A. G. Thakare, K. A. Molke, N. S. Muneshwar and P. V. Choudhary,
"IOT Based Weather Monitoring and Reporting System Project," International
Journal of Trend in Scientific Research and Development (IJTSRD), 2019.

9. S. Tabassum and A. Hossain, "Design and Development of Weather Monitoring and


Controlling System for a Smart Agro (Farm)," Scientific Research, 2018.
10. A. R, A. Kavitha, D. MaryPraveena and D. Parvathi, "Design and Implementation of
Weather Monitoring," International Journal of Advanced Information in Engineering
Technology (IJAIET), 2017.

23
11. F. J. J. Joseph, "IoT Based Weather Monitoring System for Effective Analytics,"
International Journal of Engineering and Advanced Technology (IJEAT), 2019.
12. M. Đorđević and . D. Danković, "A SMART WEATHER STATION BASED ON
SENSOR TECHNOLOGY ," FACTA UNIVERSITATIS, 2019.

13. Y. Rahut, R. Afreen and D. Kamini, "Smart weather monitoring and real time alert
system using IOT," International Research Journal of Engineering and Technology
(IRJET) , 2018.
14. N. Dayyani and H. Bakhtiari, "Heat stress in poultry," International journal of
Advanced Biological and Biomedical Research, vol. 1, no. 11, pp. 1409-1413, 2013.

15. K. Nandagiri and . J. R. Mettu, "Implementation of Weather Monitoring,"


International Journal of Pure and Applied Mathematics, vol. 118, no. Special, pp.
477- 493, 2018.
16. M. D. V. Sose and D. A. D. Sayyad, "Weather Monitoring Station: A Review," Int.
Journal of Engineering Research and Application (ijera), 2016.
17. B. S. Rao, P. D. K. S. Rao and . M. N. Ome, "Internet of Things (IOT) Based
Weather," International Journal of Advanced Research in Computer and
Communication Engineering (IJARCCE), 2016.
18. K. E. Ukhurebor, . I. C. Abiodun, S. O. Azi, . I. Otete and L. E. Obogai, "A Cost
Effective Weather Monitoring Device," Archives of Current Research International ,
2017.
19. L. Saweda, A. Sanou and J. A. Tambo, "Climate change and adataion among poultry
farmers," Springer Link, 2019.
20. E. Cruz and J. Ruiz, "Portable Weather System for Measure and Monitoring
Temperature, Relative Humidity, and Pressure, Based on Bluetooth
Communication",
Int. Journal of Engineering Research and Application (ijera), 2015.

24
APPENDIX

String apiKey = "XSU2N5LSIB9RX4LP"; // Enter your Write API key


from ThingSpeak

const char *ssid = "D-Link"; // replace with your wifi ssid and
wpa2 key
const char *pass = "#cjpk@12!";
const char* server = "api.thingspeak.com";

#define DHTPIN D6 //pin where the dht11 is connected

DHT dht(DHTPIN, DHT11);

WiFiClient client;

void setup()
{
Serial.begin(115200);
delay(10);
dht.begin();

Serial.println("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED)


{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

void loop()
{

float h = dht.readHumidity();
float t = dht.readTemperature();

if (isnan(h) || isnan(t))
{
Serial.println("Failed to read from DHT sensor!");
return;

25
}

if (client.connect(server,80)) //
"184.106.153.149" or api.thingspeak.com
{

String postStr = apiKey;


postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr += "\r\n\r\n";

client.print("POST /update HTTP/1.1\n");


client.print("Host:
api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY:
"+apiKey+"\n");
client.print("Content-Type: application/x-
www-form-urlencoded\n");
client.print("Content-Length: ");
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);

Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" degrees Celcius, Humidity:
");
Serial.print(h);
Serial.println("%. Send to Thingspeak.");
}
client.stop();

26
Serial.println("Waiting...");

// thingspeak needs minimum 15 sec delay between updates,


i've set it to 30 seconds
delay(10000);
}

27

You might also like