Project Report
Project Report
Project Report
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 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.
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.
Power supply
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.
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.
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.
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
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.
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.
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.
2.1.1 Specifications
It is an ATmega328P based Microcontroller
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
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.
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.
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.1 Features
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.
2.3.1 Features
The pin configuration table of MQ135 air sensor is as shown in table 2.1
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
of gas
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.
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
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.
2.5.1Features
The Operating Voltage is 4.7V to 5.3V
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.
The pin out table for 16x2 LCD display is as shown in table 2.2.
1 Ground(0V) Ground
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
2 02 Return home
3 04 Decrement cursor
4 06 Increment cursor
Fig 2.10: Pin Connection from Arduino UNO to 16x2 LCD Display
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
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
2.5.1Operating Mode
MODE FUNCTION
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.
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.
Verify
Upload
New
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
Serial monitor
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.
[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
[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
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.
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
Start
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
if if if if
temperature>44'C temperature>34'C temperature>24'C temperature<24'C
Stop
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.
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]
The information about the air and water quality displayed on 16X2 LCD is shown in figure 5.4.
The message alert notification sent to the user phone via GSM module is as shown in the figure 5.5.
REFERENCES: