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

A MINI PROJECT REPORT

on

“ENVIRONMENT MONITORING SYSTEM”

Submitted in partial fulfillment of the requirements

for the degree of

BACHELOR OF ENGINEERING IN COMPUTER ENGINEERING

by

1. Shreya Bhagole

2. Monish Naidu

Under the guidance of

Prof. Chitra Wasnik

Department of Computer Engineering


Lokmanya Tilak College of Engineering, Navi Mumbai

University of Mumbai
(Year 2018-2019)
CERTIFICATE

This is to certify that the mini project titled “ENVIRONMENT MONITORING SYSTEM” is a
bonafide work of Shreya Bhagole (Roll No. 120) and Monish Naidu (Roll No. 105) submitted
to the University of Mumbai in partial fulfillment of the requirement for the award of the degree
of Bachelor of Engineering in Computer Engineering .

--------------------------- ---------------------------
Prof. Chitra Wasnik Dr. Pravin Nikumbh
Project Guide Head
Dept of Computer Engineering
MINI PROJECT REPORT

“ENVIRONMENT MONITORING SYSTEM”

Submitted By

1. Shreya Bhagole
2. Monish Naidu

in partial fulfillment of the Degree of B.E. in Computer Engineering is approved.

Guide:
Examiner:
_____________________
Prof. Chitra Wasnik (1) ___________________

(2) ___________________

_____________________ ________________________
Dr. Pravin Nikumbh Dr. Vivek Sunnapwar
Head (Principal)
Dept of Computer Engg.

Date of Submission:
(College Stamp)
DECLARATION

I declare that this project represents my ideas in my own words and where others' ideas or words
have been included, I have adequately cited and referenced the original sources. I also declare
that I have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea/data/fact/source in my project work. I promise
to maintain minimum 75% attendance, as per the University of Mumbai norms. I understand that
any violation of the above will be cause for disciplinary action by the Institute.

Yours Faithfully

___________________

___________________
Abstract

Internet of Things (IoT) is expected to play a major role in our lives through pervasive systems
of sensor networks encompassing our environment. These systems are designed to monitor
environment changes and generate result which can be transmitted and saved at cloud from
where this information can be accessed through applications and further actions can be taken.
This project presents the implementation and results of an environment monitoring system using
light sensor and temperature sensor. The temperature is measured using temperature sensor and
an alert sent via message, email and even a tweet on social media. The system deploys Bolt iot
wifi module which transmits data to open IOT API service Digital Ocean.

I
Acknowledgement

I remain immensely obliged to Prof. Chitra Wasnik for providing me with the idea of this topic,
and for her invaluable support in gathering resources for me either by way of information or
computer also her guidance and supervision which made this project successful.
We would like to thank mini project Coordinators, Dr. P. J. Nikumbh, Head Computer
Engineering Department, Dr. Subhash Shinde, Vice Principal and Dr. Vivek Sunnapwar,
Principal, LTCoE.
I am also thankful to faculty and staff of Computer Engineering Department and Lokmanya
Tilak College of Engineering, Navi Mumbai for their invaluable support.
I would like to say that it has indeed been a fulfilling experience for working out this project
topic.

________________________ ________________________

Shreya Bhagole (Roll No. 120) Monish Naidu (Roll No.105)

II
LIST OF FIGURES

1 Connections for Light Intensity Monitoring……………………………………………5


2 Connections for Temperature Monitoring……………………………………………...6
3 Creating product on bolt cloud………………………………………………………....7
4 Setting variable name “light” for A0 pin…………………………………………….....7
5 Bar Graph Output……………………………………………………………………....8
6 Gauge Output…………………………………………………………………………..9
7 Output on terminal on executing the code for SMS alert……………………………..11
8 SMS Alert………………………………………………………………………….......11
9 Email Alert……………………………………………………………………………..12
10 Posted tweet…………………………………………………………………………….14
11 Circuit Diagram of ESP8266-12E………………………………………………………15

III
TABLE OF CONTENTS
Abstract……………………………………………………………………………….I

Acknowledgement……………………………………………………………………II

List of figures ………………………………………………………………………..III

Table of contents………………………………………………………………………IV

Chapter 1.Background and Motivation


1.1 Introduction…………………………………………………………………1
1.2 Motivation………………………………………………………………….2
1.3 Statement of the problem……………………………………………………2

Chapter 2. Literature Survey…………………………………………………………….


2.1 Technical Information

Chapter 3. System analysis and design


3.1 Software Requirements
3.2 Hardware requirements
3.3 Overall System Description
3.4 Overview of the modules and subsystems
3.5 Diagrams/tables/System Architecture

Chapter 4. Conclusion

