1 Introduction

As the coverage superiority of satellite technology became more useful in disaster monitoring, the application of aerial image analysis has been brought into the flood forecasting concerns. Satellite data, which can be used for flood information, can now be used as inputs in forecasting models. The complexity of the method in remote sensing is a bit advanced from the conventional ones. Consequently, expertise and unique facilities were needed in processing the captured images which were not evidently common on all areas globally. Although remotely processed satellite imagery works its way above, ground sensing and monitoring still have more accuracy due to its physical contact sensing type which was also needed by satellite-based forecasting for validation. Geosensors, as most researchers use the term for in-stream sensors to ground and remote-based sensing systems, are valuable method for precise data gathering which is a vital resource to hazard prediction [15]. In addition, the technologies for in situ monitoring were available commercially.

Water level has been the common river parameter with regard to flood monitoring. Devices and sensors utilized for this purpose practically started for storage tanks monitoring application and became a demand in manufacturing industries and power plants. Several researches and innovations were done and came out with contact and non-contact type of water level sensors. Non-contact detection for water level purpose is wireless in nature, either through microwave frequencies, image processing or ultrasonic signals. Submersible-type sensors or contact sensors, on the other hand, need to be physically contained in the water area in order to read the liquid level in a discrete or continuous category [19]. Continuous-level transducers monitor the liquid level in an unceasing fashion as long as the liquid surface will be within its sensing range. Some known technologies used for continuous monitoring were: floating sensors [5, 9]; pressure-based sensors [8, 10, 21]; ultrasonic-level sensors [17]; and capacitive sensors [4, 6, 11,12,13, 22].

In contrast, discrete-level indicators only operate when it made contact with the water. Known sensing method of this type is the simple switch-type sensors using two contacts as impedance measurement probes. If the fluid level touches the two probes, low impedance will be attained by the switch-type sensor. Conducting metal strips working under the principle of electrical conduction of water were utilized as level probes. Sensor drivers and microcontrollers act as the support for this system in automation. Umeh et al. [20] came up with a study to detect a high and low water content within a storage tank. A study of the two copper conductors of electrical conduction concept that uses iron rod and nozzles in liquid level sensing through electrical conductivity of water was also designed and implemented [3, 14]. This contact-type setup was able to detect up to four levels through connectivity of the four nozzles and the grounded iron rod if it touches the water. Similar applications presented by Abdurrahman et al. [2] with only two sensing probes were used in soil moisture detection intended for irrigation and a multi-probe designed by Ebere and Franscisca [7] for water tank.

The aforementioned sensing techniques applied in their respective experiments were shown to have functioned well. They were tested on controlled areas which follow a fixed water movement and characteristics, for example, a storage tank or a reservoir. However, their capability to operate reliably on remote freshwater environment was not tested. Their performance to the unpredictable behavior of river water was still unverified. In addition, several external factors can occur and bring hindrance to the measurement performance. For example, the vertically mounted wireless sensors, which were the commonly installed sensor to measure river heights, have several disadvantages compared to contact types with regard to height measurement accuracy. Just the same problem with the floating sensors, wireless sensors can encounter problems on factors such as ripple variability and intrusion of other floating solid materials, which could produce inaccurate result in water level measurement. On the other hand, the designs presented for capacitive sensing were not favorable for isolated hilly areas. Capacitive sensors and pressure-based sensors can have problems in river applications for its physical composition can be affected by small residues such as sand and other micrometallic particles. Only the previously presented water level monitoring method that has the characteristics to work on river waters is the switching-type technique. Aside from its physical contact with water, its major advantage is the simple “on” and “off” sensing concept which similarly implies that water was detected or not and independently works normal on varying temperature and weather. Although this type of sensing was commonly utilized on tanks and reservoirs, the technique was still not tested for long-term river applications, as there were no any available scientific documents to support its experimentation on rivers.

In order to establish the favorable monitoring accuracy of the contact-type switching method, this study investigates the performance of the designed low-cost water level prototype specifically intended for accurate real-time detection of river water level. This could be a useful hardware for an effective flood monitoring device.

1.1 Outdoor environmental factors

The study of Talling [18] states that chemical composition normally changes during the downward passage of water in a river due to some reasons such as man-made pollutants and the exchange of gases between water and atmosphere. These air pollutants attack copper, leading to the appearance of corrosion on the metal’s surfaces [16]. Since all uncontrollable materials possibly exist in the open environment, it is regarded as the greatest source of corrosion which turns out to be a factor that should be considered in addition to the effects on the electrical performance brought by temperature change. Corrosion has greater effect on the performance of conducting wires through its decreased current–voltage characteristics [1]. Corrosion is mostly influenced by environmental and atmospheric factors.

