Project Report

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

Air and water quality monitoring system

Chapter 1
PREAMBLE

1.1 INTRODUCTION
Natural resources are the resources that occur within the environment in their natural form. Different
kinds of natural resources are light, soil, natural gases, minerals, forest and timber etc. Air and water are
the major a biotic factors in the environment. Air and water are used in almost all activities of life
support systems.

As the rapid development of the society and numerous human activities are speeded up the
contamination of air and water resources occur. So that it is necessary to identify any changes in air and
water quality parameters from time-to-time to make sure its safety in real time.

The central pollution control board (CPCB) has established monitoring stations which monitor
the water quality on either monthly or yearly basis. This is done to ensure the maintenance of the water
quality or restored at desired level.

Conventionally, by high volume sampler, portable multi gas monitors and gas chromatography
air pollution monitoring is done. The practice make use of stationary and expensive monitors for
monitoring. Further, for monitoring applications on large scale high cost, large size and maintenance
cost makes unfavorable. In this light; a complementary solution can be the use of sensor technology for
air and water quality monitoring.

The application of sensor technologies in various fields includes environmental monitoring,


indoor climate control, surveillance, medical diagnostics, disaster management, emergency response,
and gathering sensing information in hospitable locations. Sensor technology allows creation of low-
cost air and water quality monitoring systems, which helps in the reduction of installation costs, quick
and easy configuration.

The proposed system employs use of multiple sensors to measure the parameters, measures the
quality of air and water quality in real time for effective action, and is economical, accurate, and
required less manpower.

Dept., of ECE, MIT Mysore Page 1


Air and water quality monitoring system

1.2 BLOCK DIAGRAM

The basic block diagram of air and water quality monitoring system is shown in fig1. It consists of
Arduino UNO-R3, power supply, 16X2 LCD display, GPRS modem and different type of sensors.

Turbidity sensor Modem SIM-900


Arduino
MQ-135 AIR Sensor
UNO-R3
16X2 LCD Display

LM35 Temperature Sensor

Power supply

Fig 1: Air and water quality monitoring system

The Arduino UNO-R3 operates at 5V and it is provided by the power supply. The MQ-135 gas
sensor, LM35 temperature sensor and turbidity sensors are interfaced with the Arduino UNO-R3 to
measure harmful content in air and water. The MQ135 air sensor is used to measure different kinds of
gases like NH3, NOx, Alcohol, Benzene, smoke etc. The LM35 temperature sensor is used to measure
the temperature of air in the environment. The turbidity sensor is used to measure the transparency of
the given solution . The sensed data is stored onto the Arduino. SIM800L modem is used to connect
with internet via 4G/GPRS which is used as data transfer application. The end user receives the message
according to the value of the sensor and it is displayed on the 16X2 LCD display.

1.3 OBJECTIVES AND SCOPE OF THE PROJECT

The objectives of the project are:

1. To obtain quantitative information on the chemical characteristics of water.


2. To determine the harmful gases present in air.

The scope of this project is to detect harmful parameters present in air and water using IOT by
interfacing the multi sensors to the Arduino board.

Dept., of ECE, MIT Mysore Page 2


Air and water quality monitoring system

1.4 LITERATURE SURVEY

This section describes about the work done on the air and water quality monitoring using different
technologies which were designed by other researchers.

[1] “AIR AND WATER QUALITY MONITORING THROUGH IOT USING AQUATIC SURFACE
DRONE” by Praveenkumar S, Pavankumar

This paper works on IOT by using aquatic surface drone which speaks about the drone technology for
monitoring of air and water. The system is based on Arduinoplatform and then the sensed data is stored
in IOT cloud platform . Raspberry pi is the IOT module used and sends the data to webserver for
interface.The system uses ultrasonic sensor which measures the distance between the water obstacles to
normal surface. The software tool used in this paper is Arduino IDE and written the code is written in
embedded C programming language.

[2] “WATER SENSOR NETWORK FOR RIVER WATER QUALITY MONITORING IN INDIA” by K.
A. UnnikrishnaMenon, Divya. P, Ramesh, Maneesha V

This paper works on river water and they use wireless sensor network for water quality monitoring. This
paper introduces a novel technique for design of water quality sensor node used to monitor the turbidity
of water. The turbidity can be tested for different conditions like rain water, drinking water and lemon
juice. The simulations are done by using Proteus6.9 Simulator. In this paper, Zigbee communication is
used to transmit sensed turbidity value to the destination wirelessly. The circuit is designed and
hardware prototype is developed which helps to reduces power consumption of the system.

[3] “DESIGN AND IMPLEMENTATION OF LPWA BASED ON AIR QUALITY MONITORING


SYSTEM” by KanZheng, Zhe yang, Shaohang Zhao, Xiongxiong, Wei Xiang

In this paper, the implementation of air quality monitoring system which is based on the state-of-the-art
Internet-of-things (IOT) techniques are used. Portable sensors such as particulate matter sensor are used
to collect the data. The low power wide area (LPWA) technology which is machine-to-machine (M2M)
communication technique is used to provide ubiquitous coverage for the device which send and receive
message with limited data rates. Here the air quality monitoring nodes are of two types they are
monitoring node which are used to collect data of real time air and access point node which is used to
transmit the data through wireless channel.

[4] “IOT BASED WATER QUALITY MONITORING SYSTEM” by MourvikaShirode, Monika Adaling,
JyothiBiradar, Trupti Mate