Chapter 5. Reference (Books, journals and other online references)

Annexure. 1.Paper published in Conference if any.


2. Plagiarism report

IV
1. BACKGROUND AND MOTIVATION

1.1 Introduction

Environmental Monitoring System (EMS)

EMS monitors environmental factors like light and temperature. It keeps detailed records of
those factors with a live video streaming using a high-quality camera. EMS display useful
information on software interface, which gives operator/user one stop dashboard with alarming
facility in the abnormal condition.

EMS prevents calamitous situations resulting from climate and power related issues within
monitored environment, this can reduce revenue loss, save guard reputations and prevent life
threatening accidents. EMS best suits for the Building Management System, Monitoring data
centre / IT, telecom, healthcare and food storage Industry.

EMS Device

EMS devices comes with wide range of models, it differs by On-Board Sensors, External
Sensors and other hardware features. It has capacity to connect various analogue, digital sensors .

EMS device-

 Monitor temperature and light.


 Bolt IoT Wifi module.
 Light dependent resistor and LM35 for temperature monitoring.
 Send alerts via email, SMS and tweet.
 Relay output for external device control.

Features
 Monitors- EMS monitors various parameters like Temperature and Light.

 Prevents- It prevents Equipment Failure , Downtime, Loss of Revenue, Loss of


Reputation

 Alerts-Alert notifications via Email, SMS and tweets.

Applications

 Building Management System.


 Data Center Monitoring
 Telecom
 Health Care

1
1.2 Motivation

The main motive behind this project is to make the users aware of the environmental
changes. The system enables the users to get in-phone alerts about the temperature and also
makes it easy for them to grasp the changes in light intensity during different parts of the day
in different surroundings. Various IOT products are able to adjust the room environment
according to the weather outside. These products can use this system as a module to detect
the temperature. Also, various weather prediction systems can use the light intensity data to
form various patterns and predict the conditions in future.

1.3 Problem statement

The bolt wifi module contains a ESP-8266 circuit. The problem is to connect the LDR,
resistor in such a way that the light intensity is detected in an optimum way. This detected
light intensity has to be plotted in the form of various types of graphs by accessing the
google charts library through JavaScript.

For temperature monitoring, the LM35 has to be connected to the bolt wifi module using the
male-female wires. The connections are made in such a way that there is no time lag while
detecting temperature and accuracy is maintained.
If the temperature crosses a threshold value, an alert is sent to the user in form of an sms and
an email. Also, a tweet is posted from the user’s account to make his acquaintances aware of
the recent temperature rise. These tweets is posted by using the python tweepy library.

2
2. LITERATURE SURVEY

2.1 Technical Information

The Internet of things (IoT) is the extension of Internet connectivity into physical devices and
everyday objects. Embedded with electronics, Internet connectivity, and other forms of hardware
(such as sensors), these devices can communicate and interact with others over the Internet, and
they can be remotely monitored and controlled.

The definition of the Internet of things has evolved due to convergence of multiple technologies,
real-time analytics, machine learning, commodity sensors, and embedded systems. Traditional
fields of embedded, wireless sensor networks, control systems, automation (including home and
building automation), and others all contribute to enabling the Internet of things. In the consumer
market, IoT technology is most synonymous with products pertaining to the concept of the
"smart home", covering devices and appliances (such as lighting fixtures, thermostats, home
security systems and cameras, and other home appliances) that support one or more common
ecosystems, and can be controlled via devices associated with that ecosystem, such as
smartphones and smart speakers.

The IoT concept has faced prominent criticism, especially in regards to privacy and security
concerns related to these devices and their intention of pervasive presence.

3
3. SYSTEM ANALYSIS AND DESIGN

3.1 Software requirements

 Windows/Linux Operating System


 Account on Bolt IoT Cloud
 Bolt cloud app
 Digital Ocean Account

3.2 Hardware requirements

A. Light Intensity Monitoring System


 1 x Bolt IoT Module
 1 x Micro USB Cable
 1 x LDR (2 legged device with a red wave pattern disk on top)
 1 x 10k Ohm Resistor (brown black orange color code)

B. Temperature Monitoring System


 The Bolt Wifi module
 3 female to male wire
 Temperature Sensor: LM35 sensor

4
3.3 Overall System Description

BUILDING THE CIRCUIT:


A. Light Intensity Monitoring System

1. Make sure you have not powered on your Bolt Module while connecting the circuit. This
will ensure that in case we make any mistake, it will not short circuit your device. Switch
off the power if it is connected.

2. Connect one end of the LDR to the A0 (analog) pin of the Bolt device and other ends of
the LDR to the 5V pin of the Bolt as shown in the image below.

