Research Paper 12

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

2019 IEEE Region 10 Humanitarian Technology Conference

Depok, Indonesia | November 12-14, 2019

IoT Monitoring Setup for Waste Water Treatment

Ravi Kishore Kodali, Sasweth C.Rajanarayanan and Sindhuja Yadavilli


Department of Electronics and Communication Engineering
National Institute of Technology, Warangal
WARANGAL, 506004 India
E-mail: ravikkodali@gmail.com

Abstract—Water scarcity in today’s world proves to be a treatment is a complex phenomenon and it depends on various
serious threat that needs to be given much attention. Hence, factors under which waste water treatment is carried out. Treat-
there is a need to treat waste water and utilize it effectively ment procedure depends on various factors like temperature
in order to meet the growing demand of water with increase of wastewater, velocity of water through various channels and
in population. It is also necessary to make the waste water its flow rate and pH of water. These parameters need to be
treatment procedure efficient and economical. This paper
proposes a system which can monitor important parameters of a
keenly monitored for effective treatment of water and if these
waste water treatment plant at regular intervals and notify the parameters could be maintained in required limits, efficiency
plant operator, in case of emergency. It also depicts a control of the treatment plant increases. IOT in waste water treatment.
system that shuts down the plant, in case a damage is detected. IOT is a network through which all the devices embedded
The system once developed does not need Internet connection to
with electronic systems can be connected. Through IOT elec-
receive alerts. It uses ESP8266 NodeMCU as the microcontroller
and temperature, level and flow sensors that are compatible tronic devices can communicate with each other and transfer
with waste water. The model employs Mongoose operating the information. Various physical parameters in waste water
system which is very reliable to run in production environment treatment like temperature, flow velocity and level of water
and it has many eminent features compared to other operating in various tanks can be monitored and can be communicated
systems. The total cost of the system is low as we have used low to connected devices like mobile phones, laptops through
cost microcontroller and low cost and reliable sensors. various platforms by utilizing sensors in waste water treatment
plant. Once the sensors detect the deviations in the physical
KeyWords- Mongoose OS, WiFi Micro-controller, Waste parameters beyond permissible level, we can send an alert to
Water Treatment the plant operator through a message or email as well as take
control action.
I. I NTRODUCTION
Water is one of the precious natural resource on earth. II. L ITERATURE S URVEY
Water is very essential for the existence of life on earth. Water quality testing is one of the crucial issues of today.
It is also required for the economic growth of the country We are in need of less complex solutions which require
and poverty alleviation. Today around one-fifth of world’s minimal time and with considerable reliability. Automation of
population [1] is facing scarcity of water. Water scarcity the current monitoring systems is proved to be essential. This
is expected as one of the major problem to be faced by paper [3] proposes a remote, portable, automatic and real time
many countries in 21st century. Global increase in population, system for monitoring water. Though the purpose of this paper
increase in living standards of people, increase in industrial- is different, the flow it has followed is very much closer to our
ization all of these factors are resulting in scarcity of water. requirement.
One of the potential solutions to solve the water scarcity
issues is water recycling and reuse. As water is a renewable There are different methods to treat waste water out of
resource, [2] waste water can be treated and can be used for which one classification is popular, centralized and decentral-
various purposes. Water when used for domestic or commercial ized system of waste water treatment. Few parameters are to be
purpose, it will be mixed with several contaminants and thus monitored uninterrupted to ensure the safe and efficient func-
becomes unfit for further use. Our nature has a capacity to tioning of the plant. This paper [4] compares the advantages
treat the effluents through different processes like settling, and disadvantages of centralized and decentralized methods,
evaporation etc. Nature can cope up with small amount of describing vividly the process of treatment and explaining the
effluents but if waste water is released into atmosphere in different control mechanisms employed. It also portrays the
large volumes can create an environmental impact. Waste water importance of various sensors to be employed at different
that is produced through different domestic and commercial stages.
activities need to be treated to a permissible contaminant level
The internal functioning of a waste water treatment plant
to minimize environmental impact. Waste water treated can
has a greater impact on the overall efficiency of the plant. The
either be released into atmosphere back into hydrological cycle
success of individual stages gives an efficient system. This
or can be used for other purposes based on level of treatment
paper [5] deals with problems associated with waste water
and purpose for which the water is meant to be used.
treatment procedure that might disturb the technology. Low
Waste water treatment process involves separation of sus- flow rate of water may lead to sedimentation of particulates
pended solids, removal of dissolved effluents and to treat between screening and grit removal stages. It mainly discusses
the organic matter present in the wastewater. Waste water on the structure of the flow of water to be employed to

