IoT based wastewater spillage detection system

Internet of Things (IoT) is a system of interrelated devices including computers, processors, machines, or objects capable of transferring data over a network with no object-object, object-system interactions. In India, one of the most influential problems observed is the overflowing drains in the sewage system which becomes more problematic during the monsoon seasons when the authorities are unaware of the overflowing drains. It becomes unhygienic for the nearby residents and also causes water-logging which leads to breeding of pests. Our solution to this problem is an IoT system which instantly notifies the municipal authorities about the overflowing drains via email or notification at the city control center, also the citizens will get updates via social media or a mobile application. This system mainly comprises a low-powered IoT based portable device to be attached below the manhole cover. It leverages the LoRa technology to transmit the sensor data. Also, the frame of the manhole will be using solar power to charge the device. The proposed system makes the management and monitoring of the underground drainage system easier and hence saves the lives of hundreds of manual scavengers who die each year while cleaning the drainage systems.


INTRODUCTION
Nowadays, IoT has proven its importance in various fields revolving not only around engineering and technology but also around city development and administration to ensure smart governance. The water that leaks through cracks and joints in a manhole overflows which may lead to traffic as well as human casualties. It may also lead to a contaminated water area near the overflowing manhole which would act as a potential breeding ground for mosquitoes, flies and various other disease-borne vectors. This infiltration along with the treatment costs and the increased probability of sanitary sewer overflows (SSOs) getting prone to these illnesses demands a sudden need of developing a solution which solves this problem, and timely action needs to take place for its maintenance. The cost of treating this extra water is far greater than the minimalistic cost of solving the problem using modern technological advancements.
The manholes are the most important segment of any drainage system in aspects of inspection, maintenance and cleaning. Urban areas have an underground drainage system and utmost care should be taken by the concerned authorities to maintain it properly. If the maintenance of drainage systems located underground is not done properly, groundwater gets adulterated which leads to water-borne diseases. During the monsoon season, occlusions in the drainage system result in overflowing of the manholes which leads to unhygienic conditions. The Government of India with the collaboration of various state governments has planned smart city models for various cities in the country. This model surely makes the city connected via the internet and has used upcoming technologies to ease the mode of operation of various sectors of the city. The smart city model is composed of numerous IoT as well as other technologies-based components such as smart traffic management system, smart infrastructure management, smart energy management, smart waste management, smart street lighting system, smart parking system, etc. which lead to the overall sustainable development of the city. These occur through sensors and data related to them and their acquisition and analysis, connected over the internet using IoT. However, an important aspect such as the drainage system lacked upgradation and can be integrated into this smart city model, hence overcoming this loophole, making the system truly versatile.
Hence, there should be a facility in the city's corporation, which alerts the officials about blockages in sewers with its precise location, when the drain is nearing outflow and when the wastewater has overflowed the specified threshold level. A notification can be sent to the nearby nodal offices of the city to report this, so that workers can come and repair it as soon as possible, avoiding days of unreported hassle to the public and other consequences. Underground drainage consists of a sewage system, gas pipeline network, water pipelines, and manholes. This solution can be applied to these pipelines, mainly manholes. A mini solar panel is attached over the manhole which converts the light energy absorbed and converts it to electrical power and stores it into a battery so it can be used for the operation of the device during the night as well. A LoRa module connected with nodes would allow information to be passed in this IoT model.

RELATED WORKS
Authors of [1] present a system equipped with the flow and ultrasonic sensors which detect the leakage and overflow respectively with the assistance of Wireless Sensor Network (WSN) which is solely established on the ZigBee technology and Internet of Things. An alert is sent with the help of a mobile app to the authorities in the Municipal Corporation informing or warning regarding the overflow or any blockage to prevent any leakage. The shortcoming of this system is that it is based on ZigBee technology. ZigBee technology is a short-range IoT protocol which is helpful for connecting devices in close vicinity but the manholes are located at a considerable distance from each other. This shortcoming is resolved by our system as we are leveraging LoRa technology for sensor data transmission. As LoRa technology is inexpensive, secure, works across a long-range and consumes less power, it is more suitable for this kind of application.
The work from the authors of [2] showed a model where any blockages, or any spike in temperature, explosion due to fatal and toxic gases, are shown for displaying the overflow. The lid of the manhole was left open and was detected by various sensors. The resulting signals from the sensors were fed to the microcontroller. Also, it was programmed to generate alerts. A prototype demonstrated in [3] uses a variety of sensors and clog detecting modules that are positioned at various locations along the drainage system and the data is transmitted using IoT. In both the above-proposed systems, authors have used boards such as Arduino Uno, Raspberry Pi 3 Model B and various components such as gas, temperature, ultrasonic sensor, LCD, etc. which require a considerable amount of power to function but these systems seem to lack any battery enabled sustainable power source which can keep these systems functioning despite them being placed underground. This issue is resolved in our proposed system as we have used a 3.7 V Li-Po battery which is recharged by a mini solar panel fixed on top of the manhole cover, thereby making the system completely self-sustainable for large periods of time.

System Components
The components in this IoT enabled system are listed below as shown in Fig.4:

Hybrid Water Sensor.
It is an analog water sensor featuring easy installation and an integrated chip. It operates between 3-5V (VDC) and less than 20mA current. For its application in the drains, where there is the presence of hard water which is chemically very toxic in nature, the component of the sensor in contact with the drain water (i.e. the leads) can be made up of some alloys having highly electrical conductivity and high resistance to water (For an example, Nickel Palladium Free White Gold Alloy) and also an anti-corrosive float ball switch can be added for better accuracy.

Software Requirements
The software requirements to develop the system are as follows:

Device Firmware
Writing. It has the following two components: a) STM8CudeMX: The firmware writing for the main device (Individual Node) attached to the drains is done on STM8CudeMX (STMicroelectronics -STM8 Software Development Tools). Embedded C programming language is the base language to program the microcontroller in this IDE (Integrated Development Environment).
b) Arduino IDE: The firmware writing for the gateway is done on the Arduino IDE, where the programming language is based on a simple hardware programming language known as procession which is similar to C/C++ programming language.

Application Integration. It consists of the following component: a) Node-RED:
It is a tool for developing a flow-based context for visual programming, API (Application Program Interface), and also for the development of the IoT based service as demonstrated in figure 12. Node-RED provides a web browser-based flow editor, which can be used to create JavaScript functions. The notification to be sent to the authorities and citizens via. mail and social media handles (e.g. Twitter page of the city) will be integrated using this platform.

Working of the proposed system
The individual node, the main device, will be attached with the drain cover, such that the sensor will be inside the drain. On top of the drain cover, the solar deck studs were installed. Now, in a general case, the water or the waste flowing in the drainage pipes will flow in a manner that it will not come in contact with the leads of the hybrid water sensor. For this case, the device will be in deep sleep mode (power saving mode) which would also be the default state of the device. Now, when the waste in the drainage crosses the threshold level, it comes in contact with the sensor leads and the device enables the active mode and starts monitoring the flow of the wastewater by multiple triggers thereby measuring the sensor values. It will decide that the trigger is measuring wastewater flow or not by monitoring it for some time limit. If the water is flowing for a long continual, then the MCU will send the data to the LoRa Module via SPI (Serial Peripheral Interface) communication. The data received by the LoRa Module will be sent to LoRa Gateway as a data package through wireless communication. The data package is received by 'The Things Network' which operates in SBC (Single Board Computer -Raspberry Pi 3B). The minute the SBC receives the data package, it runs the API through Node-RED and performs the following actions:  It will send the email and dashboard notification to the local authorities informing about the drain water overflow with the location of the area where the overflowing drain's node has detected and to resolve the issue.
 It will send a message with the precise location to the workers on their cell phone to reach the place. A tweet on the city twitter page would be auto-generated.
 As soon as the issue is resolved, the device will enter the deep sleep mode again, so the MCU will stop sending the data to LoRa module. As a result, the SBC through Node-RED will send an API tweet on the City Twitter page updating about the solved issue of overflowing drains.

EXPERIMENTAL RESULTS
The proposed system was tested under an experimental environment which simulated an overflowing manhole. As soon as the water started overflowing, the system was successfully able to send a tweet for public awareness, an email and SMS to the concerned municipal authorities with the exact time and precise GPS location of the overflowing manhole in both English as well as the local language so it can be comprehended by each citizen. The system was kept in an experimental environment for several days and it worked flawlessly each and every day, which proved the capability of the solar-powered battery system as a sustainable energy source. The experimental results are shown in the figures 14, 15 and 16 below.

CONCLUSION AND FUTURE SCOPE
In this paper, we highlighted and discussed regarding our research related to an IoT enabled manhole wastewater spillage detection system, which empowers us to solve this challenge in nearby leaking manholes and installation of this low-cost, high productivity system can solve a large plethora of problems. It can be integrated with the Smart city models and can be a useful commodity to the municipal community to enhance the quality of our roads, as well as timely detection and maintenance. Also, the LoRa module used the latest technology for long-range communication enabling this solution to work for many years. Being a self-sustainable IoT device, it used solar power 10 to encompass the necessity of a non-renewable energy source by replacing it with environmentfriendly solutions.
A tangible future scope might be the addition of a lid which might open itself. Also, the mechanical device could be made of a more lightweight yet water-resistant material than plastic. Also, a gyroscope can be integrated with the system to notify the authorities about any misalignment or damage to the manhole.