2 Materials and methods

The aim of this setup was to test the reading capability of the system amid longer exposure to river areas under changing climatic conditions. With this, the reliability of the system in accordance with its expected function will be defined. The study was limited to assessing the performance of the device itself under the notion that it can reliably produce accurate results and that the designed electronics circuitry can continuously operate on a longer time period under heat and moisture regardless of the river water characteristics. Thus, majority of the experiment was conducted in two separate river areas as the water level detection system was purposely developed for fluvial flood monitoring.

The developed water detection system prototype is composed of a detection circuit, the sensing probes, a microcontroller and a real-time clock (RTC) module. The entire hardware system (Fig. 1) works together with the microcontroller program in order to automate its required function. The RTC module was installed for time log during the experimentation.

Fig. 1
figure 1

The microcontroller acts as the pulse detector in the water level sensing process

2.1 The water level circuit

The circuit is composed of two PNP bipolar junction transistors configured into Darlington pair (Fig. 2). This is a common configuration where two transistors (T1 and T2) have its emitter terminal connected to the base terminal of the other transistor, sharing the same collectors. With this configuration, high current gain results from the collector-to-collector terminal from the low trigger current of the base terminal of T2. The input probes will be the level sensors, and the output probes will be directly connected to the input ports of the microcontroller. Ground wires serve as the common probe wherein low impedance is achieved whenever it touches one of the probes. The low impedance state enables the DC voltage to be driven out to the microcontroller with sufficient current and considered as a single pulse.

Fig. 2
figure 2

The stationary tip input sends a pulse signal to the detector once it makes contact with the ground terminal of the TBRG through the electrical conductivity of water. The electrical pulse will then be passed to the pulse detector

The switching-type level monitoring uses solid conductor wires as terminal probes. The simplicity of the switching-type circuit makes it more robust and can be designed with multiple level probe sensing terminals depending on the input capacity of the microcontroller or any detecting circuits. Through a level circuit with wire probe shown, a rise or drop of the water level per unit height will be automatically identified.

In this study, mechanical stresses of cables due to vibrations were neglected because a stationary arrangement of the conductor wires in a pole was the actual placement during the investigation. The concept of skin effect was also ignored since this phenomenon only occurs at alternating current (AC) voltages in relation to the change of high-frequency currents. In direct current (DC) circuits, current either can be distributed uniformly across the cross-sectional area or generally exists in the entire conductor. Wires with solid bare copper conductor of 0.5 mm (hookup wire) diameter were used as wire probes due to its common use in electronic circuit designs.

2.2 Logical operations

For the developed prototype, each level probes have its own detection circuit and each circuit is capable of producing its own DC pulse. To sum up, the 14 detection circuits constitute the 14 level probes in the device. The output of the circuit module (the term used for the set of compressed detection circuits) directly goes into the input terminal of the 53-port microcontroller. As the need arises during actual applications, level probes can still be added.

The level detector only activates when water reaches the bottom probe, denoting that the lowest level was reached. And as the water continuously rises, subsequent probes also activate. The whole process of level probe activations was patterned on this consecutive water increase routine and primarily became the basis in constructing the microcontroller program. The logical operation starts with assigning the DC pulses coming from the circuit module into binary digits. The binary digits were then grouped into sets shown in Table 1, and each set was assigned with its corresponding level gauge.

Table 1 The logical conversion processed by the microcontroller from the output DC pulses of the circuit module with its corresponding level gauge equivalent

3 Experimental setup

The predefined water level gauging of yellow, orange and red levels (Fig. 3) established by the Philippine Atmospheric, Geophysical and Astronomical Services Administration (PAGASA) was used since the detection system was really intended for flood monitoring. The probe gauging value and probe spacing, however, do not follow any absolute gauging standards and only defined in this study for the purpose of the experimentation. On actual installations, the gauging and the separation between probes may depend on the ground baseline of the area where it was installed. To avoid uncertainties due to the effect of the ripple caused by small waves on the river surface, inches were used instead of centimeters. But the designed system is very much flexible and can be adjusted into any measurement units that can suit the river profile.

Fig. 3
figure 3

The minimal probe gauging was in inches (in) to avoid measurement uncertainty caused by the ripples