In this paper the water quality monitoring is performed which identifies the changes in water quality
parameters. The system is designed for continuous onsite sensing and reporting the data of the water

Dept., of ECE, MIT Mysore Page 3


Air and water quality monitoring system

quality. The data is accessed through internet by phone/PC. The sensors collect the data and are
converted into digital format. The digital signals are sent to microcontroller via Wi-Fi module.

The input or commands are transferred by the code written in embedded C and using the
Arduino software to simulate the code. The ESP8266 is the Wi-Fi module which is WLAN network.
The system performance can be improved by the integrated cache memory.

[5] “Air quality monitoring system based on IOT using raspberry pi ” by somanshkumar:

This paper describes about the real time air quality monitoring system. Raspberry pi is the major part of
this system. The sensors that are used for detecting different environmental parameters like, particulate
matter, carbon monoxide, carbon dioxide, temperature, humidity and pressure.

The sensor used in this paper are MQ9 and MQ135 sensors used for carbon monoxide and
carbon dioxide, DSM501A is a PM sensor whose output is PWM used for measuring for particulate
matter,DHT22 and BMP180 are having digital outputs used for measuring temperature and humidity.
These sensors are connected to Arduino board and the raspberry pi is interfaced with Arduino UNO
through USB cable. The data sensed by sensors are continuously transmitted through Raspberry pi to the
cloud over the internet.

1.5 REPORT ORGANISATION

Chapter 1: The introduction to the system, block diagram of the proposed system, scope of the
designed system and literature survey are discussed.
Chapter 2: Complete details of all the hardware components used along with the specifications of each
and the pin diagrams are also included in this chapter.
Chapter 3: The description of software requirements which includes the programming language used
that is Arduino IDE is provided in this chapter.
Chapter 4: The implementation of hardware and software are discussed in this chapter.
Chapter 5: Result of the project, conclusion and the future scope is been provided.

Dept., of ECE, MIT Mysore Page 4


Air and water quality monitoring system

Chapter 2

HARDWARE REQUIREMENTS
2.1 Arduino ATmega328P
Arduino UNO is a microcontroller board which is based on the ATmega328. which has 6 analog
pins,14 digital I/0 pins(from those 6 can be used as a PWM outputs),ceramic resonator frequency of
16MHz, a USB connection, a power jack, an ICSP header, and a reset button. The UNO differs
from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it
features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter. The Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground.
The Arduino UNO ATmega328p is as shown in fig 2.1.

Fig 2.1: Arduino UNO ATmega328p

2.1.1 Specifications
 It is an ATmega328P based Microcontroller

 The Operating Voltage of the Arduino is 5V

 The recommended input voltage ranges from 7V to 12V

 The i/p voltage (limit) is 6V to 20V

 The Digital input and output pins-14

 The Digital input & output pins (PWM)-6

 The Analog input pins are 6

 The DC Current for each Input/Output Pin is 20 mA

Dept., of ECE, MIT Mysore Page 5


Air and water quality monitoring system

 The DC Current used for 3.3V Pin is 50mA

 The Flash Memory -32 KB, and 0.5 KB memory is used by the boot loader

 It has SRAM of 2 KB

 It has EEPROM of 1 KB

 The speed of the CLK is 16 MHz

 It has an In Built LED

 The length and width of the Arduino are 68.6 mm X 53.4 mm

 The weight of the Arduino board is 25grm

2.1.2 POWER

The Arduino board operates with an external supply of 6 to 20 volts. If the board is supplied less than
5V then the board may gets unstable or if the board is used more than 12V then the voltage regulator
may overheat that damage the board. So the recommended range is 7 to 12 volts. The power pins are as
follows:

 VIN:- The input voltage to the Arduino board that it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). This external
power supply provides the 5v DC supply to the pin no7 of the Arduino UNO microcontroller or
the other way of operating the micro controller by using the power jack.

 5V:- The 5volt regulated power supply used to either power the microcontroller or other
components on the board. This can be supplied through either from VIN via on-board regulator
or it can be supplied by USB or another regulated 5V supply.

 3.3V:- The 3.3 volt supply generated by the on-board regulator and maximum current drawn is
50mA.

 GND :- Ground pin.

Dept., of ECE, MIT Mysore Page 6


Air and water quality monitoring system

The pin diagram of Arduino UNO is as shown in fig 2.2

Fig 2.2: Pin diagram of Arduino UNO

2.1.3 INPUT AND OUTPUT PINS

It has 14 digital pins and 6 analog pins in the Arduino board can be used as an input or output, under the
software control and they are operates at 5 volts. When these input and output pins are operating
condition that each pin can receive 20mA. It has an internal pull-up resistor of 20K-50K ohm. The
maximum current (40mA) should not exceed at any I/O pin and to avoid permanent damage of the
microcontroller. The board has 6 analog inputs, named as A0 to A5; each pin provides 10 bits of
resolution. By reference, they measure from 0v to 5v so that by using AREF pin and the analog
reference function it is possible to change the range. In addition, some pins have specialized functions:

 Serial: pins 0 (RX) and 1 (TX). These pin are Used for Receive (RX) or Transmit (TX) TTL