978-1-7281-0834-6/19/$31.00 ©2019 IEEE 169

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.
eliminate the sedimentation. It uses CFD tool technology. It
is validates with numerical results as well.
Operating system is the heart of any embedded system.
Mongoose OS [6] is a safe and secure operating system
for connected products. It supports stable functioning of
commercially connected products and it is highly reliable
in real time applications. It has secure communication
and remote management of device facilities. It is
used across many verticals to build smart systems.

III. DESIGN AND IMPLEMENTATION


The architecture of the system is depicted in Fig 1 .
Automation of Waste water treatment can be made smart
using Internet of Things. The different stages of treatment
plant can be configured and monitored using various sensors
to avoid damage to the plant as well as to ensure safe and
efficient functioning of the system. In this prototype, we are
monitoring three parameters that are crucial in the process of
waste water treatment namely, fluid temperature, level of water
in the sedimentation tank and the flow rate in multiple stages.
We employ DS18B20 digital Water-proof temperature sensor
to measure the temperature of water, HC-SR04 to measure the Fig. 1: Block Diagram
level of wastewater, YF-S201 Hall-Effect Water flow sensor
to measure the rate of flow. The relevant data is collected and
communicated through IoT gateway. This gateway uploads the
sensor data to the cloud wherefrom the data can be accessed
and visualized.
In the system discussed, ESP8266 NodeMCU acts as a
client, thus collecting data from the sensors and calibrating
the required sensor outputs. The sensors are activated by
providing appropriate voltage to their power pins. The values
are published onto the chosen cloud platform (Losant) using
the MQTT protocol by configuring ESP8266 as a Wi-Fi
access point. Here we have a message broker which acts
as a bridge between the client and the cloud. We publish
the data onto specific topics on the message broker defined Fig. 2: ESP8266 NODEMCU
as Losant/Device ID/state as defined in the MQTT protocol.
Here, the Device ID is the credential of the device we are
connecting on the cloud platform. A json based payload format are connected through digital pins, hence ESP8266 serves to
is to be followed to publish topics onto Losant platform and be sufficient. If we want multiple analog pins, it is suggested
in order to understand them. If a successful connection is to use ESP-32. ESP8266 NODEMCU is inexpensive, can be
established with the cloud platform, the data will be published used along with a breadboard. It is used mainly for low power
and stored and appears in the visualization tool of Losant applications.
platform. To subscribe the stored data from the MQTT message
broker, the client should subscribe to the commands onto the B. DS18B20 Temperature Sensor
topic Losant/Device ID/commands.
Regular temperature sensors cannot be used to measure
A. ESP8266 NODEMCU the temperature of water. DS18B20 digital Water-proof tem-
perature sensor is used to measure the temperature in wet
ESP8266 has several modules and NODEMCU is one conditions, and thus can be used to measure the temperature
of the most extensively used open source IoT platform. of wastewater. We have used a pre-wired and water-proof
NODEMCU’s firmware runs on Espressif System ESP8266 DS18B20 sensor. The eminent feature of this sensor is we do
Wi-Fi SoC and its hardware is based on ESP-12 module. It not get signal degradation when measured over long distances
utilizes the Lua scripting language. It is integrated with a as it is a digital sensor. The usable temperature range is -
Tensilca Xtensa LX106 core which is widely used for IoT 55o C-125o C [7]. The maximum temperature the sensor can
applications. NodeMCU supports the MQTT IoT protocol resist is 125o C, but as the sensor is enveloped in a PVC cable,
which is utilized in this project. It has 128kBytes of memory it is advised to use it below 100o C. It has a great precision
with 4Mbytes of storage and 13Gener al Purpose Input Output of + or -0.5o C and provides 12 bits of precision from the
( GPIO) pins with 1 analog pin. In this project, all the sensors on-board digital-to-analog converter. This sensor can be used