Without flood occurrence during the experimentation, the performance test was done through dipping the wire probes one by one onto the river in order to test its detection reliability in terms of sensitivity and sensing delay. As a result, only 5 levels of shallow water depth were reached by the sensing probes. Additional reason for this is that the installation was only made temporary and was not provided with full structural concrete support for the iron mast thus, not applicable to be installed in the middle part of the river. For the physical simulation of flood, downward and upward movement of the level probes at a slower rate was performed. The device was tested in the river area for 30 days (Fig. 4) with the wire probes positioned vertically in parallel arrangement, exposed to heat, moisture and rain, continuously monitoring the river height.

Fig. 4
figure 4

The water level monitoring system showing the PV module, 12 VDC battery, the electronic system and the conducting probes

The water level probes were gauged starting from the bottom probe with 3 inches distance from the river surface, denoted as Level 1. To actually simulate the flood, each wire probes were immersed in the river one by one starting on Level 1 so as to depict the gradual increase in water. After reading and recording the values on each probe, reverse procedure was done by lifting each level probes slowly. This simulation of water level distinguishes the operation of the ground sensor during actual flooding because of the reason that water level should not only be monitored when the level increases but rather consider also the instance when the flood recedes. As mentioned earlier, only up to 5 levels probes were tested for the voltage drop assessment and 9 levels for the time delay of detection between levels.

The analog reading (voltage) of the level probes was converted into binary digits in the microcontroller with each logical bit corresponding to the current state of the probe (connected with the ground terminal through electrical conductivity of water or not). The microcontroller reads the number of bits collectively per unit time and applies the “if and only if” restriction of the embedded program codes (Fig. 5) which means that the system only detects Level 1 if and only if the bottom probe goes logic “High.” Level 2 will only be detected if the bottom probe and the next preceding probe go “High.” It goes the same with higher water level gauges; otherwise, the system will read the whole status as normal condition.

Fig. 5
figure 5

The vertical orientation of the wire probes starts with Level 1 at the bottom with “first-in, last-out” detection sequence

3.1 DC pulse-to-binary digit conversion

The analog-to-digital converter (ADC) from the microcontroller has an 8-bit analog input. The 0 to 5 volts DC (VDC) is directly proportional to the 0 to 1023 reading of the ADC unit. Using the ratiometric conversion, the ADC output can be converted using the formula (https://learn.sparkfun.com/tutorials/analog-to-digital-conversion):

$${\text{Voltage }}\left( {\text{DC}} \right){ = }\left( {{\text{ADC}} \times 5} \right) / 1 0 2 3$$
(1)

4 Results and discussion

The experiment was done in two setups; one is the flood simulation for the water level device’s reading reliability. The other is to test the ability of the device to function as expected on outdoor installation, which focuses on its monitoring capability with respect to the utilized conductor wires and the circuit itself. The test setup also aimed in identifying the time delay of water detection between levels in order for the system to be considered reliable in water level sensing. Flood monitoring process was also considered, wherein it does not only include the detection of the increase in the river water but rather the decrease in water level was might as well taken into account.

Every probe activated in Fig. 5 setup has an effect with the voltage drop on the water level readings of the same event since each conductor has its resistance, having its share on the electrical load of the system. This results to the incurred VDC in Fig. 6, which shows the average recorded voltage between the same level readings even before the experiment in the river was conducted. This is a normal situation in every electronic and electrical circuit whenever more conductors were used in the circuit. The drop of the voltage, however, does not affect the detection of the microcontroller as the output DC pulses on the entire experimentation still resulted in values greater than the threshold DC voltage of 1.5 (https://www.arduino.cc/reference/en/language/variables/constants/constants).

Fig. 6
figure 6

The initial voltage on each probe (0.5-mm hookup wire) on similar level decreases as the number of activated probes increases

The resulting 30-day experiment in the river area with regard to the reading ability of the device is shown in Fig. 7. This was the result of the actual flood simulation process for the device testing. It displays a maintained high-voltage reading on probe levels 1 to 5 in the beginning of the monitoring; nonetheless, large voltage drops were recorded at the last day of the experiment. The recorded voltage was way higher than the operating threshold voltage needed by the microcontroller. It can be observed on the graph presented that after 30 days of exposure with heat, moisture and corrosion factors, voltage degradation occurs but did not hamper the expected operation of the system. Table 2 presents the average recorded voltage drop from the initial testing up to the last day of the experiment. Physically, the conductor wires became slightly corroded due to daily soaking and drying of the wire tips. The physical condition of the solid hookup wire conductors used in the study proves to be unaffected by metal corrosion as it lays on the river side for 90 days without missing any level detection, thus proving its reliability in water contact sensing. Outdoor temperature is also a factor in the resulting DC voltage variability, and it can be verified by the resistance of the conductor at some temperature:

$$R = R_{\text{rt}} \left[ {1 + \alpha \left( {T - T_{\text{r}} } \right)} \right]$$
(2)

where R is conductor resistance at a temperature; Rrt conductor internal resistance; α temperature coefficient of resistance for the conducting material; T conductor temperature; and Tr reference temperature

$$V_{\text{C}} = IR$$
(3)
Fig. 7
figure 7

The average recorded voltage on each probe from the initial sampling, the 1st day of experiment to the 30th day

Table 2 The recorded average voltage drop between level detections when the probes were immersed in the river water from Day 1 to Day 30

VC is for the voltage of the conductor, I is for the current, and R is the computed resistance of the conductor. The increase in the temperature also increases the wire resistance, making it consume higher voltage from the source. The calculated voltages of the conductors were considered as voltage drops from the VDC source and thus lessen the actual computed system voltage.

The initial testing encountered important reading stability issues and was considered a notable finding during the monitoring of the decreasing water level. Although the programming concept in the microcontroller to follow a strict routine sequence was seen to be stable, an internal hardware error was encountered. It was observed that just as each soaked wire probe slowly surfaced out of the water, the logical reading from the microcontroller became unstable and resulted in variable alternation of 1’s and 0’s which was supposed to read a steady logic 0. With this problem, a possible factor found; the “floating” state occurs in the Arduino microcontroller pins when the probes were undipped in the water. “Floating” means the Arduino module output has indefinite binary values. It is the usual state of the Arduino digital pins when idle or when the connected switch is in open mode. When the probes were not in the water and not in contact with the ground terminal, the switch is considered open. This explains the reading of 0’s and 1’s output variations in the module. There became a need to suppress the unstable pulse (unwanted 0’s and 1’s); thus, the problem was corrected by connecting a pull-down resistor between the base of T2 and 5 VDC supply. The value of the resistor ranges from kilo ohms (kΩ) up to several hundred mega ohms (MΩ), depending on the sensitivity need of the probes. Higher resistance values enable the current in the system to be controlled, meaning higher current will be allowed and lower current will automatically be neglected.

The program code in the microcontroller has been proven to be reliable and continuously monitor and records the sequential changing of the logical state (high or low) of each level every time the probes were immersed in the water. The resulting time delays in microseconds (µs) shown in Table 3 staged the capability of the detecting circuit in monitoring water level even on semi-corroded level probe tips and exposure to harsh environment. This shorter time delay, which could be efficient in flood monitoring, was made possible through simple and compact circuit assembly and the processor speed of the utilized microcontroller (Arduino).

Table 3 The recorded average time interval delay between the probe readings

5 Conclusion

The result of the experiment in the designed water level device for 30 days in outdoor exposure stressed out the reliability of the circuitry in river applications. First, the device is reliable in terms of its monitoring performance through activation delay between level probes. If flood water rises at a faster rate from Level 1 up to Level 2 (3 in) of water height, the device will only take 133,448 µs to detect and notify that Level 2 was reached and much faster detection on subsequent levels. This gives a strong evidence of its quick detection response for flood monitoring application. The performance of the system also shows the correctness on the increase and decrease detection of water through actual flood simulation procedure. Second, the reading capability of the wire probes after exposure to outdoor environment was found out to be stable. This was tested through the voltage readings from the microcontroller output in which after having partially corroded probe tips due to outdoor environmental factors, it continuously performed as expected and never went near the 1.5 operational threshold DC voltage. From the actual 4.8 VDC source, 0.22 to 0.31 DC voltage drops were recorded between similar level probes (e.g., from Day 1 to Day 30 of all Level 1 s) on the sampled 5 wire probes. This recorded voltage drop had a insignificant effect on the total operation of the circuit and does not indicate any performance degradation of the device. It is normal for closed looped circuits to have voltage drops since every connected conductor has its own resistances, which is the main reason of the voltage difference. For the main reason that the temperature coefficient of a conductor is a function of its resistivity, outdoor temperature variations were also considered as a factor for the voltage drops. Lastly, the initial test has uncovered a notable problem that contributes to great effect in reading accuracy of the water level circuit. The “floating” state of the Arduino microcontroller creates a series of 0’s and 1’s reading, in which a steady 0 output was expected whenever its corresponding probes were lifted out of the water. The unnecessary pulses, however, were suppressed by pull-down resistors installed into the base-to-DC source terminal on each of the circuitry. This phenomenon was not mentioned on all related studies using similar methods of level detection.

Above all, the physical condition of the whole system has proven to be unaffected by any atmospheric or hydrologic factors as it presently stays on the river side with continuous monitoring operations.