serial data and connected to the corresponding pins of the Arduino UNO USB-to-TTL serial
chip.
 External interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge and a change in value.
 PWM (pulse-width modulation): pins 3, 5, 6, 9, 10, and 11 can provide 8-bit PWM output with
the Analog Write() function.
 SPI (Serial Peripheral Interface): pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK). The
pins support SPI communication using the SPI library.

Dept., of ECE, MIT Mysore Page 7


Air and water quality monitoring system

 TWI (two-wire interface): pin SDA (A4) and pin SCL (A5). Support TWI communication
using the Wire library. AREF (analog reference): Reference voltage for the analog inputs.

2.1.5 COMMUNICATION

The UNO has number of facilities for communicating with a computer and ATmega328 provides UART
TTL serial communication over USB and which is appears as a virtual com port to software on the
computer. The 16u2 firmware uses the standard USB COM ports, and no external port driver is needed.
However, in Windows, information file is required. Arduino software (IDE) includes a serial monitor
which allows text data to be sent to and from the board. The RX and TX LEDs on the board will flash
when data is being transmitted through the USB-to-serial chip and USB is connected to the computer
(but not for serial communication on pins 0 and 1). A Software serial library allows serial
communication on any of the digital pin of Arduino UNO.

2.2 Temperature Sensor


LM35 is a device used for measuring temperature which is having an analog output voltage proportional
to the temperature. Which provides output voltage in Centigrade (Celsius). It doesn’t requires any
external calibration circuitry. It has an sensitivity of 10 mV/degree Celsius. This device has an
advantage over linear temperature sensors calibrated in kelvin , if the user is not required to subtract a
large constant value from the output to obtain convenient Centigrade scaling. This device does not
require any external calibration / triming to provides a typical accuracies of ¼ at the room temperature
and ¾ over a full degree of 55 to 150 temperature. The LM35 temperature sensor is as shown in fig 2.3.

Fig 2.3: LM35 temperature sensor

2.2.1 Features

 It can be Calibrated Directly in Celsius (Centigrade)


 It has Linear + 10-mV/°C Scale Factor
Dept., of ECE, MIT Mysore Page 8
Air and water quality monitoring system

 It has 0.5°C Ensured Accuracy (at 25°C)


 They Rated for Full 55°C to 150°C Range
 They Suitable for Remote Applications
 It has Low-Cost Due to Wafer-Level Trimming
 It Operates From 4 V to 30 V
 It has Less Than 60-µA Current Drain
 It has Low Self-Heating, 0.08°C in Still Air
 It has a Non-Linearity Only ±¼°C Typical value
 It has Low-Impedance Output, 0.1 ohm for 1-mA Load
2.2.2 Applications
 Used for Power Supplies
 Used in Battery Management
 Used in HVAC
 Used in home Appliances

2.2.3 Pin Connection

The pin connections are as shown in the fig 2.4

Fig 2.4: Pins connections from Arduino to Temperature Sensor

Dept., of ECE, MIT Mysore Page 9


Air and water quality monitoring system

2.3 MQ-135 Sensor

The MQ-135 is a air quality sensor they are used in air quality control equipments measurements for
building/offices ,and they are suitable for detecting of NH3,NOx,alcohol,Benzene,smoke,CO2 ,etc.

Fig 2.5: MQ-135gas Sensor

2.3.1 Features

 They has High sensitivity towards Ammonia, Sulfide and Benzene


 It has Stable and Long Life
 The Detection Range for NH3 is 10-300ppm: 10 - 300 , for Benzene 10-1000ppm, for Alcohol
10-300ppm
 The Heater Voltage is about 5V
 The Dimensions is 18mm Diameter ,High excluding pins 17mm , 6mm High pins

2.3.2 Pin configuration

The pin configuration table of MQ135 air sensor is as shown in table 2.1

Table 2.1 MQ135 Pin out

Pin no Pin name Description

1 VCC Used to power the sensor. The operating voltage is +5v

2 Ground Used to connect the module to system ground

3 Digital out Used to get digital output from this pin, by setting
threshold value using the potentiometer

4 Analog out This pin outputs 0-5v analog voltage based on the intensity

Dept., of ECE, MIT Mysore Page


10
Air and water quality monitoring system

of gas

2.3.3 Pin Connection

The pin connection is as shown in the fig 2.6

Fig 2.6: Pins connections from Arduino to Temperature Sensor

2.4 Turbidity sensor


The turbidity sensor detects water quality by measuring the levels of turbidity. It uses light to detect
suspended particles in water by measuring the light transmittance and scattering rate, which changes
with the amount of total suspended solids (TSS) in water. As the TSS increases, the liquid turbidity level
increases. Turbidity sensors are used to measure water quality in rivers and streams, wastewater and
effluent measurements, control instrumentation for settling ponds, sediment transport research and
laboratory measurements. This sensor provides analog and digital signal output modes. The threshold is
adjustable when in digital signal mode. You can select the mode according to your MCU. The turbidity
sensor is as shown in fig 2.7.

Fig 2.7: Turbidity sensor

Dept., of ECE, MIT Mysore Page


11
Air and water quality monitoring system

What material causes liquid to be turbid?

The material that causes liquid to be turbid ranges from clay, silt, very tiny inorganic and organic matter,
growth of phytoplankton, algae, dissolved coloured organic compounds and other microscopic
organisms.

How does these particles get into the water?

These materials can get into liquids in various ways from human activities (eg. construction, mining),
soil erosion, waste discharge to also algae growth.