170

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.
material gets reflected back towards the sensor and is observed
by the ultrasonic receiver module. Now, as ultrasonic wave
travels with speed of 330m/s and time is calculated by the
module, thus distance can be calculated. Thus, we can alert
the overflow of water in the sedimentation tanks.

Fig. 3: DS18B20 Temperature Sensor

with 3V-5V systems. They utilize a single digital pin of any


microcontroller. It communicates over a 1-Wire bus requiring
only one data line for communication with a microcontroller. Fig. 5: Flow Sensor
The sensor uses the Dallas 1-Wire protocol. It has a unique
64 bit serial code allowing multiple DS18B20’s to operate on
the same 1-Wire bus. The processing power of the sensor is
high i.e., the query time is less than 750ms. Because of all
the above features, it is appropriate to be used in waste water D. Flow Sensor
treatment plant.
YF-S201 Hall effect sensor is used to measure the rate
of flow of water in the waste water treatment process. This
sensor can be attached to the water line and it contains a
pinwheel sensor to measure the amount of liquid flowing
through it [8]. An integrated magnetic hall effect sensor is
inbuilt to output an electrical pulse with every revolution.
To ensure the safety and dryness, the sensor is sealed from
the water pipe. The sensor has three wires red, black and
yellow. Red is connected to power supply, black to ground
and yellow is the Hall effect pulse output which is connected
to one of the data pins. The rate of water flow is calculated
by counting the pulses from the output of the sensor. Each
pulse is equivalent to 2.25 milliliters. The pulse signal
is a simple square wave so it is easy to calibrate it.
Pulse Frequency (Hz) /7.5=flow rate in L/min.
Fig. 4: Level Sensor It works in a temperature range of -25 to 80o C with an
accuracy of 10% and operates in a range of 5 to 18V DC.

C. Level Sensor
HC-SR04 level sensor is used to measure the level of
water in sedimentation tank. It is a 4-pin module with pins
as Vcc, Trigger, Echo and Ground. The Vcc pin requires 5V
power supply. Trigger is an input pin. This pin is kept high
by sending ultrasonic wave for 10 microseconds to initiate
the measurement process. Echo is an output pin. This pin is
kept high for a period of time equal to the time taken for the
ultrasonic wave to reach back the sensor. The ground pin of the
sensor is connected to equivalent ground of the system. The
sensor operates around 5V. It can measure distance around 2cm
to 450cm with an accuracy around 3mm. Its operating range
of current is 15mA and frequency of 40Hz. The sensor has an
ultrasonic transmitter and receiver. It works with the formula
Fig. 6: Relay
that Distance= Speed x Time. The transmitter transmits an
ultrasonic wave which travels in air and when objected by any

