Research Paper 12
Research Paper 12
Research Paper 12
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
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.
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.
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.
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
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.