For example, in clear weather, rivers are clear where turbidities are low. But after a rainstorm, particles
from the surrounding land are washed into the river due to the rain which gives water a muddy brown
colour where turbidities level are high.

2.4.1 Specifications
 Operating Current: 40mA (MAX)
 Response Time : <500ms
 Insulation Resistance: 100M (Min)
 Analog output : 0-4.5V
 Digital Output: High/Low level signal (the threshold value can be adjusted the
potentiometer)
 Operating Temperature : 5°~90°
 Storage Temperature : -10°~90°
 Weight : 30g
 Adapter Dimensions: 38mm*28mm*10mm/1.5inches *1.1inches*0.4inches
2.4.2 Pin Connection

The pin connection is as shown in the fig 2.8

Fig 2.8: Pin Connection from Arduino UNO to turbidity sensor

Dept., of ECE, MIT Mysore Page


12
Air and water quality monitoring system

2.5 16X2 LCD display

This is an LCD Display designed for E-blocks. It is a 16 character and 2-line alphanumeric LCD display
connected to a single 9-way D-type connector. This allows the device to be connected to the E-Block
I/O ports. The LCD display takes the data serial format which is tabulated below the figure 2.9. The
display also requires a 5V power supply [it should not exceing the 5V because it damage to the device].
The 5V is generated from the E-blocks Multi programmer or a 5V fixed regulated power supply. The
potentiometer (RV1) is a contrast control that should be used to adjust the contrast of the display for the
environment it is used. The 16X2 LCD display is as shown in fig 2.9.

Fig 2.9: 16X2 LCD


display

2.5.1Features
 The Operating Voltage is 4.7V to 5.3V

 The Current consumption is 1mA without a backlight

 It has Alphanumeric LCD display module, meaning can display alphabets and numbers

 It consists of two rows and each row can print 16 characters at a time.

 It can work with both 8-bit as well as in 4-bit mode


 It supports both Blue and Green backlight

The pin out table for 16x2 LCD display is as shown in table 2.2.

Table 2.2 16x2 LCD Pin out table

Pin no Function Name

1 Ground(0V) Ground

2 Supply voltage (5V) VCC

Dept., of ECE, MIT Mysore Page


13
Air and water quality monitoring system

3 Contrast adjustment. Uses variable resistor such as VEE


potentiometer

4 Select command register when low, and data Register


register when high. select

5 Low to write to the register, high to read from the Read/write


register.

6 Send data to data pin when a high to low pulse is Enable


given

7 -14 8 bit data pin DB0 –


DB7

15 Backlight VCC(5V) LED+

16 Backlight ground(0V) LED-

Register select (RS)

The LCD has 2 registers commonly called command and data. This is used to switch from one register
to other register. RS=0 for command register and RS=1 for data register.

Command Register

This register accumulates the command instruction given to the LCD. A command is an instruction for
predefined tasks for example initializing, clearing the screen extra. When RS=1, command register is
selected.

Data Register

The data register is used to stores the data and to be displayed on the LCD screen. The data is available
in the ASCII format of the character and is also displayed on the LCD. When RS=0 data register is
selected. The command code table for LCD is as shown in table 2.3

Table 2.3 Command code table for LCD

Dept., of ECE, MIT Mysore Page


14
Air and water quality monitoring system

SL no Hex Code Command

1 01 Clear display screen

2 02 Return home

3 04 Decrement cursor

4 06 Increment cursor

5 05 Shift display right

6 07 Shift display left

7 08 Display off, cursor off

8 0A Display off, cursor on

9 0C Display on, cursor off

10 0E Display on, cursor blinking

11 0F Display on, cursor blinking

12 10 Shift cursor position to left

13 14 Shift cursor position to right

14 18 Shift the entire display to the left

15 1C Shift the entire display to the


right

16 80 Force cursor to beginning (1st


line)

17 C0 Force cursor to beginning (2nd


line)

18 38 2 lines and 5x7 matrix

2.5.2 Pin connections

The pin connections are as shown in fig 2.10

Dept., of ECE, MIT Mysore Page


15
Air and water quality monitoring system

Fig 2.10: Pin Connection from Arduino UNO to 16x2 LCD Display

2.5 SIM900 GPRS Module


This is a quad-band GSM/GPRS module, which is works on frequencies like GSM850MHz,
EGSM900MHz, DCS1800MHz and PCS1900MHz. It features like GPRS multi-slot class 12/10 and this
supports the GPRS coding schemes like CS-1, CS-2 and CS-4. The SIM900 is as shown in fig 2.11.

Fig2.11: GPRS module SIM900 IC

Configuration of 15.8x17.8x2.4mm, which can meet almost all the user applications in all space
requirements space with a tiny name such as PDA, smart phone and a another mobile devices. It has 88
pin pads of LGA packaging, and which provides all hardware interfaces between the customer’s boards
and a module.
 This supports 5x5x2 keypads.
 By using only one full modem serial port ,user can configure two serial ports.
 It has only one USB, that USB interface supports debug, downloading the software.
 It has audio channel which includes two microchip input: a receiver output and a speaker output.
 It is commonly has Programmable general purpose input and output.
 Which is equipped with SIM card interface.
 It supports frequency modulation(FM)
Dept., of ECE, MIT Mysore Page
16
Air and water quality monitoring system

 It supports one pulse width modulation (PWM)


SIM900 has a current consumption as low as 0.7mA in sleeping mode because which is designed
with power saving technique. The features of SIM900 is as shown in table 2.4

Table 2.4: SIM900 key features

Feature Implementation
Power supply 3.4V ~4.4V
Power saving Typical power consumption in sleep mode is 0.7mA
(AT+CFUN=0 )
Frequency bands  Quad-band: GSM 850, EGSM 900, DCS 1800, PCS 1900.
SIM800L can search the 4 frequency bands automatically.
The frequency bands can also be set by AT command
“AT+CBAND”. For details, please refer to document.
 Compliant to GSM Phase2/2+
 Class 4 (2W) at GSM 850 and EGSM900
Transmitting power
 Class 1 (1W) at DCS 1800 and PCS1900
 GPRS multi-slot class12(default)
GPRS connectivity
 GPRS multi-slot class 1~12(option)
Temperature range  Normal operation: -40°C ~+85°C
 Storage temperature -45°C ~+90°C
Data GPRS  GPRS data downlink transfer: max. 85.6kbps
 GPRS data uplink transfer: max. 85.6kbps
 Coding scheme: CS-1, CS-2, CS-3 andCS-4
 PAP protocol for PPP connect
 Integrate the TCP/IP protocol.
 Support Packet Broadcast Control Channel(PBCCH)
 CSD transmission rates:2.4,4.8,9.6,14.4kbps
CSD  Support CSD transmission
USSD  Unstructured Supplementary Services Data (USSD)support
 MT, MO, CB, Text and PDU mode
SMS
 SMS storage: SIM card
SIM interface Support SIM card: 1.8V, 3V
External antenna Antenna pad
Speech codec modes:
 Half Rate (ETS06.20)
 Full Rate (ETS06.10)
Audio features  Enhanced Full Rate (ETS 06.50 / 06.60 /06.80)
 Adaptive multi rate(AMR)
 Echo Cancellation
 Noise Suppression
Serial port:
 Full modem interface with status and control lines, un
Dept., of ECE, MIT Mysore Page
17
Air and water quality monitoring system

balanced, asynchronous.
 1200bps to115200bps.
 Can be used for AT commands or data stream.
Serial port and debug  Support RTS/CTS hardware handshake and software
port ON/OFF flow control.
 Multiplex ability according to GSM 07.10 Multiplexer
Protocol.
 Auto banding supports baud rate from 1200 bps to57600bps.
 Upgrading firmware
Debug port:
 USB_DM and USB_DP
 Can be used for debugging and upgrading firmware.
Phonebook management Support phonebook types: SM, FD, LD, RC, ON, MC.
SIM application toolkit GSM 11.14 Release 99
Real time clock Support RTC
Timing functions Use AT command set
Size:15.8*17.8*2.4mm
Physical characteristics
Weight:1.35g
Firmware upgrade Main serial port or USB port.
The table 2.5 shows the coding schemes and maximum net data rates over air interface in SIM800L

Table 2.5: Coding schemes and maximum net data rates over air interface
Coding scheme 1 timeslot 2 timeslot 4 timeslot

CS-1 9.05kbps 18.1 kbps 36.2 kbps

CS-2 13.4kbps 26.8 kbps 53.6 kbps

CS-3 15.6kbps 31.2 kbps 62.4 kbps

2.5.1Operating Mode

The table 2.6 summarizes the various operating modes of SIM900.

Dept., of ECE, MIT Mysore Page


18
Air and water quality monitoring system

Table 2.6: Overview of operating modes

MODE FUNCTION

Module will automatically go into sleep mode if the


conditions of sleep mode are enabling and there is no
GSM/GPRS SLEEP on air and no hardware interrupt (such as GPIO
interrupt or data on serial port).
In this case, the current consumption of module will
reduce to the minimal level.
In sleep mode, the module can still receive paging
message and SMS.
GSM Software is active. Module is registered to the GSM
IDLE network, and the module is ready to communicate.
NORMAL Connection between two subscribers is in progress. In
GSM TALK
OPERATION this case, the power consumption depends on network
settings such as DTX off/on, FR/EFR/HR, hopping
sequences, antenna.
Module is ready for GPRS data transfer, but no data is
GPRS STAND BY currently sent or received. In this case, power
consumption depends on network settings and GPRS
configuration.
There is GPRS data transfer (PPP or TCP or UDP) in
GPRS DATA progress. In this case, power consumption is related with
network settings (e.g. power control level);
uplink/downlink data rates and GPRS configuration (e.g.
used multi-slot settings).
Normal power down by sending AT command “AT+CPOWD=1” or using the
PWRKEY. The power management unit shuts down the power supply for the
baseband part of the module, and only the power supply for the RTC is remained.
POWER DOWN Software is not active. The serial port is not accessible. Power supply (connected
to VBAT) remains applied.
MINIMUM AT command “AT+CFUN” can be used to set the module to a minimum
FUNCTIONALIT functionality mode without removing the power supply. In this mode, the RF part
Y MODE of the module will not work or the SIM card will not be accessible, or both RF part
and SIM card will be closed, and the serial port is still accessible. The power
consumption in this mode is lower than normal mode.

Chapter 3

SOFTWARE REQUIREMENTS
Dept., of ECE, MIT Mysore Page
19
Air and water quality monitoring system