171

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.
E. Relay on the platform, then the app firmware is built, code is flashed
onto the device and we could see a connection established
A relay acts as an electrical switch. It uses an electro-
with Losant. MQTT connection is setup by providing the
magnet to operate the switch mechanically providing electri-
required credentials in the device configuration window. The
cal isolation between circuits. It can interfaced with several
credentials are Losant broker name, device-id, access key,
microcontrollers[9]. Relay has two terminals namely Normally
access secret and Wi-Fi credentials. We can as well import
Open(NO) and Normally Closed(NC). VCC and GND pins of
some applications and libraries in the Mongoose app manager.
relay are connected to 3V3 pin and GND pin of ESP8266
In this project, we imported the libraries pertaining to all
NodeMCU respectively. The data pin is connected to pin D4
the three sensors and MQTT connections. The values from
of microcontroller. When power is applied through VCC pin
three sensors are read, JSON message along with its state are
to the relay, the red LED turns on.When channle pins are
published to Losant. These values are viewed on the device
inputted with power, the green LED turns on and the relay
log of Losant.
will switch from Normally Closed state to Normally Open
state which means the circuit undergoes a breakdown. The Losant is an easy-to-use and powerful IoT cloud enterprise
relay will switch back to Normally Closed state when power mainly used in building real time connected solutions. It has
is removed from one of the channel pins.When we apply power unique features of device modelling and built-in connectivity
to a channel of relay when relay is not connected to any of the [10]. MQTT and REST are the standard open communication
terminals, the onvboard LED illuminates. Thus, in this project, protocols used by Losant to connect billions of devices. In
Relay is used to shut down the system when the temperature this project we use MQTT communication protocol. It pro-
and level goes beyond a certain limit thus employing control vides robust collection of data, gathering and sorting of data,
system. visualization to continuously monitor the states of real time
devices and data from sensors. We can trigger few actions
and machine to machine communication as well as alerts and
TABLE I: Pin Definition of Data Pins
notifications by creating workflows using Losant drag and drop
SENSOR NODEMCU workflow editor.
Temperature D7
Level Trigger D5 Device is a thing which connects to Losant and reports its
Level Echo D3
Flow D2
state[11]. Devices may contain sensors or other peripherals.
Relay D4 We can configure the device and set device attributes and thus
manage the device from Losant. The two data communication
mechanisms of Losant are state and commands. Device state
IV. MONGOOSE OS AND LOSANT is used when we want to continuously monitor the state of
IoT is all about connecting physical things to the In- the device whereas device command is used when we want
ternet. We either need a computer for it or an inexpen- to initiate certain action based on the device state. One of
sive microcontroller can solve the purpose. For IoT appli- the eminent feature of Losant is Dashboards. They provide a
cations, we have a wide range of microcontrollers but we convenient and impressive way to display information of the
chose ESP8266 for its better compatibility with our re- connected devices. We can use single or multiple dashboards
quirements. Microcontrollers do not possess much memory to portray information from various applications and devices.
and processing power, that is why they are inexpensive [6]. Losant provide top level security for the data transmitted
ESP8266 has about 40K RAM available which means a onto the platform. It uses standard encryption mechanisms
software like Windows or Linux cannot be installed on them. to encrypt the data while at rest or during transmission.
There are some approaches to handle the MCU development The communication between Losant and devices is
like using an IDE (Integrated Development Environment) encrypted using TLS encryption protocol. This is the
like Arduino IDE or Mongoose OS or Micropython etc. transport layer security. JSON Web Tokens are used
In this project, we have chosen Mongoose OS since it makes to control the API access. MQTT communication uses
programming easier. The time taken to setup a programming application specific access and secret keys. These are
environment with Mongoose OS is less than a minute making required to authenticate the device. The MQTT message
working with Mongoose OS more comfortable. Mongoose OS broker acts as a central point to properly route the messages.
is an open source operating system extensively used for IoT
applications. It is used along with low power microcontrollers.
The time complexity of the system can be reduced by using
Mongoose OS. It has a web user interface that allows us to
build and flash firmware. It has an inbuilt environment for
prototyping and developing connected devices. In applications
where reliability of the systems is critical, Mongoose OS takes
a stand. One of the eminent feature of Mongoose is that it has
compatibility with Arduino libraries and hence we can employ
them. It has an interfacing facility with public or private cloud.
It also provides secure communication of the data by end-to-
end encryption.
The device set up feature allows us to select our device Fig. 7: Workflow
from a list of connected devices, connect to Wi-Fi and code

172

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.
VI. SOFTWARE REALIZATION
An environmental setup was done to work with Mongoose
OS. Initially the device is connected to Mongoose and the
firmware of the device is flashed onto ESP8266 NodeMCU and
Wi-Fi is configured using the Wi-Fi SSID and Password. Thus,
with the setup of these parameters, the device goes online.
Next, we write the code pertaining to read the sensor data and
publish onto cloud platform. We configure the device using
Losant credentials like Losant Client ID, Losant access key
and access secret. This ensures establishing a connection of
the device with cloud platform. An sms node has been defined
to notify the situation in case of emergency. Every 2 seconds
the state of the device is read and reported which can be used
for further analysis.

Fig. 8: Application log of Losant

Users can connect and work with Losant in few steps:

• An application has to be created in Losant account


