1 Introduction

Water is the basic need of our existence because our bodies have 75% water and the person would die without it. Due to low water safety, human activity is affected, and even harmful illnesses, such as diarrhoea, are induced. The nature and quantity of water we drink in our everyday lives is very critical to human health. Performance of water relates to the water’s environmental, geological, radiological and geological parameters [1]. The key water quality parameters differ according to water use. The temperature, Ph level, dissolved oxygen amount, turbidity and consistency of the water must be preserved for aquariums in a particular standard range in order to guarantee the health of the fish in the aquarium, for example [2]. Some water parameters are important to be checked frequently for industrial and domestic applications. Sensors should be used to resolve the difficulty of traditional water quality control systems. The sensor is an optimal identification tool for the collection, transfer, monitoring, display and transmission of non-power information to electrical signals rapidly [3]. The sensor-based water quality test has many advantages in comparison to traditional water quality tests, including high sensitivity, strong selectivity, distance, rapid response etc. It will be tracked in real-time to ensure the health of water quality. A centralized, low-cost and compact water quality testing device is planned and built to make it convenient for us to check the consistency of the water in real-time [4]. This is a user-friendly program that periodically checks the water quality and sends the note and warns the consumer of some water parameter abnormality.

Larger IoT services are a possibility as networks are built for smart towns, smart transit projects or environmental protection applications. Many of these IoT installations rely on the technology of LPWAN. Low Power Large Area Network [5]. The creation of new LPWAN technologies including Long Range (LoRa), Sigfox, RPMA, and Weightless for powerful wireless communication over very long distances. LPWANs typically represent single-hop networks, through which any node will access an Internet-connected sink node directly [6]. Network providers find this to be beneficial as it can be stopped to create and sustain a multi-hop network. However, since the LPWANs span a wide region and all machines connected to a few pipeline nodes directly, the data will be accessed by a vast number of nodes [7]. There is a problem about how many nodes without dissatisfying relevant criteria can be run in the same area.

LoRa is the most common emerging technology for LPWAN and is seen as a base for their IoT applications by a significant range of industries [8]. In order for LoRa to be scalable, it introduces a variety of communications alternatives from which a sender may select (carrier size, spreading factor and bandwidth. A lot of orthogonal settings provide collide-free communications simultaneously. However, the number of transmitters that LoRa can support is limited [9]. We discuss these capability limitations in this article, which incorporate functional testing and simulation. The following articles are:

1.1 LoRa Link Behavior

Using experiments in the area, we are developing modeling I independent contact range contact settings Spreading Factor (SF) and bandwidth (BW) and (ii) LoRa transmission capture capacity, based on time and power of transmission [10].

1.2 LoRa Scalability Evaluation

LoRaSim is used to evaluate LoRa network scalability. LoRa is not ideally equipped for usage by a typical Long-Range Wide Area Network (LoRaWAN) system with static settings or a single drain. Nevertheless, we demonstrate that the use of many discharges and complex communication parameters that yield highly scalable solutions [11].

1.3 Communication Range of LoRa

If the signal strength transmitted by Prx is over the frequency level, Srx of the receiver the transmission is transmitted successfully [11]. The signal strength obtained from Prx is based on the transmission strength Ptx and all gains and losses along the route, as shown in Eq. 1.

$$ Prx = Ptx + Gtx - Ltx - Lpl - Lm + Grx{-}Lrx $$
(1)

Prx received power in dB, Ptx received power in dB, Gtx received power in dBi, Ltx received power (RF transfer, non-matched connection, connectors) in dB, Lpl lost the way in dB, and Lm lost different kinds of losses in dB, Grx received power in dBi, and Lrx is receiver loses. Prx received power in dB, and Ptx received power in dB were conveyed by the energy in dB. This general equation is condensed for the purpose of this analysis to as shown in Eq. 2.

$$ Prx = Ptx + GL - Lpl $$
(2)

In this scenario, GL blends both general benefits and losses, while Lpl stands for the lack of line, defined by the contact context. On the transmitter side, only the power of the transmission can be changed. Many conditions, such as SF, BW and CR, have no impact or other benefits or losses on radiated electricity. On the receiver hand, the Sensitivity Threshold Srx is constrained by the LoRa SF and BW parameters.

2 Literature Review

Sustainable, secure water access is a significant issue of the twenty-first century on an international scale. Various chemical and biological analytics are widely used to ensure high-quality water supply. Such innovations tend to face many obstacles, including cost-effectiveness, advanced on-site and on-line architecture and restrictions. The new technologies for the use of biosensors focused on microbial fuel cell (MFC) carry an excellent capacity for fast and real-time water quality monitoring [12]. In architecture and performance for on-site sensing, MFCs have the advantages of usability. Given previously studied sensing applications in MFCs, such as the demand sensor for biochemical oxygen, various study groups across the world have recently developed new functional applications to this technology, incorporating multidisciplinary technical expertise in the fields of material science, microbiology and electrical science. This thesis provides the most revised work into the usage of the MFCs in the testing of water quality as possible biosensors and considers the spectrum of potentially harmful analytes found by the technique. The benefits of MFCs over established technology and future work to develop routine applications will also be discussed [13].

A multifaceted solution would be required in order to meet the renewed Government of Canada promised to eradicate all drinking water (DWAs) in First Nations communities within 5 years. DWAs for the disfunction of equipment, inadequate disinfection and unacceptable microbiological quality is usually issued in First Nation communities, but most DWAs are given on the basis of caution only. While most DWAs live for a long time, the consistency of water is not inherently unacceptable [14]. In order to monitor flow rate, turbidity, pH, water temperature and free chlorine, a method with considerable potential for reducing DWAs with real-time monitoring technique is suggested. In a real-time, system, communities can be reinforced, their system controlled, corrected or repaired immediately and the number of “precautionary” DWAs can be decreased as well as the frequency and duration of all DWA. The operators can also increase their control over these water systems. As determined through advisory analyses, the potential decreases in the number of DWA issued are probably greater than 36% [14].

A diverse range of organic pollutants can be present in surface waters such as pesticides, medicines and industrial compounds. Although biomedicine experiments are used to track water quality, the impacts of individual micropollutants and their contribution to the total mixture effect in a water sample are minimal. In the present research, batteries were installed for use in water quality control of in vitro bioassays focused on lines of human and fish cells and organism assays with bacteria, algae, daphnids and fish embryos [15]. Bioassay selection was based on the principles of negative outcome pathways in order to cover important toxicity routes, which environmental water samples know to triggers. 34 water contaminants have been fingerprinted in the bioassay test battery based on hazardous quotients, environmental quality requirements available and the mode of action detail. There was a fairly close correlation with the existing literature impact evidence with the experimental findings [16]. Most of the chemical substances were responsible for apical results in the assay. Conversely, fewer molecules provided a reaction in the recording gene trial, but these responses were normally caused at lower rates. Single chemical impact results were used to enhance the reported water samples from the Danube River mixture toxicity model. Although the fraction of bioanalytic equivalents described in the case of the Danube River samples is marginally increased, the chemicals analyzed may explain for certain endpoints less than 1% of the observed impact [17]. In several trials, the latest mixing technologies have greatly validated previous findings by utilizing both chemical and bioanalytical tools to track water quality. Our results, in brief, indicate that far more chemicals lead to the biological impact than chemically quantified or controlled by environmental requirements of consistency [18]. This study shows not only how useful fingerprinting single substances is to better understand the bio pollutant effects; it also stresses that bioassays must be used to monitor water quality so that the overall biological effect is not underestimated [19].

Any of the recent relevant studies into such works have been reviewed to gain a clear understanding of the emerging water quality control solutions. Khurana et al. suggested a water quality management device that will measure water quality and give a warning signal via Wi-Fi on mobile to the approved staff if the target value is not the water parameter. This method enables the water parameters to be accurately calculated as the PH sensor is double balanced in this device. Yet only the PH of the water and no other water quality measurements are controlled by such a device [20].

The author is used for remotely tracking water quality via GSM (Global Mobile Communications System) and the microcontroller and sensors. The critical parameters of the water content, namely PH, conductivity, dissolved oxygen and turbidity, are calculated by the respective sensors in their proposed method [21]. The controller is then evaluated and, whether it is below the expectations, is sent simultaneously in the form of SMS (Short Message Service) to the testing centers and managements’ phones. In fact, the data is processed in a folder to handle the backup and is shown for further review in a curve and on a computer GUI. This device, though, can only be done to major water sources or businesses as it contains expensive components. So this product could not be afforded by ordinary people [21].

In the IoT (Internet of Things) world, Ramya had an idea about the real-time water quality monitoring. The device consists of multiple sensors to calculate such basic water parameters such as the temperature, PH intensity, conductivity, turbidity, and oxygen level dissolved. The Raspberry PI system is used as the main control and is running using keyboard and monitor on the LINUX kernel. The user must enter a command each time he or she wants to know the measurement sensors or the value of the sensors must only be read at a certain time [22].

This article has established a water quality control program for aquaculture ponds focused on the narrowband internet of objects technologies to facilitate the creation of aquaculture computerization and to track aquaculture ponds more effectively and conveniently. The machine captures and stores multi-sensor details on processors (temperature, pH, dissolved oxygen (DO) and other environmental parameters) remotely, as well as smart monitor and centrally manages breeding pool operations. The device uses microcontroller STM32L151C8 and sensor terminal acquisition in real time such as temperature, pH, dissolved oxygen. It aggregates data and transmits data via the NB-IoT technology over a long distance to the Internet of Things ( IoT) [23].

The findings of sampling evidence on 13 rivières that passed through Jakarta in 2010 from Badan Pengendalian Lingkungan Hidup (BPLHD) showed elevated rates of organic and inorganic contaminants both in river and ground water. In order to tackle contamination, policymakers annually analyze the water quality from a river sample at a waste management facility. It is not always easy to hit the industrial waste disposal stage. Officers will, in some circumstances, ride raft or walk along the river to enter this location. In addition to taking longer, the considerations of public health are taken into consideration. On this basis, a wireless sensor network (UAV / drone) with a 912 MHz radio frequency has been established in this research. In this study, UAV has various water quality sensors to determine: pH, temperature, turbidity, dissolved oxygen (DO) and carbon dioxide. The univeral asynchronous receiver transmitter (UART) on the ground station is used to combine and track all sensors without any need. The telemetry network is built to transmit and receive data in real time up to 1 km. There are three main steps in this study, namely the design, fabrication and flight testing of UAV [24].

This paper illustrates the collaboration between two air quality monitoring systems: one designed for indoor use and another used as an example of citizens’ work together to monitor air quality in smart cities in some regions of Italy. The exchange of information between two structures (inner and outside) makes it possible to make a weighted judgment to improve the quality of the indoor air. By assessing both the quality of indoor and outdoor air, a reasoner decides on the best policy to automatically improve indoor air quality, or at least not to make things worse [25].

Citizens’ basic freedoms are the access to high-quality waters. As a country, safe and healthy water must be provided such that water-borne illnesses or epidemics are not propagated. Therefore, the water quality which is given to people for the purposes of everyday use must be constantly checked and therefore excellence of existence enhanced. This paper introduces the IoT-based water quality monitoring method, which monitors critical water quality parameters such as pH, turbidity and water temperature and regulates the impure water flow, in real-time. The key aim of the water quality management is to simplify physical and chemical water quality assessment during distribution. Water quality management. The aim is to avoid the impure flow of water and enhance safety in community. The water quality may be measured prior to delivery utilizing this method. These can agree on the quality of the water based on data gathered from the sensors and determine to allow or prohibit the delivery of potable water at the point of delivery instantly by shutting the water source piped valves [26].

3 Proposed Solution

In our proposed solution, we are using Node MCU as the core controller of the system. GSM module is connected with Node MCU through which we communicate with our android device. The system functions automatically and independently take the decision. We are using five parameters on which we will measure the quality of water, and these parameters are PH level, the temperature of the water, total dissolved solids, dissolved oxygen, water turbidity. We have defined the limit for parameters and this limit is according to the standard of WHO (World Health Organization). If any water parameter crosses the limit it will take precautions itself as this system is fully autonomous, our device is so intelligent that it makes its own decisions as we have trained our device. It sends the message on an android device after some time. As this device is for the smart city when the water parameters are under the limit, it will open the supply of water and the water transmitted to homes, but if the water parameters are above the range, then it will close the water supply and open another pipe where the water will be transferred for the process of filtration. The main advantage of this system is that there is no human to control this; this machine operates on its own.

There is also an LCD, attach on which readings of each parameter is displayed and after some time these values get updated automatically. For communicating with the user, a GSM device is attached with the Raspberry Pi3 so that it will send the details on android device in the form of an SMS. Three mobile numbers are registered that are getting the data so that any inconvenience can be avoided. The block diagram of this system is shown in Fig. 1. We have different sensors on a pipeline that are notifying us against the pressure, sound and any leakage of pipe. These sensors are deployed with a distance of 2 km, and they are sending the information to the base station, and base station sends the data on the cloud. To improve the life of the battery, we have attached the solar panel with it, and we have used Lora technology for wireless communication.

Fig. 1
figure 1

The hardware part of wireless water quality monitoring

4 Discussion and Analysis

Quality of water is very important in our lives to save our life from diseases. To facilitate our life as well as a smart city, we have designed a low cost, accurate and portable system. It consists of different water parameters and sensors, GSM module, LoRa, microcontroller, solar panel, and LCD. In water parameters, we have PH level, water oxygen, water turbidity, the temperature of the water and dissolved solids in water. A PH 7 is neutral while that above and below is considered as acidic and alkaline, so the range of PH should be between 6.0 and 9.0. The turbidity of the water is a Physical parameter that defines the cloudiness and clarity of the water, Turbidity increase when suspended soil such as particles of clay, soil added in water and temperature impacts both chemical and biological characteristic of the surface so water should be of normal temperature. Dissolved oxygen in water is through the diffusion from the surrounding air, as dissolved oxygen levels in water drop below 5.0 mg/l, the aquatic life comes in stress condition. There are four sensors through which data of water is collecting; these are the parameters to collect water information. Node MCU is the microcontroller and GSM modules, solar panel with battery, LoRa is attached with it. Through LoRa, the data is transmitted to the base station, and the base station sends the data to the cloud and results are shown to a webpage on the laptop. GSM module is sending the data to the Android device and the person receiving it in the form of an SMS as shown in Fig. 1.

The future is about smart technology, and the smart city is one of these concepts. In the smart city, we have different application, and smart water quality monitoring is vast technology as shown in Fig. 2. In which sensors are deployed on pipes so that analysis can be done like to know the pressure of water, sound affecting the pipes, PH of the water, the temperature of the water, turbidity in water and leakage of water from pipes. We have placed our device in different places in the city of at a distance of 2 km in each device as we are using LoRa that is an extensive area network and made for outdoor communication. LoRa is sending the data to the base station, and the base station sends the data to the cloud. Our device is using a low battery, and the solar panel is also attached to the battery to increase the life of the battery.

Fig. 2
figure 2

Smart city water quality monitoring system [27]

The system we have designed is placed in it. When all the parameters of water like PH, turbidity, temperature are average or according to described limit them water supply to the smart city get opened, and if the parameters are not according to requirement then water supply to filtration will be opened, so that water gets a filter and then passed to homes. This whole system is autonomous, and our PH one also receives messages of the results gained by water parameters. These results are also displayed on the webpage so that every human being is aware of the quality of water in their city. This technology provides benefits to human life and causes fewer diseases, as shown in Fig. 3.

Fig. 3
figure 3

Smart city water monitoring plan [28]

An Android device is receiving the SMS about the temperature of the water, water turbidity, PH of the water, dissolved solids in water and updating the user. GSM module is attached with the Node MCU, and water parameters are also connected with the Node MCU. In SMS this device is also notifying against the decision that PH level is 12.5 which greater than the limit defined so a pipe to the city is closed and water is sent to the filtration plant as shown in Fig. 4.

Fig. 4
figure 4

SMS on Android device

5 Real-time Implementation of the System Using CupCarbon Simulator

Our system is for two purposes; one is that our system is deployed on the water plantation and second our system is deployed on different locations, i.e. on pipes to measure the water parameter so that if any damage occurs to a pipe or any impurity enters there, we will be able to know that thing. Our system contains LoRa technology that contains a wider range so we will deploy our system with 2 km distance in each device. Our system gives the monitoring of the whole city so that we will be informed about the overall performance of the water quality in the whole city. Figure 5 shows the before deployment of water quality monitoring sensors in the smart city and in Fig. 6 shows the after deployment of water quality monitoring sensors in the smart city. The wireless sensor network sensor node is deployed, and they send the data to the base station, and further base station updates the data in the cloud. In the above diagram, different sensor nodes are sending the water parameters data to the base station. The main advantage of our system is that it consumes less power and provides data transmission at a wider range. For more battery life, we have installed a solar panel so that our system does not shut down. Sensors deployment in a smart city. Figure 7 shows the image diagram of the simulation. The simulation diagram of CupCarbon is shown in Fig. 8. The satellite image diagram of simulation accurate google maps is shown in Fig. 9.

Fig. 5
figure 5

Before deployment of water quality monitoring sensors in the smart city

Fig. 6
figure 6

After deployment of water quality monitoring sensors in the smart city

Fig. 7
figure 7

Before water quality monitoring sensors in the smart city view from satellite

Fig. 8
figure 8

After deployment of water quality monitoring sensors in the smart city view in CupCarbon Simulator

Fig. 9
figure 9

After water quality monitoring sensors in the smart city view from satellite

The energy consumption is in Joules of node 1 and Fig. 5 shows the remaining energy of node 1 as a function of the time. As we can see, when the node sends a message, it consumes 0.06 J, as shown in Fig. 10 and Fig. 11. The node consumes energy due to the process of sending/receiving data and its electric operation. So, the remaining energy in the node will decrease as a function of the time.

Fig. 10
figure 10

Graph visualization Remaining energy of sensor 1 as a function of time

Fig. 11
figure 11

Graph visualization Remaining energy of sensor 1 as a function of time

6 Conclusion and Future Work

In this research paper, the design of an autonomous water quality monitoring system is shown with results and diagrams. This system is designed for the smart city and to secure people from different diseases that are causing deaths nowadays. The cost of this system is very cheap, and there is no need for human as this is providing the facility of taking decisions on their own. The results of the parameters are accurate and received on time. On Android Phone, the result is coming in the form of an SMS to update the user as well. People can also see the effects on the webpage so that they may get aware of the quality of water.

In future work, we are also making this system to filter the water itself. Furthermore, this system is planted on water plantation from where the water is supplied to homes. At that place the device checks the defined parameters in water, if the water is in excellent condition then it is provided to the whole city otherwise it will block that pipe and sent the water to the filtration plant. There are some sensors attached to pipes like a leakage sensor and sound sensor.