3.1 INTRODUCTION

The Arduino IDE(Integrated development environment) is an open source software that is mainly used
for writing and compiling the code in the Arduino Uno module. It is official software making code
compilation too easy and it is easily available for operating systems like MAC, Windows, Linux. The
software requirement of the project mainly makes use of Arduino IDE 1.8.5 version. The Arduino is an
open source computer company project and it is used for designs microcontroller kits for building digital
devices and interactive object that can sense and control object in the physical world. The Arduino
project are distributed as open source hardware and software which are licensed under the GNU lesser
general public license or the GNU general public license that permitting the manufacture of Arduino
boards and software distribution by any one. The Arduino IDE 1.8.5 software is as shown in fig 3.1.

Fig 3.1: ARDUINO IDE 1.8.5 SOFTWARE

3.2 ARDUINO IDE

Dept., of ECE, MIT Mysore Page


20
Air and water quality monitoring system

The Arduino IDE(Integrated Development Environment) contains a text editor for writing code. The
message area such as text console, toolbar with buttons for common functions and series of menu. It
connects to the Arduino and genuine hardware to upload programs that communicate with them. The
Arduino IDE toolbar screen is as shown in fig 3.2. The table for Arduino IDE toolbar is as shown in
table 3.1.

FIG 3.2: ARDUINO IDE TOOLBAR SCREEN

TABLE 3.1 ARDUINO IDE TOOLBAR

Verify

It checks the code for error compiling it.

Upload

It compiles the code and upload it to the configured board.

New

Creates a new sketch

Open

Presents a menu of all the sketches in the sketch book. Clicking one will open it within the
current window overwriting it content.

Save
Dept., of ECE, MIT Mysore Page
21
Air and water quality monitoring system

Save your sketches

Serial monitor

Opens the serial monitor

3.3 WRITING SKETCHES

Programs written using Arduino Software (IDE) are called sketches. These sketches are written in the
text editor and are saved with the file extension .inf. The editor has a feature of cutting/passing and for
searching/replacing text. The message area gives feedback while saving and exporting the displays
errors. Figure 3.1 shows the window when the Arduino IDE software is opened. The console displays
text output by the Arduino Software (IDE), including complete error messages and other information.
The bottom right hand corner of the window displays the configured board and the serial port. The
toolbar buttons allow to verify and upload programs such as create, open, save sketches, and open the
serial monitor. The additional commands are found within the five menus: File, Edit, Sketch, Tools, and
Help. The menus are context sensitive, which means only those items relevant to the work currently
being carried out are available.

The sketch involves the following options:

[1] Verify/Compile-This step checks the sketch for errors compiling it. It will report memory usage for
code and variables in the console area.

[2] Upload-Compiles and uploads file on to the configured board through the configured port.

[3] Libraries-The library can be added to the sketch by inserting #include statements at the start of the
code. Libraries provide extra functionality for use in sketches, e.g. working with hardware or
manipulating data using a library in a sketch, select it from the Sketch > Import Library menu. This will
insert one or more #include statements at the top of the sketch and compile the library with the sketch
because libraries are uploaded to the board with user sketch, they increase the amount of space it takes
up. If a sketch no longer needs a library, simply delete its #include statements from the top of the code.
There is a list of libraries in the reference. Some libraries are included with the Arduino software. Others
can be downloaded from a variety of sources or through the Library Manager.

3.4 TOOLS

Tools that are needed while testing the codes are:


Dept., of ECE, MIT Mysore Page
22
Air and water quality monitoring system

[1] Serial Monitor: Serial monitor window initiates the exchange of data with any connected board on
the currently selected Port. It usually resets the board, if the board supports Reset over serial port
opening. This Displays serial data being sent from the Arduino or Genuine board. In order send data to
the board, enter text and click on the "send" button. Choose the baud rate from the drop-down that
matches the rate passed to serial. Begin in the sketch.

[2] Board Select the board as esp8266 while dumping the code to Wi-Fi module and select Arduino
board while connected to Arduino UNO. The board selection sets the parameters like CPU speed and
baud rate used when compiling and uploading sketches. The Arduino Software (IDE) includes the built
in support for the boards in the following list, all based on the AVR Core. The Boards Manager included
in the standard installation allow to add support for the growing number of new boards based on
different cores like Arduino Due, Arduino Zero, Edison, Galileo and so on.

[3] Port This menu contains all the serial devices (real or virtual) on user machine. It will automatically
refresh every time you open the top-level tools menu. 3.2.3 HELP here user find easy access to a
number of documents that come with the Arduino Software (IDE). The user have access to Getting
Started, Reference, this guide to the IDE and other documents locally, without an internet connection.

3.5 UPLOADING

Before uploading sketch, the user need to select the correct items from the Tools like Board and Port.
These boards are described as COM1 or COM2 for a serial board and COM4, COM5 and COM or
higher for a USB boards. To find out this, the user have to look for USB serial device in the port section
of the Windows Device Manager. Once selected the correct serial port and board, press the upload
button in the toolbar or select the Upload item from the Sketch menu. The Current Arduino boards will
reset automatically and begin the upload. On most boards, contains the RX and TX LEDs blink as the
sketch is uploaded. Thus Arduino Software (IDE) will display a message when the upload is complete,
or show an errors. When the user uploads a sketch, they will be using the Arduino boot loader, a small
program that has been loaded on to the microcontroller on the board. It allows the user to upload code
without using any additional hardware. This boot loader is active for a few seconds when the board
resets; then it starts whichever sketch was most recently uploaded to the microcontroller. The boot
loader will blink on-board (pin 13) LED when it starts that is when the board resets.

Chapter 4

Software and Hardware Implementation


4.1 Software Implementation
Dept., of ECE, MIT Mysore Page
23
Air and water quality monitoring system

The implementation of the software involves writing code for the proposed system using Arduino UNO.
We need to install the software package on our PC.

The requirements for installations are as follows

 A computer.
 An Arduino compatible microcontroller.
 A USB A-to-B cable or another way to connect your Arduino compatible microcontroller to
computer.

4.1.1 Flow-chart

The system flow is as shown in fig 4.1 which as follows.

1. Initialize the LCD display and serial communication.


2. Read the MQ135 gas sensor then we have to display CO, CO2, NH4, Ethanol, Toluene, Acetone
in PPM.
3. If the conditions satisfies then LCD can displays AQI is hazardous,unhealthy,moderate and safe
for breathing.
4. Read LM35 temperature sensor,if the conditions are satisfies it displays temperature as
hot,moderate and cold.
5. Read turbidity sensor,if the conditions are satisfies it displays WQI as unsuitable,poor and safe
for drinking.
6. Finally the SMS notification is send to the user via GSM module.

Dept., of ECE, MIT Mysore Page


24
Air and water quality monitoring system

Start

Initlaise LCD and Serial


Communication

Read MQ135 Gas


Sensor

Display
CO, CO2, NH4, Ethanol, Toluene, Acet
one (in ppm)

if if if if if
(CO, CO2, NH4, (CO, CO2, NH4, (CO, CO2, NH4, (CO, CO2, NH4, (CO, CO2, NH4,
Ethanol, Ethanol, Ethanol, Ethanol, Ethanol,
Toluene, Toluene, Toluene, Toluene, Toluene,
Acetone)>4000 Acetone)>2000 Acetone)>500 Acetone)>100 Acetone)<100

AQI=
AQI= VERY AQI= AQI= AQI=
HAZARDOU
UNHEALTHY UNHEALTHY MODERATE SAFE
S

Read LM35 Temp


erature sensor

if if if if
temperature>44'C temperature>34'C temperature>24'C temperature<24'C

Very HOT HOT MODERATE COLD

Read Water Turbi


dity sensor

if NTU >1000 if NTU >300 if NTU <100

UNSUITABLE POOR SAFE

Stop

Fig 4.1: Process flow of the system

Dept., of ECE, MIT Mysore Page


25
Air and water quality monitoring system

4.2 EXPERIMENTAL RESULTS

A . Simulation work

The programming for each sensor will be written in Arduino IDE with the help of Embedded C for the
perfect calculations from the sensor readings which helps to build an efficient system without
compilation errors.

The simulation work of the project is done by using ISIS simulation tool software Proteus. The
project proposal with all the interconnections are done in the Proteus and also checked for the working
of the circuit with the simulation feature. This methodology gives a broad outlook of how the proposed
project will work with simulated inputs and outputs by correcting the possible errors which can be occur
in the real time hardware working of the project.

The Arduino IDE sensor programming is used to create an HEX file from the written code
Embedded C program. First Open Proteus constructed circuit and then click on Arduino processor and
then up-load the HEX file. Then the sensor monitoring readings can be visualized by the 16X2 LCD
display.The simulation circuit diagram is as shown in fig 5.1.

Dept., of ECE, MIT Mysore Page


26
Air and water quality monitoring system

Fig 5.1: Simulation circuit diagram

The expected simulation results of the system is as shown in fig 5.2.

Fig 5.2: Simulation results

4.2.2 Hardware Implementation

The proposed system with all the sensors are interfaced with Arduino board is as shown in the figure
5.3. The necessary program is dumped into developed hardware kit for monitoring the values and the
same is displayed on 16X2 LCD. Also the message alert notification can be sent to the user phone via
GSM module. [1]

Dept., of ECE, MIT Mysore Page


27
Air and water quality monitoring system

Fig 5.3: Hardware connections

The information about the air and water quality displayed on 16X2 LCD is shown in figure 5.4.

Dept., of ECE, MIT Mysore Page


28
Air and water quality monitoring system

Fig 5.4: Results on LCD Display

The message alert notification sent to the user phone via GSM module is as shown in the figure 5.5.

Fig 5.5: Message alert notification


sent to the user via GSM

Dept., of ECE, MIT Mysore Page


29
Air and water quality monitoring system

REFERENCES:

1. “AIR AND WATER QUALITY THROUGH IOT USING AQUATIC SURFACE


DRONE”, Pavankumar, Praveenkumar 2018 International journal of pure and applied
mathematics Volume 118 No. 22.

2. “WATER SENSOR NETWORK FOR RIVER WATER QUALITY MONITORING IN


INDIA”, K.A UnnikrishnaMenon, Divya P, Mannesh V, Ramesh 2018 IEEE.

3. “DESIGN AND IMPLEMENTATION OF LPWA BASED ON AIR QUALITY


MONITORING SYSTEM”, KanZheng, Shaohang Zhao, Zhe yang, XiongXiong, Wei Xiong
2016 IEEE Volume 4.

4. “IOT BASED WATER QUALITY MONITORING SYSTEM”, MourvikaShirode, Monika


Adaling, JyothiBiradar, Trupti mate. 2018 International journal of scientific research in computer
science Engineering and information technology (IJSRCSEIT), volume 3.

5. “AIR QUALITY MONITORING SYSTEM BASED ON IOT USING RASPBERRY PI”,


somanshkumar2017IEEE.
6. “DESIGN AND FABRICATION REAL TIME AIR QUALITY MONITORING SYSTEM
BASED ON WEB APPLICATION”, Muhammad F, ramadhani , brian yuliarto , nugraha at
International Conference on Instrumentation Control and Automation(ICA) ,ISBN:978-1-4673-
5798-2/13,@2015 IEEE.

Dept., of ECE, MIT Mysore Page


30
Air and water quality monitoring system

7. “AIR QUALITY MONITORING SYSTEM BASED ON IOT USING RASPBERRY PI”,


somansh kumar at International Conference on Computing, Communication and
Automation(ICCCA2017),ISBN:978-1-5090-6471-7/17, @2017 IEEE.
8. “A MOVABLE INDOOR AIR QUALITY MONITORING SYSTEM”, Liu peng, Fu Danni,
Jiang Shengqian, Wang Minggjie International Conference on Cybernetics, Robotics and
Control(CRC2017) ,ISBN: 978-1-5386-0677-3/17, @2017 IEEE.
9. “REMOTE AIR QUALITY MONITORING SYSTEM BY USING MYRIO-LABVIEW”,
Kok Mun Ng, Muhamad Azri Haziq Mohd Suhaimi , Adizul Ahmad , N.A Razak at IEEE
Control and System Graduate Research Colloquium(ICSGRC2018),ISBN:978-1-5386-6321-
9/18,@2018 IEEE.
10. “DESIGN AND IMPLEMENTATION OF LPWA-BASED AIR QUALITY
MONITORING SYSTEM”, Kan Zheng, Shaohang Zhao, Zhe yang, Xiong Xiong, Wei
Xiang ,volume 4,@2016 IEEE.
11. “CONTROLLING STRATERGIES AND TECHNOLOGIES OF VOLATILE ORGANIC
COMPOUNDS POLLUTION IN INTERIOR AIR OF CARS”, Chen X, Zhang G, Chen H,
@2015 IEEE.
12. “AIR AND WATER QUALITY MONITORING THROUGH IOT BY USING AQUATIC
SURFACE DRONE”, Pavankumar, s. Praveenkumar , International journal of pure and applied
mathematics, vol.118, no.22, 2018 ,pp.51-55. 8. “Real time ambient air quality monitoring
system using sensor technology” Jyothi Sharma, Siby John , International journal of advanced in
mechanical and civil engineering,vol.4, ISSN: 2394-2827, issue-1,Feb-2017.
13. “DESIGN AND ANALYSIS OF IOT BASED AIR QUALITY MONITORING SYSTEM”,
Ajithesh Kumar ,Mona Kumari, Harsh Gupta , at International Conference on Power Electronics
and IOT Applications in Renewable Energy and its Control(PARC),978-1-7281-6575-2/20
@2020 IEEE.
14. “MQTT BASED AIR QUALITY MONITORING SYSTEM USING NODE MCU AND
NODERED”, Somphop Chanthakit,Choopan Rattanapoka at Seventh ICT International Student
Project-Conference(ICT-ISPC),978-1-5386-7805-3/18,@2018IEEE.
15. “DESIGN AND FABRICATION REAL TIME AIR QUALITY MONITORING SYSTEM
BASED ON WEB APPLICATION”, Muhammad F, ramadhani , brian yuliarto , nugraha at
International Conference on Instrumentation Control and Automation(ICA) ,ISBN:978-1-4673-
5798-2/13,@2015 IEEE.
16. “AIR QUALITY MONITORING SYSTEM BASED ON IOT USING RASPBERRY PI”,
somansh kumar at International Conference on Computing, Communication and
Automation(ICCCA2017),ISBN:978-1-5090-6471-7/17, @2017 IEEE.

Dept., of ECE, MIT Mysore Page


31
Air and water quality monitoring system

17. “DESIGN AND DEVELOPMENT OF REMOTE LOCATION WATER QUALITY


MONITORING SYSTEM USING IOT”, M. Joseph Vishal Kumar, Krishna Samalla, at
ISBN: 978-1-5386-0677-3/17, @2017 IEEE.
18. “ADAPTIVE CONTROL OF WATER QUALITY IN WATER DISTRIBUTION
NETWORKS”, Zhong Wang, Marios M. Polycarpou, James G. Uber, and Feng Shang at IEEE
TRANSACTIONS ON CONTROL SYSTEMS TECHNOLOGY, VOL. 14, NO. 1, JANUARY
2006.
19. “REMOTE AIR QUALITY MONITORING SYSTEM BY USING MYRIO-LABVIEW”,
Kok Mun Ng, Muhamad Azri Haziq Mohd Suhaimi, Adizul Ahmad, N.A. Razak Fakulti
Kejuruteraan Elektrik, 2018 9th IEEE Control and System Graduate Research Colloquium
(ICSGRC 2018), 3 - 4 August 2018, Shah Alam, Malaysia.

Dept., of ECE, MIT Mysore Page


32

You might also like