Xerox Project
Xerox Project
ON
IoT BASED WIRELESS SENSOR NETWORK FOR AIR
POLLUTION MONITORING
Submitted in partial fulfilment of the requirement for the award
of the degree of
Bachelor of Technology
In
Electronics And Communication Engineering
Submitted by
C. VENKATA SUBBAIAH 19X51A0409
D. FAYAZ 19X51A0411
P. LOKESH 19X51A0444
P. MANOJ KUMAR 19X51A0443
(ESTD-2007)
YEAR: 2019-2023
SANTHIRAM ENGINEERING COLLEGE::NANDYAL
(Approved by AICTE, New Delhi: Permanently Affiliated to J.N.T. University,Anantapuramu,A.P.)
Accredited by NAAC (Grade-A), An ISO 9001:2015 Certified Institution,
2(f) and 12(b) recognition by UGC Act, 1956
CERTIFICATE
This is to certify that the dissertation entitled “IoT BASED WIRELESS SENSOR NETWORK FOR
AIR POLLUTION MONITORING” that is being submitted by C.VENKATA SUBBAIAH
(19X51A0409), D.FAYAZ (19X51A0411), P.LOKESH (19X51A0444), P.MANOJ KUMAR
(19X51A0443) Under the Esteemed Guidance of Mr. N. SREENIVASA RAO, M. Tech. Assistant
Professor Dept. of ECE for Project in fulfilment of the award the of Bachelor of Technology Degree
in ELECTRONICS AND COMMUNICATION ENGINEERING in SANTHIRAM
ENGINEERING COLLEGE, Nandyal (Permanently to J.N.T. University, Anantapuramu) is a
record of bonafide work carried out by them under guidance and supervision. The results embodied in
this project have not been submitted to any other university for the award of any Degree.
This will certainly not be complete without acknowledgments paid to all those who have
helped us in doing our project work.
Dr. M. V. Subramanyam garu, who has been observed posing valance in abundance
and forwards our individuality to acknowledge our project work tendentiously.
We also express the overall exhilaration and gratitude to all the Teaching and Non-
Teaching staff of the ECE Dept., who admitted our project work and accentuated our
attitude.
We also extend our heartfelt and sincere gratitude to our beloved parents for their
tremendous motivation and moral support.
PAGENO
ABSTRACT
CHAPTER-1
INTRODUCTION
1.1 Introduction 1
CHAPTER- 2
PROPOSED SYSTEM
2.1 Proposed System 4
2.3 Applications 5
2.4 Advantages 5
CHAPTER-3
EMBEDDED SYSTEMS
Hardware CONSTRAINTS
4.1 NodeMCU 14
4.3 Transformer 28
CHAPTER -5
SOFTWARE CONSTRAINTS
CHAPTER-6
RESULT AND ANALYSIS 48
CONCLUSION 49
REFERENCES 50
ANNEXURE
PUBLICATION CERTIFICATE
CERTIFICATES
IoT Based Wireless Sensor Network for Air Pollution Monitoring
ABSTRACT:
The level of pollution is increasing rapidly due to factors like industries, urbanization,
increasing in population, vehicle use which can affect human health. IOT Based Air Pollution
Monitoring System is used to monitor the Air Quality over a web server using Internet. It will
trigger an alarm when the air quality goes down beyond a certain level, means when there are
sufficient amount of harmful gases present in the air like CO2, smoke, alcohol, benzene, NH3
and NOx. It will show the air quality in PPM on the LCD and as well as on webpage so that air
pollution can be monitored very easily.
The system uses MQ135 and MQ6 sensor for monitoring Air Quality as it detects most harmful
gases and can measure their amount accurately.
LIST OF FIGURES
2.2 Block Diagram of IoT Based Wireless Sensor Network For Air Pollution 4
Monitoring
3.1 Embedded System Architecture 10
CHAPTER-1
INTRODUCTION
1.1 Introduction:
Air pollution is the biggest problem of every nation, whether it is developed or developing.
Health problems have been growing at faster rate especially in urban areas of developing countries
where industrialization and growing number of vehicles leads to release of lot of gaseous
pollutants. Harmful effects of pollution include mild allergic reactions such as irritation of the
throat, eyes and nose as well as some serious problems like bronchitis, heart diseases, pneumonia,
lung and aggravated asthma. According to a survey, due to air pollution 50,000 to 100,000
premature deaths per year occur in the U.S. alone. Whereas in EU number reaches to 300,000 and
over 3,000,000 worldwide. IOT Based Air Pollution Monitoring System monitors the Air quality
over a web server using Internet and will trigger an alarm when the air quality goes down beyond
a certain threshold level, means when there are sufficient number of harmful gases present in the
air like CO2, smoke, alcohol, benzene, NH3, LPG and NOx. It will show the air quality in PPM
on the LCD and as well as on webpage so that it can monitor it very easily. LPG sensor is added
in this system which is used mostly in houses. The system will show temperature and humidity.
The system can be installed anywhere but mostly in industries and houses where gases are mostly
to be found and gives an alert message when the system crosses threshold limit.
The explanation of the Air Quality Index (AQI) and its standard ranges are described in [1].
From 0-100 ppm the atmosphere is safe for living. If the ppm level increases above 100 then it
moves out of the safety zone. If the ppm value rises above 200 then it becomes extremely
dangerous for human life. The DHT11 sensor module is used to measure the temperature and the
humidity of the surroundings [2]. The MQ-135 gas sensor is used to measure the air quality of the
surroundings [3]. It can be calibrated with respect to fresh air, alcohol, carbon dioxide, hydrogen
and methane. In this project, it has been calibrated with respect to fresh air [9], [10]. In [4] the
controlling action of Node MCU has been described. This research has shown the uses of C++ as
the programming language for scripting the software code. It has an inbuilt Wi-Fi module which
allows the project to implement IoT easily. Arduino IDE is used to implement the coding part of
the project [5], [8]. Thing Speak cloud is used for the cloud service. It has a free version which
requires a delay of 15 seconds to upload an entry in the cloud [6], [7]. As this project uses two
sensors, both of them have internal heater elements and withdraw more power(P=V*I), so though
both sensors are turned ON, their output voltage levels vary and show unpredictable values due to
insufficient power drive. So, we used a separate power supply for the sensors as Node MCU alone
is not sufficient to drive two sensors [9].
1.4 Electronic design of liquefied petroleum gas leakage monitoring alarm, and
protection system based on discrete components:
Liquefied petroleum gas (LPG) is an important source of energy commonly used for domestic
purposes like cooking and heating in developing countries and for many commercial, industrial,
and agriculture purposes. LPG gas represents as an asphyxiant gas and because it is flammable, it
is very important for health and safety requirements monitor continuously the gas leakage and
doing the necessary actions at the cases of gas leakage. Many studies present a high-performance
gas leakage monitoring and protection systems through either microcontroller units or
computerized systems with wireless data communication technology. The high cost and the
complexity of these systems that are the main demerits. This paper presents an alternative
engineering solution of a simple system through a full electronic analog design based on discrete
components. The proposed electronic system works on continuous detecting LPG gas leakage level
though suitable gas detector, then based on the electronic design, a suitable actions of gas valve
control signal and sound alarm signal will be produced at happing state of the gas leakage. Both
Electronic design and simulation results of discrete components based are done by using National
Instruments NI Multsim software for electronic circuits design. The simulation results reflect the
effectiveness of the presented design and give indication of promising prototype of monitoring and
protection system of LPG gas leakage for home and/or industrial applications.
1.5 Design and Development of Gas Leakage Monitoring System using Arduino
and ZigBee:
Gas leakage in industrial area causes many health issues. Thus, to prevent such disasters
happen, the atmosphere of a workplace should be regularly monitored and controlled, in order to
maintain the clean air environment. However, efforts in industrial air quality control have been
impeded by the lack of science-based approaches to identify and assess atmosphere air quality
and level of dangerous gas. Therefore, a monitoring system for gas leakage detection needs to be
developed. For the development of this system, the combustible gas sensor (MQ9) was used in
order to detect the present of methane (CH4) and carbon monoxide gas (CO).
This sensor will detect the concentration of the gas according to the voltage output of sensor
and operated in the alarm system, autonomous control system and monitoring system by using
Arduino uno as the microcontroller for the whole system. Whereas the Zigbee will send the data
reading from the gas sensor to monitoring system that display on LabVIEW Graphical User
Interface (GUI). Besides, user can take immediate action upon the leakage occurs, else the gas
supply and the system will shut down automatically within 10 minutes to prevent the condition
becoming worst.
CHAPTER -2
PROPOSED SYSTEM
2.3 Applications:
• IOT and Arduino based LPG leakage detection system can be installed in Homes, Hotels,
LPG Cylinder storage areas. The main advantage of this project is that it can determine the
leakage and send the data over to a website, where it can be monitored and corrective
actions can be taken.
• If appropriate measures are taken quickly after it is reported over the IOT, it can help in
saving the loss of lives and property.
• Industrial perimeter monitoring
• Indoor air quality monitoring.
• Site selection for reference monitoring stations.
• Making data available to users.
2.4 Advantages:
• Easy to Install
• Updates On mobile phone directly
• Accurate Pollution monitoring
• Remote location monitoring
CHAPTER-3
EMBEDDED SYSTEMS
Each day, our lives become more dependent on 'embedded systems', digital information
technology that is embedded in our environment. More than 98% of processors applied today
are in embedded systems, and are no longer visible to the customer as 'computers' in the
ordinary sense. An Embedded System is a special-purpose system in which the computer is
completely encapsulated by or dedicated to the device or system it controls. Unlike a general-
purpose computer, such as a personal computer, an embedded system performs one or a few
pre-defined tasks, usually with very specific requirements. Since the system is dedicated to
specific tasks, design engineers can optimize it, reducing the size and cost of the product.
Embedded systems are often mass- produced, benefiting from economies of scale.
The increasing use of PC hardware is one of the most important developments in high-end
embedded systems in recent years. Hardware costs of high-end systems have dropped
dramatically as a result of this trend, making feasible some projects which previously would
not have been done because of the high cost of non-PC-based embedded hardware. But
software choices for the embedded PC platform are not nearly as attractive as the hardware.
Typically, an embedded system is housed on a single microprocessor board with the
programs stored in ROM. Virtually all appliances that have a digital interface -- watches,
microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems include an
operating system, but many are so specialized that the entire logic can be implemented as a
single program. Physically, Embedded Systems range from portable devices such as digital
watches and MP3 players, to large stationary installations like traffic lights, factory
controllers, or the systems controlling nuclear power plants. The applications software on such
processors is sometimes referred to as firmware. The simplest devices consist of a single
microprocessor (often called a "chip”), which may itself be packaged with other chips in a
hybrid system or Application Specific Integrated Circuit (ASIC). Its input comes from a
detector or sensor and its output goes to a switch or activator which (for example) may start
or stop the operation of a machine or, by operating a valve, may control the flow of fuel to an
Dept. of. E.C.E. SREC. Page 6
IoT BASED WIRELESS SENSOR NETWORK FOR AIR POLLUTION MONITORING
engine. As the embedded system is the combination of both software and hardware.
3.2 Definition of An Embedded System:
Embedded system is defined as, for a particular/specific application implementing the
software code to interact directly with that particular hardware what we built. Software is used for
providing features and flexibility.
Hardware = {Processors, ASICs, Memory...} is used for Performance (& sometimes
security).There are many definitions of embedded system but all of these can be combined into a
single concept. An embedded system is a special purpose computer system that is used for
particular task.
3.3 Example of An Embedded Systems:
Embedded systems are found in wide range of application areas. Originally they were used only
for expensive industrial control applications, but as technology brought down the cost of dedicated
processors, they began to appear in moderately expensive applications such as automobiles,
communication and office equipment and television Today's embedded systems are so inexpensive
that they are used in almost every electronic product in our life. Embedded systems are often
designed for mass production.
4. Computer printers
5. Disk drives
7. Handheld calculators
8. Household appliances
9. Medical equipment
The first recognizably modern embedded systems were the Apollo Guidance Computer,
developed by “Charles Stark Draper” at the MIT Instrumentation Laboratory. At the project
inception, the Apollo guidance computer was considered the riskiest item in the Apollo project
as it employed the then newly developed monolithic integrated circuits to reduce the size and
weight. An early mass-produced embedded system was the Autonoetic D-17 guidance computer
for the Minuteman missile, released in 1961.It was built from transistor logic and had a hard disk
for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced
with a new computer that was the first high volume use of integrated circuits. This program alone
reduced prices on quad and gate ICs from $1000/ each to $3/ each permitting their use in
commercial products.
Since these early applications in the 1960s, embedded systems have come down in price and
there has been a dramatic rise in processing power and functionality. The first microprocessor
for example, the Intel 4004, was designed for calculators and other small systems but still
required many external memory and support chips. In 1978 National Engineering Manufactures
Association released a “standard” for programmable microcontrollers, including almost any
computer-based controllers, such as single board computers, numerical and event-based
controllers. Embedded Systems are designed to some specific task rather than be a general-
purpose computer for multitasks. Some also have real-time performances constraints that must
be met, for reasons such as safety and usability; others may have low or no performance
requirement, allowing the system hardware to be simplified to reduce cost.
3.5 Features of An Embedded System:
The versatility of the embedded computer system lends itself to utility in all kinds of enterprises,
from the simplification of deliverable products to a reduction in costs in their development and
manufacture. Complex systems with rich functionality employ special Operating systems that
consider major characteristics of embedded systems. Embedded operating systems have
Dept. of. E.C.E. SREC. Page 8
IoT BASED WIRELESS SENSOR NETWORK FOR AIR POLLUTION MONITORING
Now, let us see the details of the various building blocks of the hardware of an
embedded system. As shown in Fig. the building blocks are;
• Input Devices
• Output devices
• Communication interface
• Application-specific circuitry
components required will be very less. On the other hand, microprocessors are more powerful,
but you need to use many external components with them. D5P is used mainly for applications
in which signal processing is involved such as audio and video processing.
Memory:
The memory is categorized as Random Access 11emory (RAM) and Read Only Memory
(ROM). The contents of the RAM will be erased if power is switched off to the chip, whereas
ROM retains the contents even if the power is switched off. So, the firmware is stored in the
ROM. When power is switched on, the processor reads the ROM; the program is program is
executed.
Input devices:
Unlike the desktops, the input devices to an embedded system have very limited
capability. There will be no keyboard or a mouse, and hence interacting with the embedded
system is no easy task. Many embedded systems will have a small keypad-you press one key
to give a specific command. A keypad may be used to input only the digits. Many embedded
systems used in process control do not have any input device for user interaction; they take
inputs from sensors or transducers 1’fnd produce electrical signals that are in turn fed to other
systems.
Output devices:
The output devices of the embedded systems also have very limited capability. Some
embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the health status
of the system modules, or for visual indication of alarms. A small Liquid Crystal Display
(LCD) may also be used to display some important parameters.
Communication interfaces:
The embedded systems may need to, interact with other embedded systems at they may
have to transmit data to a desktop. To facilitate this, the embedded systems are provided with
one or a few communication interfaces such as RS232, RS422, RS485, Universal Serial Bus
(USB), IEEE 1394, Ethernet etc.
Application-specific circuitry:
Sensors, transducers, special processing and control circuitry may be required fat an
embedded system, depending on its application. This circuitry interacts with the processor to
carry out the necessary work. The entire hardware has to be given power supply either through
the 230 volts main supply or through a battery. The hardware has to design in such a way that
the power consumption is minimized.
3.8 Debugging of An Embedded Systems:
Embedded debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate, they can be roughly grouped into the following
areas:
• Interactive resident debugging using the simple shell provided by the embedded
operating system (e.g., Forth and Basic)
• External debugging using logging or serial port output to trace operating using
either a monitor in flash or using a debug server like the Remedy Debugger which
even works for heterogeneous multi core systems.
• An in-circuit debugger (ICD), a hardware device that connects to the
microprocessor via a JTAG or NEXUS interface. This allows the operation of the
microprocessor to be controlled externally, but is typically restricted to specific
debugging capabilities in the processor.
CHAPTER-4
HARDWARE CONSTRAINTS
The Internet of Things (IoT) has been a trending field in the world of technology. It has
changed the way we work. Physical objects and the digital world are connected now more than
ever. Keeping this in mind, Expressive (A Shanghai-based Semiconductor Company) has released
an adorable, bite-sized Wi-Fi enabled microcontroller – ESP8266, at an unbelievable price! For
less than $3, it can monitor and control things from anywhere in the world – perfect for just about
any IoT project.
The development board equips the ESP-12E module containing ESP8266 chip having Ten
silica xtensa® 32-bit LX106 RISC microprocessor which operates at 80 to 160 MHz adjustable
clock frequency and supports RTOS.
ESP-12E Chip
There’s also 128 KB RAM and 4MB of Flash memory (for program and data storage) just
enough to cope with the large strings that make up web pages, JSON/XML data, and everything
we throw at IoT devices nowadays.
The ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi transceiver, so it can not only connect to a
Wi-Fi network and interact with the Internet, but it can also set up a network of its own, allowing
other devices to connect directly to it. This makes the ESP8266 Node MCU even more versatile.
• Power Requirement
As the operating voltage range of ESP8266 is 3V to 3.6V, the board comes with a LDO voltage
regulator to keep the voltage steady at 3.3V. It can reliably supply up to 600mA, which should be
more than enough when ESP8266 pulls as much as 80mA during RF transmissions. The output
of the regulator is also broken out to one of the sides of the board and labeled as 3V3. This pin can
be used to supply power to external components.
Power Requirement
Power to the ESP8266 Node MCU is supplied via the on-board MicroB USB connector.
Alternatively, if you have a regulated 5V voltage source, the VIN pin can be used to directly
supply the ESP8266 and its peripherals.
Warning:
The ESP8266 requires a 3.3V power supply and 3.3V logic levels for communication. The
GPIO pins are not 5V-tolerant! If you want to interface the board with 5V (or higher) components,
you’ll need to do some level shifting.
The ESP8266 Node MCU has total 17 GPIO pins broken out to the pin headers on both sides of
the development board. These pins can be assigned to all sorts of peripheral duties, including:
• SPI, I2C & I2S interface – SPI and I2C interface to hook up all sorts of sensors and peripherals.
• I2S interface – I2S interface if you want to add sound to your project.
Multiplexed I/Os
• 1 ADC channels
• 2 UART interfaces
• 4 PWM outputs
• SPI, I2C & I2S interface
Thanks to the ESP8266’s pin multiplexing feature (Multiple peripherals multiplexed on a single
GPIO pin). Meaning a single GPIO pin can act as PWM/UART/SPI.
The ESP8266 Node MCU features two buttons. One marked as RST located on the
top left corner is the Reset button, used of course to reset the ESP8266 chip. The
other FLASH button on the bottom left corner is the download button used while
upgrading firmware.
The board also has a LED indicator which is user programmable and is connected to the D0 pin
of the board.
• Serial Communication
The board includes CP2102 USB-to-UART Bridge Controller from Silicon Labs, which
converts USB signal to serial and allows your computer to program and communicate with the
ESP8266 chip.
Serial Communication
The ESP8266 Node MCU has total 30 pins that interface it to the outside world. The
connections are as follows:
Power Pins There are four power pins viz. one VIN pin & three 3.3V pins. The VIN pin can be
used to directly supply the ESP8266 and its peripherals, if you have a regulated 5V voltage source.
The 3.3V pins are the output of an on-board voltage regulator. These pins can be used to supply
power to external components.
I2C Pins are used to hook up all sorts of I2C sensors and peripherals in your project. Both I2C
Master and I2C Slave are supported. I2C interface functionality can be realized programmatically,
and the clock frequency is 100 kHz at a maximum. It should be noted that I2C clock frequency
should be higher than the slowest clock frequency of the slave device.
GPIO Pins ESP8266 Node MCU has 17 GPIO pins which can be assigned to various functions
such as I2C, I2S, UART, PWM, IR Remote Control, LED Light and Button programmatically.
Each digital enabled GPIO can be configured to internal pull-up or pull-down, or set to high
impedance. When configured as an input, it can also be set to edge-trigger or level-trigger to
generate CPU interrupts.
ADC Channel the Node MCU is embedded with a 10-bit precision SAR ADC. The two
functions can be implemented using ADC viz. Testing power supply voltage of VDD3P3 pin and
testing input voltage of TOUT pin. However, they cannot be implemented at the same time.
UART Pins ESP8266 Node MCU has 2 UART interfaces, i.e., UART0 and UART1, which
provide asynchronous communication (RS232 and RS485), and can communicate at up to 4.5
Mbps. UART0 (TXD0, RXD0, RST0 & CTS0 pins) can be used for communication. It supports
fluid control. However, UART1 (TXD1 pin) features only data transmit signal so, it is usually used
for printing log.
SPI Pins ESP8266 features two SPIs (SPI and HSPI) in slave and master modes. These SPIs also
support the following general-purpose SPI features:
• Up to 64-Byte FIFO
SDIO Pins ESP8266 features Secure Digital Input/Output Interface (SDIO) which is used to
directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO v2.0 are supported.
PWM Pins The board has 4 channels of Pulse Width Modulation (PWM). The PWM output can
be implemented programmatically and used for driving digital motors and LEDs. PWM frequency
range is adjustable from 1000 μs to 10000 μs, i.e., between 100 Hz and 1 kHz.
Control Pins are used to control ESP8266. These pins include Chip Enable pin (EN), Reset pin (RST) and
WAKE pin.
• EN pin – The ESP8266 chip is enabled when EN pin is pulled HIGH. When pulled LOW the chip
works at minimum power.
• WAKE pin – Wake pin is used to wake the chip from deep-sleep.
There are a variety of development platforms that can be equipped to program the ESP8266. You
can go with Esperion – JavaScript SDK and firmware closely emulating Node.js, or use Mongoose
OS – An operating system for IoT devices (recommended platform by Expressive Systems and
Google Cloud IoT) or use a software development kit (SDK) provided by Expressive or one of the
platforms listed on wikipedia.
Fortunately, the amazing ESP8266 community took the IDE selection a step further by creating
an Arduino add-on. If you’re just getting started programming the ESP8266, this is the
environment we recommend beginning with, and the one we’ll document in this tutorial.
This ESP8266 add-on for Arduino is based on the amazing work by Ivan Grok hotkey and the
rest of the ESP8266 community. Check out the ESP8266 Arduino GitHub repository for more
information.
The first thing is having latest Arduino IDE (Arduino 1.6.4 or higher) installed on your PC. If
don’t have it, we recommend upgrading now.
To begin, we’ll need to update the board manager with a custom URL. Open up Arduino IDE
and go to File > Preferences. Then, copy below URL into the Additional Board Manager
URLs text box situated on the bottom of the window:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Hit OK. Then navigate to the Board Manager by going to Tools > Boards > Boards Manager.
There should be a couple new entries in addition to the standard Arduino boards. Filter your search
by typing esp8266. Click on that entry and select Install.
The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other
reasonably large, compiled binaries, so it may take a few minutes to download and install (the
archived file is ~110MB). Once the installation has completed, a small INSTALLED text will
appear next to the entry. You can now close the Board Manager.
To make sure ESP8266 Arduino core and the Node MCU are properly set up, we’ll upload the
simplest sketch of all – The Blink!
We will use the on-board LED for this test. As mentioned earlier in this tutorial, D0 pin of the
board is connected to on-board Blue LED & is user programmable.
Before we get to uploading sketch & playing with LED, we need to make sure that the board is
selected properly in Arduino IDE. Open Arduino IDE and select Node MCU 0.9 (ESP-12
Module) option under your Arduino IDE > Tools > Board menu.
Now, plug your ESP8266 Node MCU into your computer via micro-B USB cable. Once the
board is plugged in, it should be assigned a unique COM port. On Windows machines, this will be
something like COM#, and on Mac/Linux computers it will come in the form of /dev/ tty ,usb
serial-XXXXXX. Select this serial port under the Arduino IDE > Tools > Port menu. Also select
the Upload Speed: 115200
Warning:
More attention needs to be given to selecting board, choosing COM port and selecting Upload
speed. You may get espcomm_upload_mem error while uploading new sketches, if failed to do
so.
void setup ()
{
pinMode(D0, OUTPUT);
}
void loop ()
{
digitalWrite(D0, HIGH);
delay (500);
digital Write (D0, LOW);
delay (500);
}
Once the code is uploaded, LED will start blinking. You may need to tap the RST button to get
your ESP8266 to begin running the sketch.
current (DC) or voltage to make the output constant regardless of the fluctuations in input, is
done by a regulated power supply circuit.
4.3 Transformer:
A transformer can be defined as a static device which helps in the transformation of electric
power in one circuit to electric power of the same frequency in another circuit. The voltage can be
raised or lowered in a circuit, but with a proportional increase or decrease in the current ratings.
Transformer Working Principle:
The main principle of operation of a transformer is mutual inductance between two circuits
which is linked by a common magnetic flux. A basic transformer consists of two coils that are
electrically separate and inductive, but are magnetically linked through a path of reluctance. The
working principle of the transformer can be understood from the figure below.
As shown below the electrical transformer has primary and secondary windings. The core
laminations are joined in the form of strips in between the strips you can see that there are some
narrow gaps right through the cross-section of the core. These staggered joints are said to be
‘imbricated’. Both the coils have high mutual inductance.A mutual electro-motive force is induced
in the transformer from the alternating flux that is set up in the laminated core, due to the coil that
is connected to a source of alternating voltage.
Most of the alternating flux developed by this coil is linked with the other coil
and thus produces the mutual induced electro-motive force. The so produced electro-
motive force can be explained with the help of Faraday’s laws of Electromagnetic
Induction as
e=M*dI/
If the second coil circuit is closed, a current flows in it and thus electrical energy is transferred
magnetically from the first to the second coil.The alternating current supply is given to the first
coil and hence it can be called as the primary winding. The energy is drawn out from the second
coil and thus can be called as the secondary winding.
• Step-Up Transformer
• Step-Down Transformer
Step-Down Transformer
Step down transformers convert electrical voltage from one level or phase configuration
usually down to a lower level. They can include features for electrical isolation, power
distribution, and control and instrumentation applications. Step down transformers typically
rely on the principle of magnetic induction between coils to convert voltage and/or current
levels. An example of this would be: 100 turns on the primary and 50 turns on the secondary,
a ratio of 2 to 1. Step down transformers can be considered nothing more than a voltage ratio
Step-Up Transformer:
A step up transformer has more turns of wire on the secondary coil, which makes a larger
induced voltage in the secondary coil. It is called a step up transformer because the voltage output
is larger than the voltage input. Step-up transformer 110v 220v design is one whose secondary
voltage is greater than its primary voltage. This kind of transformer "steps up" the voltage applied
to it. For instance, a step up transformer is needed to use a 220v product in a country with a 110v
supply. A step up transformer 110v 220v converts alternating current (AC) from one voltage to
another voltage. It has no moving parts and works on a magnetic induction principle; it can be
designed to "step- up" or "step-down" voltage. So a step up transformer increases the voltage and
a step down transformer decreases the voltage.
• The transformer used for step down high voltage for safety.
This property of the diode is very useful in creating simple rectifiers which are used to
convert AC to DC. If you look at the Half Wave Rectifier diagram, we are giving an
alternating current as input
During first half cycle of the AC input, the upper portion of the transformer secondary winding
is positive with respect to the lower portion. Thus during the first half cycle diodes D1 and D4 are
forward biased. Current flows through path 1-2, enter the load RL. It returns flowing through path
4-3. During this half input cycle, the diodes D2 and D3 are reverse biased. Hence there is no current
flow through the path 2-3 and 1-4.
steps down the input voltage to the desired level and keeps that in that same level during the
supply. This makes sure that even when a load is applied the voltage doesn’t drop.
CHAPTER -5
SOFTWARE CONSTRAINTS
5.1 Introduction to Arduino IDE:
Arduino is a prototype platform (open-source) based on an easy-to-use hardware and
software. It consists of a circuit board, which can be programmed (referred to as a
microcontroller) and a ready-made software called Arduino IDE (Integrated Development
Environment), which is used to write and upload the computer code to the physical board.
5.2 Key Features of Arduino IDE:
Arduino boards able to read analog or digital input signals from different sensors and
turn it into an output such as activating a motor, turning LED on/off, connect to the cloud and
many other actions.
You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software). Unlike
most previous programmable circuit boards, Arduino does not need an extra piece of
hardware (called a programmer) in order to load a new code onto the board. You can simply
use a USB cable. Additionally, the Arduino IDE uses a simplified version of C++, making it
easier to learn to program.
Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package. After learning about the main parts of the Arduino
UNO board, we are ready to learn how to set up the Arduino IDE. Once we learn this, we
will be ready to upload our program on the Arduino board.
Data types in C refers to an extensive system used for declaring variables or functions of
different types. The type of a variable determines how much space it occupies in the storage
and how the bit pattern stored is interpreted.
The following table provides all the data types that you will use During Arduino
programming.
Void:
The void keyword is used only in function declarations. It indicates that the function is
However, characters are stored as numbers. You can see the specific encoding in the
ASCII chart. This means that it is possible to do arithmetic operations on characters, in which
the ASCII value of the character is used. For example, 'A' + 1 has the value 66, since the
ASCII value of the capital letter A is 65.
Unsigned char:
Unsigned char is an unsigned data type that occupies one byte of memory. The
unsigned char data type encodes numbers from 0 to 255.
Byte
A byte stores an 8-bit unsigned number, from 0 to 255.
Example:
byte m = 25 ;//declaration of variable with type byte and initialize it with 25
int:
Integers are the primary data-type for number storage. int stores a 16-bit (2-byte) value.
This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of
(2^15) - 1).The int size varies from board to board. On the Arduino Due, for example, an int
stores a 32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647
(minimum value of -2^31 and a maximum value of (2^31) - 1).
Unsigned int:
Unsigned int’s (unsigned integers) are the same as int in the way that they store a 2 byte
value. Instead of storing negative numbers, however, they only store positive values, yielding
a useful range of 0 to 65,535 (2^16) - 1). The Due stores a 4 byte (32-bit) value, ranging from
0 to 4,294,967,295 (2^32 - 1).
Word:
On the Uno and other ATMEGA based boards, a word stores a 16-bit unsigned number.
On the Due and Zero, it stores a 32-bit unsigned number.
Unsigned long:
Unsigned long variables are extended size variables for number storage and store 32 bits
(4 bytes). Unlike standard longs, unsigned longs will not store negative numbers, making
their range from 0 to 4,294,967,295 (2^32 - 1).
Short:
A short is a 16-bit data-type. On all Arduinos (AT Mega and ARM based), a short stores
a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15
and a maximum value of (2^15) - 1).
Float:
Data type for floating-point number is a number that has a decimal point. Floating-point
numbers are often used to approximate the analog and continuous values because they have
greater resolution than integers.
Floating-point numbers can be as large as 3.4028235E+38 and as low as
3.4028235E+38. They are stored as 32 bits (4 bytes) of information.
Double:
On the Uno and other ATMEGA based boards, Double precision floating-point number
occupies four bytes. That is, the double implementation is exactly the same as the float, with
no gain in precision. On the Arduino Due, doubles have 8-byte (64 bit) precision.
5.4 Steps to Upload the Program in Arduino Board:
In this section, we will learn in easy steps, how to set up the Arduino IDE on our computer and
prepare the board to receive the program via USB cable.
Step 1: First you must have your Arduino board (you can choose your favorite board) and
a USB cable. In case you use Arduino UNO, Arduino Demilune, Nano, Arduino Mega2560,
or Decimal, you will need a standard USB cable (A plug to B plug), the kind you would
connect to a USB printer as shown in the following image.
The Arduino Uno, Mega, Demilune and Arduino Nano automatically draw power from
either, the USB connection to the computer or an external power supply. If you are using an
Arduino Decimal, you have to make sure that the board is configured to draw power from the
USB connection. The power source is selected with a jumper, a small piece of plastic that fits
onto two of the three pins between the USB and power jacks. Check that it is on the two pins
closest to the USB port. Connect the Arduino board to your computer using the USB cable. The
green power LED (labeled PWR) should glow.
After your Arduino IDE software is downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). DoubleClick the
icon to start the IDE.
• To open an existing project example, select File -> Example -> Basics -> Blink.
Here, we are selecting just one of the examples with the name Blink. It turns the LED on and
off with some time delay. You can select any other example from the list.
Step 6: Select your Arduino board.
To avoid any error while uploading your program to the board, you must select the correct
Arduino board name, which matches with the board connected to your computer.
Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using
Select the serial device of the Arduino board. Go to Tools ->Serial Port menu. This is likely
to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports). To find
out, you can disconnect your Arduino board and re-open the menu, the entry that disappears should
be of the Arduino board. Reconnect the board and select that serial port.
Before explaining how we can upload our program to the board, we must demonstrate
the function of each symbol appearing in the Arduino IDE toolbar.
for
Void setup ()
}
the Java environment is released under the GPL and the C/C++ microcontroller libraries are
under the LGPL.
Sketch: The first new terminology is the Arduino program called “sketch”. Structure
Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software program,
Dept. of. E.C.E. SREC. Page 46
IoT BASED WIRELESS SENSOR NETWORK FOR AIR POLLUTION MONITORING
step by step, and how we can write the program without any syntax or compilation error. Let
us start with the Structure. Software structure consist of two main functions: Setup()function.
PURPOSE:
The setup() function is called when a sketch starts. Use it to initialize the variables, pin
modes, start using libraries, etc. The setup function will only run once, after each power up
or reset of the Arduino board.
INPUT
OUTP
UT
RETU
RN
Void Loop ()
}
PURPOSE:
After creating a setup() function, which initializes and sets the initial values, the loop()
function does precisely what its name suggests, and loops seductively, allowing your program
to change and respond. Use it to actively control the Arduino board.
INPUT
OUTPUT
RETURN
CHAPTER-6
RESULT AND ANALYSIS
After all the connections we could dump the code in to Arduino board. When we will give the
power supply to the kit through the USB cable, it can easily detect the temperature, humidity, air
pressure, air levels, it is an IoT related project.
So initially we have connected the project to the internet after connecting to internet it sends
to IoT with the value temperature, humidity, air pressure, air levels and also it will display the
connection of our Wi-Fi with a blinking light. And the results also we can observe in the LCD
which connect to the kit.
CONCLUSION
The level of pollution is increasing rapidly due to factors like industries, urbanization,
increasing in population, vehicle use which can affect human health. IOT Based Air Pollution
Monitoring System is used to monitor the Air Quality over a web server using Internet. It will
trigger an alarm when the air quality goes down beyond a certain level, means when there are
sufficient number of harmful gases present in the air like CO2, smoke, alcohol, benzene, NH3 and
NOx. It will show the air quality in PPM on the LCD and as well as on webpage so that air pollution
can be monitored very easily.
The system uses MQ135 and MQ6 sensor for monitoring Air Quality as it detects most
harmful gases and can measure their amount accurately.
REFERENCES
1. Mahalingam, A.; Naayagi, R.T.; Mastorakis, N.E. Design and implementation of an economic
gas leakage detector. In Proceedings of 6th International Conference on Circuits, Systems and
Signals, Athens, Greece, 7–9 March 2012; pp. 20–24.
2. Attia, H.A.; Halah, Y.A. Electronic Design of Liquefied Petroleum Gas Leakage Monitoring,
Alarm, and Protection System Based on Discrete Components. Int. J. Appl. Eng. Res. 2016, 11,
9721–9726.
3. Apeh, S.T.; Erameh, K.B.; Iruansi, U. Design and Development of Kitchen Gas Leakage
Detection and Automatic Gas Shut off System. J. Emerg. Trends Eng. Appl. Sci. 2014, 5, 222–
228. Eng. Proc. 2020, 2, 28 6 of 6
4. Soundarya, T.; Anchitaalagammai, J.V.; Priya, G.D.; Karthickkumar, S.S. C-Leakage: Cylinder
LPG Gas Leakage Detection for Home Safety. IOSR J. Electron. Commun. Eng. 2014, 9, 53–58.
5. Shrivastava, A.; Prabhaker, R.; Kumar, R.; Verma, R. GSM based gas leakage detection system.
Int. J. Emerg. Trends Electr. Electron. 2013, 3, 42–45.
6. Anurupa, A.; Gunasegaram, M.; Amsaveni, M. Efficient Gas Leakage Detection and Control
System using GSM Module. Int. J. Eng. Res. Technol.2015,3, 1–4.
7. Meenakshi, A.A.; Meghana, R.B.N.; Krishna, P.R. LPG Gas Leakage Detection and Prevention
System. Int. J. Future Revolut. Comput. Sci. Commun. Eng. 2017, 3, 1–4. 8. All Answers Ltd.
GSM Based LPG Detection [Internet]. November 2018. Available online:
https://ukdiss.com/examples/gsm-based-lpg-detection.php?vref=1 (accessed on 15 October 2020).
This certificate is awarded to Lokesh Kumar, and certifies the acceptance for
publication of research paper entitled “IoT Based Wireless Sensor Network
for Air Pollution Monitoring” in “International Journal of Research
Publication and Reviews”, Volume 4, Issue 4, 2023 .
Certrificate Participation.
SIGIMA-2KK23
of
This is to certify that M/Ms. Cvenkata Subbaiah
Regd. No. L9x5LB0yo9 studying -£CE branch of _ix year, I_ sem in
-Sanhiam brginengcallkgardyat has participated in
-Paijeckbpe event in the 12th National Level Technical Symposium
(SIGMA-2 K23) during 3rd &4th of March, 2023, held at Santhiram Engineering
College, Nandyal.
M
coORDINATOR HOD RRINCIPAL