3. Connect the 10K ohm resistor between the GND and A0 pin of the Bolt so that LDR and
the resistor form a series connection.

Fig 1 Connections for Light Intensity Monitoring

5
B. Temperature Monitoring System

1. Make sure you have not powered on your Bolt Module white connecting the circuit. This
will ensure that in case we make any mistake, it will not short circuit your device. Switch
off the power if it is connected.

2. Connect the VCC pin of LM35 to 5V pin of the Bolt device.

3. Connect the GND pin of LM35 to GND pin of the Bolt device.

4. Connect the analog output pin of LM35 to A0 (analog input) pin of the Bolt device.

Fig 2 Connections for Temperature monitoring

6
3.4 Overview of the modules and subsystems
STEPS:

1. After making the connections, create a product on bolt cloud and link the
device to the product.

Fig 3 Creating product on bolt cloud

2. Select the A0 pin in the hardware tab on bolt cloud and give it the name
“light”.

Fig 4 Setting variable name “light” for A0 pin

7
A. Light Intensity Monitoring System

Initial step is to create product on bolt cloud and configure it by writing few lines of code. Once
code is saved we proceed with selecting bolt iot cloud and linking it with product. The result is
generated as different types of graph.

Code for Bar Graph:

setChartLibrary("google-chart");
setChartType('barGraph');
plotChart('time_stamp','light');

Output:

Fig 5 Bar graph output

8
Code for Gauge Chart:

setChartLibrary("google-chart");
setChartTitle('Gauge Chart');
setChartType('gauge');
setAxisName('light);
setDimensions(400, 400);
setMaxValue(1023);
setGreen(250, 500);
setYellow(501, 725);
setRed(726, 1023);
plotChart('light);

Output:

Fig 6 Gauge Output

9
B. Temperature Monitoring System

Create product on bolt cloud and log in to the digital ocean droplet using PUTTY followed by
writing codes in separate files to perform various functionalities.
Temperature alerts are send as sms, email and even a tweet on social media site.

Code for SMS:

CONFIGURATION FILE FOR SMS (conf.py):

SSID = 'You can find SSID in your Twilio Dashboard'


AUTH_TOKEN = 'You can find on your Twilio Dashboard'
FROM_NUMBER = 'This is the no. generated by Twilio.
TO_NUMBER = 'This is your number. Make sure you are adding +91 in beginning'
API_KEY = 'This is your Bolt Cloud accout API key'
DEVICE_ID = 'This is the ID of your Bolt device'

CODE TO SEND AN SMS (temp_sms.py):

import conf, json, time


from boltiot import Sms, Bolt
minimum_limit = 300
maximum_limit = 600
mybolt = Bolt(conf.API_KEY, conf.DEVICE_ID)
sms = Sms(conf.SSID, conf.AUTH_TOKEN, conf.TO_NUMBER,conf.FROM_NUMBER)
while True:
response = mybolt.analogRead('A0')
data = json.loads(response)
print (data['value'])
try:
sensor_value = int(data['value'])
print (sensor_value)
if sensor_value>maximum_limit or sensor_value<minimum_limit:
response = sms.send_sms("The Current temperature sensor valueis " +str(sensor_value))
except Exception as e:
print ("Error",e)
time.sleep(10)

10
Output:

On Terminal:

Fig 7 Output on terminal after executing the code

As SMS:

Fig 8 SMS Alert

11
Code for Email:

CONFIGURATION FILE FOR EMAIL:

MAILGUN_API_KEY = 'This is the private API key which you can find on your
Mailgun Dashboard'
SANDBOX_URL= 'You can find this on your Mailgun Dashboard'
SENDER_EMAIL = 'This would be test@your SANDBOX_URL'
RECIPIENT_EMAIL = 'Enter your Email ID Here'
API_KEY = 'This is your Bolt Cloud accout API key'
DEVICE_ID = 'This is the ID of your Bolt device'

CODE TO SEND AN EMAIL:

import email_conf, json, time


from boltiot import Email, Bolt
minimum_limit = 300 #the minimum threshold of light value
maximum_limit = 600 #the maximum threshold of light value
mybolt = Bolt(email_conf.API_KEY, email_conf.DEVICE_ID)
mailer = Email(email_conf.MAILGUN_API_KEY, email_conf.SANDBOX_URL,
email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL)
while True:
response = mybolt.analogRead('A0')
data = json.loads(response)
print (data['value'])
try:
sensor_value = int(data['value'])
print (sensor_value)
if sensor_value>maximum_limit or sensor_value<minimum_limit:
response = mailer.send_email("Alert",
"The Current temperature sensor value is " +str(sensor_value))
except Exception as e:
print ("Error",e)
time.sleep(10)
Output:

Fig 9 Email alert

12
Code for tweet on social media

Introduction to Tweepy

Tweepy is an easy to use Python library for accessing the Twitter API. Twitter provides APIs to access
various functionality related to your Twitter account. These API's work over HTTP protocol, i.e. you can
make GET, POST requests to access your Twitter account.

Also accessing the information in the response object requires very good knowledge of JSON. To
make the process of making the Twitter API requests simpler and to handle the response information
in an easier manner, we shall make use of the Tweepy library. The Tweepy library converts all the
Twitter APIs into Python functions that you can simply use in your programs and access the Twitter
API. It also returns the Twitter APIs data in an object format with methods that we can use to access
the data easily.

CONFIGURATION FILE

consumer_key = "Consumer Key (API Key) for Twitter App"


consumer_secret = "Consumer Secret (API Secret) for Twitter App"
access_token = "Access Token for Twitter App"
access_token_secret = "Access Token Secret for Twitter App"
bolt_cloud_api_key = "API key of your Bolt Cloud. You can find in API
section on Bolt Cloud"
device_id = "ID of your Bolt Device"

CODE (post-tweet.py)

import tweepy
import conf, json, time
from boltiot import Bolt
# Dictionary to store credentials as key-value pairs.
config = {
"consumer_key" : conf.consumer_key,
"consumer_secret" : conf.consumer_secret,
"access_token" : conf.access_token,
"access_token_secret" : conf.access_token_secret
}
# Method to authenticate user via Tweepy and return API object
def get_api_object(cfg):
auth =tweepy.OAuthHandler(cfg['consumer_key'],cfg['consumer_secret'])
auth.set_access_token(cfg['access_token'],cfg['access_token_secret'])
return tweepy.API(auth)
mybolt = Bolt(conf.bolt_cloud_api_key, conf.device_id)
temperature_threshold = 59

13
while True:
response = mybolt.analogRead('A0')
data = json.loads(response)
print (data['value'])
try:
sensor_value = int(data['value'])
if sensor_value > temperature_threshold:
print "Temperature has crossed the threshold."
# Call get_api_object to authenticate user and get the API object
api_object = get_api_object(config)
# Store the tweet message in the variable
tweet = "Temperature has crossed the threshold."
# Post the tweet on your Twitter account using the
update_status method.
status = api_object.update_status(status=tweet)
except Exception as e:
print ("An error occurred ", e)
time.sleep(10)

Output:

Fig 10 Posted Tweet

14
3.5 Circuit Diagram of ESP8266-12E

Fig 11 Circuit Diagram

15
4. CONCLUSION

The importance of environmental monitoring system lies in sending prompt alerts about the
imminent weather to the users and also visualizing the light intensity data for further analysis.
The environmental monitoring system is of great use to various IOT gadgets that use the
temperature data to adjust the room temperature. The graphs plotted for the light intensity can be
used to analyze different patterns of light intensity during different times of day. Thus, the
environmental monitoring system serves a great purpose.

16
5. REFERENCES

[1] Jalpa Shah & Biswajit Mishra, IoT enabled environmental monitoring system for smart
cities, IEEE, 2016

[2] Jaydeep Thik & Chintan Bhatt, Data Logging and Visualization Using Bolt IoT, ICANI,
2019

[3] Anitha Bommana, IoT based Monitoring and Control System for Home Automation
using Prediction Algorithms, IJARCCE, 2017

[4] Bruce Sinclair, IoT Inc: How Your Company Can Use the Internet of Things, May 2017

[5] Maciej Kranz, Building the Internet of Things: Implement New Business Models,
Disrupt Competitors, Transform Your Industry, 2016

[6] Arshdeep Bahga & Vijay Madisetti, Internet of Things: A Hands-On Approach, 2015
[7] https://docs.boltiot.com/docs/bolt-wifi-module
[8] https://docs.boltiot.com/docs/getting-started-with-bolt-temperature-monitoring-system
[9] https://files.readme.io/e6e2307-bolt_v4.0_ROHS_sch_esp-12e.png
[10] https://docs.boltiot.com/docs/controlling-devices
[11] https://etasr.com/index.php/ETASR/article/view/2144
[12] https://docs.boltiot.com/docs/getting-started-with-bolt-light-monitoring-for-plants

17
ANNEXURE

PLAGIARISM REPORT

This is to certify that this project is the original work of Ms. Shreya Bhagole and Mr. Monish
Naidu. The project has been solely prepared by the above mentioned students. The idea was
supported by the references mentioned. There is no plagiarism involved whatsoever in the idea
or the implementation of the project.

Project Guide Students

18

You might also like