with an application name which contains devices, its
attributes, workflows and dashboards.
• A device has to be created and its attributes has to be
specified by giving tags (if necessary). The device id
provided while creating a device is used to configure
device settings. Fig. 9: SMS node
• The JSON payloads are facilitated by the device
attributes. Here we mentioned one device i.e., our mi-
crocontroller with three attributes namely temperature,
level and flow rate.
• Workflows are created to facilitate interaction between
device and external parties.
• Dashboards are created to visualize and analyze the
data from the connected devices.

V. HARDWARE REALIZATION
The Wasterwater treatment plant monitoring system is
realized using ESP8266 NodeMCu and three sensors namely,
pre-wired digital temperature sensor, level and flow sensors
are used to monitor the state of the treatment plant. Relay is
used to control the system in case of any damage.The data
outputs of three sensors are routed to three digital pins of
NodeMCU microcontroller using male to male or female to
female connecting wires as needed. The temperature, level and
the flow rate are sensed every 2 seconds and reported to the Fig. 10: Circuit Connection
microcontroller. Once the code is dumped, we use a micro-
USB cable to power the board. Losant uses the Device ID
for the authentication of the device and Losant access keys
VII. TESTING AND RESULTS
and access secrets are used to provide access to devices and
thus connection is established. If the temperature or level or The complete hardware setup has been done to monitor
flow rate is observed to be beyond permissible limits, then the the important parameters of the plant during treatment process.
relay will automatically turn off the circuit to prevent further The results can be viwed in the Mongoose console as in Fig
damage. 13 as well as on the application log of Losant platform as in

173

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.
Fig 8 where the device state is shown by variables namely R EFERENCES
temperature, level and flow rate. An sms node is shown in [1] R. A. Fathy, “Smart water management-regional challenges and future
Fig 10 where the mobile number along with a message has to prospects.”
be given. Time series graphs for temperature sensor and level [2] [Online]. Available: http://www.un.org/waterforlifedecade/scarcity.shtml
sensor are created which shows how the values vary over time [3] M. R. Ranjbar and A. H. Abdalla, “Low-cost, real-time, autonomous
water quality testing and notification system,” in IJCSNS International
as shown in Fig 11 and Fig 12.
Journal of Computer Science and Network Security, VOL.17 No.5, May
2017, 2017.
[4] R. K. Kodali, “Smart waste water treatment,” in IEEE Region 10
Symposium (TENSYMP), 2017. IEEE, 2017, pp. 1–5.
[5] M. Sandu, F. Bode, P. Danca, and I. Voicu, “Water flow structure
optimization between the screenings and grit removals in a wastewater
plant,” in ENERGY and ENVIRONMENT (CIEM), 2017 International
Conference on. IEEE, 2017, pp. 101–104.
[6] [Online]. Available: https://mongoose-os.com/
[7] [Online]. Available: https://www.adafruit.com
[8] P. Singh and S. Saikia, “Arduino-based smart irrigation using water
flow sensor, soil moisture sensor, temperature sensor and esp8266 wifi
module,” in Humanitarian Technology Conference (R10-HTC), 2016
IEEE Region 10. IEEE, 2016, pp. 1–4.
[9] E. Myatt, “A new relay for use with electronically controlled switching
systems,” Proceedings of the IEE-Part B: Electronic and Communica-
tion Engineering, vol. 109, no. 21, pp. 115–117, 1962.
[10] R. K. Kodali and A. Sahu, “An iot based soil moisture monitoring on
losant platform,” in Contemporary Computing and Informatics (IC3I),
2016 2nd International Conference on. IEEE, 2016, pp. 764–768.
[11] [Online]. Available: https://docs.losant.com/devices/overview/
Fig. 11: Time-series graph for temperature of water

Fig. 12: Time-series graph for Level of water

Fig. 13: Device log

VIII. CONCLUSION
Three important parameters of Waste water treatment plant
were monitored and a control system has been equipped to
prevent damage to the plant. Alerts are sent to the operator to
notify emergency. This project has a further scope of extension
where multiple other sensors can be integrated making the
system more efficient.

174

Authorized licensed use limited to: Auckland University of Technology. Downloaded on June 05,2020 at 09:03:50 UTC from IEEE Xplore. Restrictions apply.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy