1. Introduction
Floods are among the most frequent natural disasters, causing significant damage to infrastructure and displacing, injuring or killing large numbers of persons. Several studies [
1,
2,
3] have proposed flood warning and prediction systems, implementing Internet of Things (IoT)-based technology to monitor river behaviour before and during flood events to control flood-prone areas, helping mitigate or prevent future disasters.
In 2017, Lamichhane and Sharma [
1] state that floods take the lives of more people than many other natural disasters, due to their frequent occurrence and rather unpredictable nature. In the U.S., for example, flash floods kill more than 140 persons per year. The erosive properties of moving water can rapidly debilitate the foundations of structures like bridges and houses that can then be carried off, adding to fatalities and causing billions of dollars’ worth of damage. Between 1980 and 2015, weather-related events like floods accounted for over
$500 billion USD in damage in Europe alone [
4]. The United Nations Office for Disaster Risk Reduction (UNISDR) consider floods as a key hazard for the regions of Africa, the Arab States, the Asia-Pacific, the Americas, and Europe. In 2016, floods caused 1200 deaths in Bangladesh, India and Nepal. In the same year, sudden-onset natural hazards, primarily floods, caused more than 600,000 new displacements in Africa [
5]. This trend is predicted to increase dramatically in the following decades due to climatic change.
Several approaches have been proposed to monitor and provide real-time data of potential flooding using complex sensor datasets and river volume profiles, along with probabilistic methods to predict and warn people of potential disasters.
Rivers, although the most common source of flooding, only represent one potential flooding hazard. Along the western rim of the Pacific Ocean, on average, 20 typhoons per year provide volumes of water that flood canyons and rivers and can accumulate in river basins or deltas where important settlements can be found [
2].
The use of IoT technology, along with data analysis, can help monitor floods and provide useful information needed to predict future floods; however, this technology requires significant data processing resources due to large amounts of incoming data, which can result in important delays when measuring real-time scenarios. In order to develop an effective flood monitoring system, IoT technology may be used along with sensors and other technologies, such as machine learning and artificial intelligence techniques, to improve data acquisition and real-time measurement. Also, ultrasonic sensors and cellular transmission technologies can be deployed to ensure adequate transmission rates and to prevent data loss by implementing optimized telemetry methods and lightweight data structures to reduce the load of outcoming data.
Similarly to most natural disasters, floods possess many variables that can be measured by sensors and electronic devices. In the case of floods, these variables usually include flow, volume, speed and relative humidity, among others, as these variables can significantly change how specific environments react under increased water discharge. However, despite being able to measure the different variables associated with floods, it is currently difficult to retrieve real-time water data that can be used to create future forecasting models, due to topographical factors and infrastructure constructed near cities and settlements. This lack of certainty endangers people, property and animals who live near rivers and other bodies of water, particularly in fast-draining areas prone to flash flooding and in low-lying areas such as floodplains and coastal areas. Thus, the main goal of this research is to design, develop and implement a system, based on different electronic devices and technologies, that can measure and monitor potential flooding in real time and generate data that can be used in future forecasting and prediction models.
As more devices access the Internet, more physical objects or “things” can be connected to the cloud, which has created a revolution insofar as data collection is concerned because of the incredible growth in the number of endpoints that collect information users need to view in real time. Experts forecast that by 2020 a total of 50 billion devices will be connected to the Internet [
6].
IoT technology provides solutions that improve quality of life by making life easier, safer and more comfortable because of the great variety of application areas in urban, domestic, industrial, agricultural, healthcare, transportation and public safety settings. One important application of this technology relates to efforts to mitigate the impact of natural disasters like floods. In [
7] the authors provide a state-of-the-art flood model that can be used to select a suitable method to solve a specific flood problem and discuss some technologies that can be used to remotely sense river data.
The concept of deploying sensors to monitor rivers and streams has been widely tested. Kruger et al. [
8] provide the results of several years’ work in which they developed and deployed more than 220 units to monitor water levels. The units employed incorporated an ultrasonic distance measuring module, a solar energy system and a GPS receiver. They also incorporated cell modems to make possible the transmission of data to the Internet via the cellular network. In this implementation, sensors can make frequent (up to every 5 min) stage measurements, and make data available on the Internet. A key feature of the device is its ability to be installed on bridges, an important design feature as bridges provide sturdy mounting platforms and more convenient river access. Finally, to monitor the proper operation of the unit, it incorporates a humidity and a temperature sensor inside the housing. Ultrasonic sensors use sound waves for its ranging and the speed of sound is influenced by several environmental parameters like temperature and humidity. In this case, the temperature sensor also enables the system to improve the accuracy of the ultrasonic sensor.
Lo et al. [
9] discuss a series of three measurements of river state using pressure sensors, bubble gauges and float gauges. These sensors potentially demand higher levels of maintenance and could be damaged or destroyed by environmental conditions. They also describe a fourth measurement using non-contact radar gauges. With these sensor types measurement reliability depends directly on variables like humidity, rain and fog; they are also potentially relatively expensive.
There are several methods to sense levels, speeds or distances in rivers or other flood situations, one of which uses ultrasonic waves. An ultrasonic sensing system does not require actual contact with the stream to gather information. It transmits a short burst of ultrasonic waves and acquires a return signal [
10]. Using a non-contact system is convenient because it can improve the longevity of the hardware system by not being directly exposed to the constant degradation caused by water and materials that may be carried by stream currents. Additionally, in more sensitive applications, non-contact systems will not contaminate the sensing target as they are not in actual contact with it.
A variety of approaches can be used, some of which can even combine multiple sensors. In [
11], the authors use a flash flood sensor combining ultrasonic range finders with passive infrared temperature sensors. This combination of sensors is necessary due to the relationship between the speed of sound and the ambient temperature. It is necessary to estimate and apply a correction to the raw ultrasonic sensor data in relation to air temperature.
Another development that uses multiple sensors is that of Duraibabu et al. [
12], which describes in detail the creation of an optical fibre pressure and temperature sensor (OFTPS) to measure these two variables from the same point in either fresh or ocean water. The OFTPS is made of glass and combines a Fabry-Perot interferometer (FPI) to measure pressures and a fibre Bragg grating (FBG) to detect temperatures simultaneously. This sensor is stable due to the material from which it is made, and it performs comparably to the commercial Sea-Bird Scientific SBE9Plus sensor, which makes it commercially competitive.
The set of sensors, communication devices and data acquisition methods, along with telemetry techniques, make the system capable of retrieving useful structured information that can be used in future data analysis and forecasting models. Neal et al. have proposed a forecasting model which uses a network of wireless sensors to monitor the water level of a river for further processing using a one-dimensional hydrodynamic model [
13]. The presented data in their research uses variables such as elevation and position of the related nodes along with a Kalman filter to generate data sets as inputs to forecasting models.
3. Materials and Methods
3.1. Message Queuing Telemetry Transport
MQTT is an open machine-to-machine connectivity protocol specifically designed to implement IoT solutions, with low data and bandwidth consumption. MQTT is ideal for devices which use low power technology and have small data forwarding requirements [
23]. RiverCore is designed to use an MQTT protocol to send data through a SIM cellular communication module which is integrated into its main board. The device sends data strings using AT-Commands from the Microcontroller Unit (MCU) to the SIM module to communicate with an external MQTT broker.
3.2. Eclipse Mosquitto™ MQTT Broker
Eclipse Mosquitto™ is an open source-messaging broker that interacts with many devices using the MQTT protocol, which possesses a low code footprint. This broker is installed on a server-side environment that manages all subscription and production topics. The MQTT protocol implements one principal structure, called “topic”, in which messages are sent [
24].
The RiverCore server-side environment implements a data acquisition method that uses the Mosquitto broker to receive messages from RiverCore fixed and mobile nodes. These messages are stored in a NoSQL MongoDB database environment.
Given the joint use of the MQTT protocol and a non-relational database architecture, the RiverCore environment can be implemented in a variety of different clients.
3.3. MongoDB Non-Relational Database
MongoDB is a database model based on JavaScript Object Notation (JSON) format documents stored in data collections. Because each document has a different structure, any data log is capable of having different attributes [
25]. RiverCore’s server-side environment implements MongoDB to save a device’s readings because there could be different sensors connected to the RiverCore datalogger using different log structures in its database. For example, there could be a device holding a temperature sensor and another device possessing an ultrasonic distance sensor, both of which are RiverCore devices; their database entries would have different attributes and values, however. In relational database architectures, this could pose a substantial problem. Importantly, a MongoDB non-relational environment can handle significantly different documents which different devices generate.
3.4. Security Considerations in Telemetry Architecture
Because RiverCore employs a wireless transmission environment, it may be vulnerable to sniffing technologies or external intrusions. Taking these possible security threats into account, the system includes security techniques that are embedded in the transmission protocol, which allows the MQTT protocol to set encrypted server-side credentials for each device and user.
Using this same approach, Singh et al. [
26] have proposed a message-based security token contained in the message’s header to provide for a unique type of message reserved with the code ‘0000’, which creates a “spublish” method with an encrypted message payload. This security proposal for the MQTT protocol takes into consideration how to register the different devices by assigning them a unique identity by means of a Universal Resource Identifier.
The security techniques used by the RiverCore environment enable it to set encrypted credentials based on Secure Sockets Layer and Transport Layer Security (SSL/TLS) certificates, using the Mosquitto broker’s built-in pre-shared key encryption (PSK).
Non-relational database security methods have also been taken into account, enabling the system to set member and client x.509 certificate-based connections. These measurements ensure public key infrastructure (PKI) formats that certificate users and devices to establish valid connections with the database, whether they are made directly from devices, the data acquisition platform or other certified clients. Similarly, Okman et al [
27] have reported some security issues concerning MongoDB, highlighting the lack of authentication of this database engine while in shared mode. To solve this issue, the RiverCore environment can set different security layers, such as SSL/TLS operating system certificates, secure shell (SSH) server access and authentications, which are included in the protocol, as mentioned at the beginning of this section.
3.5. RiverCore Fixed Implementation
RiverCore is designed to integrate different sensors according to implementation needs. One of these implementations is a fixed RiverCore module that senses different variables in a river, such as width, flow speed and water height by using an ultrasonic distance sensor as shown in
Figure 1. RiverCore can send water data through a cellular communications module to monitor variables over a server-side web interface.
A RiverCore fixed node is physically composed of five different devices. These are a 32-bit microcontroller unit, a 3G cellular modem electronic board, a regulated power supply, a solar charge controller and a 12 V 80 Ah battery, as shown in
Figure 2.
This first prototype of the fixed node contains the proper materials and components to be deployed in a remote location near a river environment to detect water level variations. It is cased in an IP65 enclosure which contains the electronic system along with outdoor designed glands and a battery that allows the system to work continuously during the rainy season without any direct sunlight for four days. This means that the backup battery will allow the device to keep operating when the weather is very cloudy, or during night time, until it can get enough sunlight to recharge. Also, its solar energy management system keeps the battery charged using a 75 W polycrystalline 12 V solar panel which allows the device to recharge before it runs out of energy.
The ultrasonic water level sensor MB7066 (
Figure 3) is used to measure the distance between the water surface and the sensor location, which is processed within the microcontroller and encapsulated in a JSON structure, along with the GPS coordinates of the node, the timestamp of the actual reading and an identification string. This data is then transmitted to the server through the 3G cellular network and stored into the NoSQL database to carry out further calculations that can later be used in a flood forecasting network.
The whole system’s electrical consumption reaches a peak of 1 Ah while transmitting data to the server, using all of its capabilities.
3.6. RiverCore Mobile Implementation (Drifter)
A mobile implementation of a RiverCore node to meet the needs of a monitoring drifter device was also designed. This node integrates a GPS module which retrieves location, time and speed variables. It also contains a micro SD card slot in order to retrieve measured data, as shown in
Figure 4. The drifter node is sealed inside a waterproof enclosure that holds a magnetic switch inside, which activates the device to start logging data while it flows through the river bed. This data is stored on the micro SD card and can be analysed by the RiverCore data acquisition platform. No external communication via a cellular or other protocol is built in at this time.
The hardware components depicted above are shown in
Figure 5. The electronics were sealed in a spherical lightweight plastic container using a polypropylene rubber-like material that is often used in the automotive industry. This container has a diameter of 10 cm and is shown in
Figure 6. The device’s main board is 8 cm long and 5.1 cm high.
The drifting device operates using a magnetic normally-closed switch, allowing it to be turned on after it is sealed by removing a previously attached magnet.
3.7. RiverCore Data Acquisition Architecture and Cloud Platform
As mentioned in previous sections, the RiverCore data acquisition environment is integrated via a hardware device, an MQTT broker and a NoSQL document-based data structure, as shown in
Figure 7.
The RiverCore datalogger retrieves information from environmental variables and sends it through a 2G/3G cellular network, using AT commands and the MQTT protocol, to a Fedora 26 Linux server, which has an MQTT Mosquitto broker installed. This broker receives all the messages published to the topic “nodes”, while a background Node.js script saves data using a MongoDB document structure.
While information is saved in a MongoDB database, it can be retrieved using an online monitoring web platform which listens to a WebSocket that receives MQTT messages.
Due to this open scheme, the data acquisition platform is compatible with several devices, software development kits and other IoT projects. By using the JSON format, different devices can publish useful weather data to the system, regardless of the used hardware. Also, devices can subscribe to get useful information in different graphic representations, as depicted in
Figure 8.
The web platform integrates a dashboard to display retrieved data from all fixed nodes. This dashboard includes the latest received notifications, variably related charts which it can visualize or hide depending on the sensors that are connected to the devices, and a map where fixed nodes can be located by markers (as shown in
Figure 9).
Fixed devices are registered on a dedicated section of the web platform, where they have configuration parameters such as node name and sensor features, as shown in
Figure 10. On the other hand, all registered devices can be managed in the section shown in
Figure 11, which depicts the features of the registered nodes.
Retrieved data from all nodes can be downloaded as reports in several formats such as PDF, EXCEL, directly printed or CSV, and is applicable for further analysis for use in flood forecast systems. Furthermore, data can be filtered by inbuilt queries such as date, node or variable, as is depicted in
Figure 12.
5. Conclusions and Discussion
Upon developing, testing and implementing the RiverCore IoT devices and RiverCore’s data acquisition environment, we found three important aspects that require further discussion.
The first important point is the acquisition rate. While developing this real-time device, it was important to measure and store variables using the minimal amount of time possible to permit time to establish communications with the Internet connection between the hardware and the data acquisition web platform. This should be sufficiently low to minimize any significant loss of data that could compromise the system’s ability to monitor the river’s water level. It is also important to remark that the system, as a whole, should ideally be composed of several fixed nodes in order to ensure the operation of a network as a source of useful information for forecasting models, in line with the one mentioned in [
13]. However, the present single prototype functions as a proof of concept useful in evaluating the behaviour of single nodes in realistic field conditions which allow later scaling to multi-node networks.
Secondly, 2G/3G cellular networks communication signals can suffer from interference and strong signal variances in remote locations, increasing the possibility of losing important data. A solution for this common problem is to develop mechanisms like data pools or data files that store most of these data in the device’s memory so that if the Internet connection is lost, the data can be sent at a more suitable moment. By implementing the same storage device that is used in mobile nodes, it is possible to keep data during connection losses.
Similarly, it would be useful to add a real-time connection to mobile drifter nodes to track their location after storm conditions or in case of sensor loss. In this case it may be dangerous to retrieve them if water levels have not sufficiently dropped or the stream flow is too rapid.
Other planned future improvements include enhancing RiverCore fixed- and mobile-node capabilities by making them compatible with commercially available weather stations using the SDI-12 protocol, and establishing mixed interactions between drifters and fixed devices to ensure more efficient data transmission to web-based data acquisition platforms. In terms of power efficiency, future improvements for fixed-node devices include implementing sleep and stand-by modes in order to enhance battery duration and power supply performance while not in the rainy season.
It is important to mention that 4G or 5G network signal strength is not adequate in more remote areas in Mexico, with 3G coverage currently offering better reception for IoT devices. However, our testing has shown that there is no need for a faster connection or more bandwidth in this particular application. This is due to the use of a small data packet and a light communication protocol.
However, the examples of data retrieved from sensor devices deployed in remote and/or urban river locations demonstrated in this paper could be used in forecasting models. Close consultation with hydrologists and data scientists will be needed to implement machine-learning algorithms and other forecasting methods for use in a more extended network formed by many of these devices, along with the implementation of a real-time warning method based on a one-dimensional hydrological model, as mentioned in [
7], supported with topographic basin surveys to establish secure-prone thresholds in each one of the nodes.
Thanks to the data generated and coordination with the local authorities, we can conclude that a complete Emergency Water Information Network (EWIN) might reduce the impact of floods in our city, providing information for city planning and in a worst-case scenario giving citizens several minutes to get away from flood zones.
New monitoring developments that include IoT technology have led to considerable hazard reduction and better understandings of natural phenomena. Here we have shown that building and deploying a reliable water level monitoring network can be achieved with current technology. Nowadays, cellular networks are well developed over most countries, providing a suitable platform upon which to deploy monitoring networks. This does not take away from the fact that cellular networks can fail during natural disaster situations, as with any other wireless technology. Because most water bodies are not equipped with any sensing technology, despite the risks they represent, this is an important cornerstone for hazards and natural fluid dynamics research. Oftentimes the limiting factor is the cost of each individual sensing node, and what we have shown is that a low cost and reliable water level monitoring network is indeed feasible.