Early River Flood-Warning System Based on Embedded Systems

This paper details the design and construction of a Flood Warning System (FWS) for River Nyamwamba that has been prone to floods of a greater magnitude. The idea was developed on the principle that floods are a meteorological event that develops over time, and thus a need for sufficient time for people to evacuate, and to protect their lives and property. However, the range of existing FWSs have a tangle of conflicting requirements in terms of cost and reliability and have challenges from factors as diverse as technological and social. Built on Computer Embedded Systems, this study provides a cheaper and reliable FWS for a country like Uganda. River Nyamwamba flow was modelled with DEM, Topography sheets, river map, imageries, flow data, stage data, land use maps, and rainfall data. The data sets were conditioned and processed in a GIS environment using ArcGIS software and exported to the HECRAS program to perform a steady flow simulation of the river. High-risk areas were visualized that provided reliable river flow parameters that were used as input values for the design of the FWS. An Arduino programmed microcontrollers were used to control all input and output values regarding the modelled river. An ultrasonic sensor was used to monitor the normal flow, intermediate flow, and peak flood water levels. From this, the river stage was displayed onto an LCD screen at all times, an electronic SMS is sent to operators at intermediate flow, while an alarm is sounded at flood level.


INTRODUCTION
Uganda's water resources exhibit both seasonal and spatial variabilityimplying that some areas have too much water, while others are water-stressed (Okello, 2016). Additionally, this is worsened by climate change patterns that lead to extreme weather conditions of floods and drought. According to (UMD, 2014), floods are the leading weatherrelated disaster in the country, with cases like the February 2010 floods and mudslides that affected 300,000 people in Bugisu and Teso sub-regions. Additionally, in May 2013, River Nyamwamba in Kasese burst its banks to a heavy flood that led to the death of 8 people, displacement of 9,663 others, and the destruction of 700 acres of food cropscontributing to people's vulnerability in terms of food insecurity (URCS, 2014). The flooding of River Nyamwamba is attributed to heavy rains in April, May, September, and October. A study by (DWRM, 2015), explained that these rains in the 72.4 km 2 Nyamwamba catchment area led to a high deposition rate in the river and an additional sediment transport capacity in terms of boulders, cobble, and silt of over 1,000,000 tons per year. These depositions have affected the river's hydrological carriage capacity to high volumes of flow during heavy rains and rapid snowmelts from the Rwenzori Mountains.
Currently, the floods are also escalated by the rapid population growth with marginal land for developmental use in the Kasese district leading to the encroachment of the river through poor environmental and agricultural practices. According to (Twesigye , 2009), these practices have exposed people to geological and seismic-related hazards through infrastructural development in gazetted river banks and flood areas. They create river bank failures that are easily washed away when the river swells with an increase in its hydraulic flow. The Ministry of Water and Environment of the Government of Uganda proposed an action plan for the river Nyamwamba floods, with clear immediate and long-term management strategies (DWRM, 2015). It included; among others to construct river bank stabilization facilities like levees and floodwalls, permanent relocation of people to safer areas, routine maintenance of the river channel, and establishment of Flood Warning Systems (FWSs) in the flood-prone area.

FLOOD WARNING SYSTEM
According to (DWRM, 2015), a flood warning system is defined as "a set of capacities needed to generate and disseminate timely and meaningful warning information to enable individuals, communities and organizations threatened by a flood hazard to prepare and to act appropriately and insufficient time to reduce the possibility of harm or loss."

Benefits of a Flood Warning System
FWSs are considered as an alternative for dealing with flood problems, partly because these systems are less expensive compared to structural schemes. According to (Naik & Kurji, 2017), the benefits of an FWS are can be calculated by assessing the possible savings of the quantity of damage of property resulting from action taken in response to the warning. This flood reduction benefit can be expressed as follows;   (Naik & Kurji, 2017). This is as shown in Figure 1 below;

Figure 1: Key Elements of a Flood Warning System
• Are the hazards and the vulnerable well known?
• What are the parameters being monitored?
• Are risk maps and data widely available?
• Is there a sound scientific basis for making forecasts? • Are the right parameters being monitored? • Can accurate and timely warnings be generated?
•Do Warnings reach all those at risk? •Are the risks and warnings understood? •Is the warning information clear and useable?

Risk Knowledge
This involves the process of systematically collecting and analysing hydrological data to determine the dynamic nature of flood hazards. The information is represented in models and flood maps to guide preparations for disaster prevention and responses.

Monitoring and Warning Services
These are established by FWSs that predict and forecast the hazard through continuous monitoring of selected hydrological data. The data computed by the FWSs is then transmitted to the dissemination and communication services.

Dissemination and Warning Services
According to (Naik & Kurji, 2017), dissemination and warning services are twofold in operation i.e., having reliable and robust communication hardware during the disaster, and an appropriate/effective interaction with the community, experts, and other stakeholders. The FWS Response capability finally incorporates an aspect of equipping the communities in the flood-prone areas with education, sensitization, and preparedness programs to fully avoid flood damages.

Application of Embedded Systems in Flood Warning
Embedded systems are electronic devices that incorporate microprocessors during their operation. These systems are designed with hardware technologies that use specific programming languages in the manipulation of the design equipment. They use a relatively slow processor and small memory size as compared to the normal general-purpose computers (Microchip, 2001). Embedded systems are dedicated to a specific task, hence optimized, reducing the size and cost of the product (Reza, Tariq, & Reza, 2010).

Instrumentation in Embedded Systems
Embedded systems work with a variety of other instruments/components for the full operation of real-time tasks. These include; water level sensors, pressure sensors, dc motors, Liquid Crystal Display (LCD) screens, Global System for Mobile Communication (GSM) modules, Buzzers, ultrasonic sensors, colour sensors, LED lights, and Geographical Position sensor (GPS) locators, among others. For this study on the design and construction of an FWS prototype, Ultra-sonic sensors, Flow sensors, and meters, LCD screens, GSM modules, and buzzers were reviewed.

Ultra-sonic Sensors
An ultrasonic sensor is a special-purpose sensor that operates by sending radiation waves to any obstacle in its vicinity. The distance between the obstacle and the sensor is calculated and relied on the microcontroller for computation (Microchip, 2001). In FWS designs, ultrasonic sensors are installed in a vertical plane above the water surface to monitor fluctuating water levels of the river. Ultrasonic sensors are made up of Corrosion-Free Material with Advanced Magnetic Technologies to receive radiations from water and operate on direct current (DC) voltages of 2 -12 V, DC current supplies of 50 mA -5 A, and a maximum Switch Watt of 10 W (Tiwari, Singh, Singh, & Srivastava, 2017).

Flow Sensors and Flowmeters
A water flow sensor consists of a plastic valve body, a water rotor, and a hall-effect sensor. When the water flows through the rotor, it rolls with a speed changing according to the different flow rates of water. The type of sensor for a particular project can be determined from the water pressure (MPa) and flow rate required (Reza, Tariq, & Reza, 2010). In a typical demonstration system, the flow sensors work on acceptable standards of 98.5% to 101.5% at the maximum flow rate of the design (Microchip, 2001). A flow meter is also added on microcontroller circuits to measure and display the volume/or mass of water monitored through the system.

LCD Screens
LCD screens are output devices used in embedded systems to display processed data from the microcontroller. They have materials, which combine the properties of both liquids and crystals that operate at definite temperature ranges to allow inter-reaction between the properties (Microchip, 2001). An LCD consists of two glass panels, with the liquid crystal material sand witched in between them. The inner surface of the glass plates is coated with transparent electrodes that define the character, symbols or patterns to be displayed. When the LCD is in the off state, light rays are rotated by the two polarizers and the liquid crystal, such that the light rays come out of the LCD without any orientation, and hence the LCD appears transparent (Tiwari, Singh, Singh, & Srivastava, 2017;Reza, Tariq, & Reza, 2010). When sufficient voltage is applied to the electrodes, the liquid crystal molecules are aligned in a specific direction. The light rays passing through the LCD are rotated by the polarizers, which results in the activation of the desired characters (Reza, Tariq, & Reza, 2010). The LCD does do not generate light and so light is needed to read the display. By using backlighting, reading is possible in the dark. They additionally have long lives and wide operating temperature ranges.

GSM Modules
A GSM module is used to establish communication between a mobile phone and a GSM system. It requires a SIM (Subscriber Identity Module) card just like mobile phones to activate communication with the network. A GSM module can receive, send and delete SMS messages in a SIM. It can additionally make, receive, and reject voice calls (Tiwari, Singh, Singh, & Srivastava, 2017). The module interacts with the microcontroller through serial communication to send and receive commands programmed to it on a GSM cellular network. GSM modules are compatible with ARDUINO, RASPBERRY PI, ARM, AVR, PIC, 8051, and other digital programming platforms (Sahu, 2016). They can also be directly connected to computers via their serial ports.

Buzzers
A buzzer is an audio signalling device which may be mechanical, electromechanical, or piezoelectric. Typical uses of buzzers include; alarm devices, timers, and confirmation of user input such as a mouse click or keystroke. In an FWS, we apply a buzzer to run an alarm at the peak flood level as an emergency call for subsequent precaution measures.

Reliability of Embedded Systems in the development of FWSs
Existing Flood Warning Systems have not been widely implemented in many floods prone areas because of their need for expensive equipment and centralized computation flood models. However, embedded systems present an opportunity to use the latest work in Information Communication Technology and sensor networks to solve this problem in a way that balances the minimal cost requirement and limited computational power with the need for high reliability of both the system and computation (Basha & Rus, Design of early warning flood detection systems, 2007). The core reliability of Embedded Flood Warning Systems is twofold, i.e., acting as a resilient and adaptive sensory input, which collects and transmits monitored data off-site where it is used to perform spatial flood prediction, and acting as a light-weight computational Grid, which performs local point-based flood prediction and the calculation of flow rates from images (Hughes, Greenwood, Coulson , & Blair, 2006).

Building an Adaptive and Resilient Sensory Input
Since flood-sites are often isolated and difficult to access, the need for manual intervention must be minimized. To achieve this, sensors to monitor water levels, rainfall, pressure, flow rates, and other parameters are installed in the delineated floodplains to relay information in a wired or wireless network to a control centre. Wired networks are normally used when the control centre is in the vicinity of the input sensory point, while wireless networks are used to configure connections when the control centre and input sensory points are at distant ends (Basha & Rus, 2007;Naik & Kurji, 2017). It is additionally reported that typical wireless networks use GSM, Bluetooth, and Wi-Fi modules while wired networks use normal electrical circuitry.

Supporting Local point-based Computation
For better prediction of hydrological and hydraulic parameters that depict floods in a place, a number of input sensors are used in a Local Area Network (LAN) with the flood control centre. Sensors are considered independent point-based inputs, where an upstream installation is simultaneously a source of data for a downstream installation on the network (Hughes, Greenwood, Coulson , & Blair, 2006). The specific dependencies between the point installations of the system make an Embedded FWS a perfect and reliable LAN-based network. Additionally, during system development, these independent parts can be configured onto the full FWS network by using MATLAB, ARDUINO, or any programming environment that supports C code (Basha & Rus, Design of Early Warning Flood Detection Systems for Developing Countries, 2007).

Case Study Area
The Case Study Area in Figure

Formation History of River Nyamwamba
River Nyamwamba was formed from seismic movements of the Western arm of the Great Rift Valley (Bwebare, Kariitu, & Kichodo, 2008). It is additionally reported that during the faulting formations of the Rwenzori Mountains, there was a southward tilting that created an area of weakness at the confluence of the current Lake George and Kazinga channel faults resulting in a North-South drainage pattern. The pattern included the formation of rivers Chako, Kanyampara, Dwimbi, and Dunglea as tributaries of River Nyamwamba in the peak areas of the Rwenzori Mountains (Bwebare, Kariitu, & Kichodo, 2008;DWRM, 2015).

Flow Hydrology and Sediment Transport
River Nyamwamba flows with a downward bedcutting from the Rwenzori Mountains to Lake George with a very rapid youthful stage. The river captures a vast catchment area of 72.4 km 2 with a load-carrying capacity of boulders, cobblers, and silt amounting to over 1,000,000 tons per year (DWRM, 2015). Its high rate of deposition follows high rainfall received in the catchment area, steep slopes, and the rapid weathering rate of the Rwenzori metamorphic rocks. Figure 3 below shows boulders and cobblers as part of the river sediment load carriage.

River Nyamwamba Floods
Flooding of rivers is attributed to meteorological, hydrological, and anthropogenic (human-related) causes (Rugumayo, 2012). Most floods result from the extreme, intense, and long duration of meteorological phenomena like prolonged and intense rainfall, cyclones, typhoons, storms, and tidal surges; and hydrological factors caused by increased run-off from Ice and snow-melt, impermeable surfaces, saturated land, poor infiltration rates, and land erosion. River Nyamwamba Floods to the failure of high-level swamps from terminal moraines of snowmelt on the peaks of the Rwenzori Mountains (Kwatampora, 2014). With the high weathering rate of the mountain rocks, the swamps have been filled with sediments and are now organic bogs with blockages at their outlets often bursting causing unprecedented catastrophic floods.
It is also documented that there was not a wellengineered divergence of the historical old river channel in July 1950 by Kilembe Mines Limited [KML] during the reclamation of the river valley to establish a Copper Mine in the Rwenzori Mountains area (THMCL, 2015). The river that flowed along the main access road of the Kilembe Mines premises, through the current Nursing quarters of Kilembe Hospital to Kasese town was redirected to a new channel of a low hydraulic carriage capacity leading to the first catastrophic flood of April 1966. Furthermore, the area is still liable to flooding because of the current high population density of Kasese district, with limited land for settlement and agriculture, leaving people with no option but the encroachment of river banks and the flood plain which exposes them to flood-related hazards (Rwakakamba, 2009).

Hydrological and Hydraulic Data for the River
Through field research, hydrological and hydraulic data were collected and subjected to flood frequency analysis. The data was used to determine the flood risk extent and stage data of River Nyamwamba. GOOGLE EARTH, ArcGIS, HEC-GeoRAS, and HEC-RAS were used to extract Geographical information of Topography and land use maps of the Kasese district. The maps were vital in the computation and drawing of a river flood map of the Nyamwamba catchment area. HEC-SSP was used for flood frequency analysis for a return period of 100 years and determination of the river stage. Additionally, physical observations and imageries were made along the banks of the river to determine Manning's coefficients that were used in the model. Extraction of the Flood River Map of the Nyamwamba valley is done using ArcGIS as a leading tool and additionally computed in an HEC-RAS environment. It is then overlaid onto a GOOGLE EARTH image as illustrated in Figure 4. HEC-RAS software package was used for hydraulic analysis of river channels. In this study, steady flow analysis was done based on inputs that gave outputs illustrated in Table 1.

0.5572
Where; X = Peak discharge at return period, t = Integration variable of the return period in years, T (for T=10, T=100); s = Standard Deviation (SD); MD = Mean discharge; w and q = Gumbel constants

Interpretation and Conditioning of Filed Data
A review of the river's hydraulic and hydrological studies was done to ascertain the flooding extent in its catchment area. These involved generating the flood map and performing a Flood Frequency Analysis for short and long return periods (i.e., 10 and 100 years), and using models to identify the high-risk areas that need routine monitoring to predict and forecast future events. As later mapped out in section 5.3, a segment of the river at a location of 0 0 12'30.0" N, 30 0 00'25.0" E (Latitude: 0.208333; Longitude: 30.006944) was identified to provide modelling parameters of water levels and flow discharges to design the FWS.

Flood Warning System (FWS) Design
The design of the FWS is based on embedded systems. A power supply and a Control panel are used to run and operate the microcontroller circuit.
The system uses a microcontroller to control input operations regarding the river stage, H and the Flow discharges, Q that are respectively monitored by an Ultrasonic sensor (reading from three threshold levels: normal, intermediate and peak) and a Flow sensor/meter. Output values are relayed to LCD screens, a GSM module, and an alarm. This is as shown in the System Block diagram in Figure 5.

Figure 5: System Block Diagram for the FWS Component
Using the ARDUINO language, the microcontroller is also programmed with different precautions for the 3 threshold water levels to visual, electronic, and sound outputs as shown in the flowchart in Figure  6. As the river stage, H increases, the ultrasonic sensor sends information that is assigned precautions from the microcontroller, as shown in Table 2. The system will also allow the LCD to display at all times, trigger the GSM module after the normal water level is surpassed, and sound an alarm at Flood level. Flood Level LCD, GSM Module, and ALARM

Figure 6: the System Flow Chart (Input -Water Levels)
Similarly, the microcontroller is also programmed with different precautions for 3 discharge values to visual, electronic, and sound outputs as shown in the flowchart in Figure 7. As the flow discharge, Q increases, the flow sensor, and meter send information that is assigned a precaution from the microcontroller, as shown in Table 3. The system will also allow the LCD to display at all times, trigger the GSM module after the normal discharge is surpassed, and sound an alarm at Peak discharge (Flood level).

Construction of the Flood-Warning System prototype
The system was built using the following; an Arduino Uno Programmer, a Microcontroller (ATMEGA 328P model), an ultrasonic sensor, a flow sensor and meter, 2 LCD screens (16X2), a GSM module and SIM card, a buzzer alarm, a development board, and normal electric circuitry. The construction and implementation of the system prototype were sub-grouped into parameter input, system construction, and result output phases.

Parameter Input Phase
In this phase, the ultrasonic sensor was used to read water level values that were relied on the microcontroller for processing. In the prototype water level (PWL) values are computed from actual river stage data using a known scale factor (S.F) in Equation 4.
A Flow sensor and meter were also used to read flow discharges as interpreted by the microcontroller. The input was developed to support three cases of the Flow rates i.e., at normal, intermediate and peak discharges as they would be determined in Flood Frequency Analyses at return periods of 10 and 100 years (see Section 5.3). Similarly, to run the prototype, these field discharges (PFD) were scaled-down with an S.F as shown in Equation 5.

System Construction Phase
This phase involved a series of tools and programming languages that were used to bias the Microcontroller's functionality to this project's requirement and scope. These included; a 12 DC Power source that was used to power the microcontroller and GSM circuits, an Arduino board (i.e., a small computer motherboard used to read information from a variety of sensors, as well as relying on it to output devices), Embedded C programming and a Javascript that were used to write microcontroller programs on the Arduino board. An Arduino IDE (i.e., an Integrated Development Environment for the Arduino programming language) was also used. The IDE contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. It was connected to the Arduino hardware components mainly to upload programs and communicate with them.

Hydrological Data
The Rainfall data of Kasese District (in mm) recorded from 1985 to 2016 by the Uganda Meteorological Department was used for hydrological analysis (see Appendix 1). From the rainfall data, annual precipitation totals for January to December were computed as Figure 7. It is observed that the annual average rainfall precipitation ranges between 1210.8 mm (lowest-1997) and 4644.5 mm (highest-2007)

Figure 8: Annual precipitation totals [in mm] of Kasese District, 1985-2016
The study involved computation of River Nyamwamba annual peak discharges that were recorded throughout a 20-year period of 1997-2017. It should be noted that until December 2015, there was not any operational discharge gauge along the river. It was from this background that the only directly accessed discharge values were for 2016 and 2017. Other annual discharge values (i.e., from 1997-2015) were generated from River Mobuku, another river that originates from the Rwenzori Mountains with River Nyamwamba. Its gauged data was related to River Nyamwamba using Equation 5, which estimates a river discharge from another reference river (Chow, 1992), as shown below;

Rainfall (mm)
It is also recorded that the Catchment area, CM of River Mobuku is 256 km 2 while the Catchment Area, CN of River Nyamwamba is 72.6 km 2 (Kwatampora, 2014) and (Rugumayo, 2012).
Equation 5, is subsequently simplified to; The values of the computed Annual peak discharges of River Nyamwamba were tabulated alongside their corresponding dates as shown in Table 3. The HEC-RAS model used flow discharge data from DWRM for which the peak discharge value was 71.43 m 3 /s. It was done in the ArcGIS environment using RAS mapping tools and preprocessed in a .sdf format file. The file was converted to an XML format that was read by the HEC-GeoRAS application to develop a GeoRAS mapping of the river profile. Thus, various river profiles were generated as indicated in Figure 9 (HEC-RAS representation of River Nyamwamba Geometric data), Figure 10 (X-Y-Z Perspective plot showing the 3D view of River Nyamwamba), Figure 11 (Cross Section across the upstream banks of River Nyamwamba), and Figure 12 (Profile Plot of River Nyamwamba) To delineate the flooding of River Nyamwamba, GIS layers for mapping of inundation and other parameters are created. For data consistency as in the river profile development, a Triangular Irregular Network (TIN) was used in generating the geometric thematic layers. GIS layers created at this stage depend on the content of the very TIN and RAS-GIS export files from the river profile. A water surface in Figure 13 was generated and used in floodplain delineation.

Flood Frequency Analysis
Flood analysis of the river at return periods of 10 and 100 years was carried out using a Gumbel estimation flood event. The river flows discharge standard deviation (s) of 14.363 and mean discharge (MD) of 32.959, resulting in Gumbel's constants as 0.089 and 26.698. For a flood analysis of 10 years, the peak flow rate was estimated to be 51.9792 m 3 /s, while for 100 years, the peak flow rate was estimated at 78.3837 m 3 /s. This implies that a peak discharge of 51.9792 m 3 /s and 78.3837 m 3 /s is expected to be equalled or exceeded in 10 years (2017-2027) and 100 years (2017-2117) respectively as indicated in Figure 14.

FWS Design
In the case study area, the flow regime of the river across the Kilembe mines bridge located at 0 0 12'30.0" N, 30 0 00'25.0" E (Latitude: 0.208333; Longitude: 30.006944) was selected for this purpose. Consequently, the following channel parameters were adopted; Bridge suspended at 22.4 feet (6.83 meters) from the river bed, peak flood height of 6.07 meters, river stage of 4.06 meters, and basin lag time of 4 hours. This implies that; If 6.07 meters of river stage fill up in 4 hours, 1 meter of river stage fills up in 0.66 hours (≈ 40 minutes). For the prototype design, the peak flood height of 6.07 meters was approximated to 6.0 meters. This was then related to 15 cm of the prototype peak flood height to obtain a design Scale Factor (S.F) of 0.4 (i.e., 6/15 = 0.4)) in relation to the actual river stage values.
Similarly, the Peak discharge, Q=78.3837 m 3 s -1 (approximated to Q=78 m 3 s -1 ) attained for a return period of 100 years was used to design for the prototype's response to flow discharges (See Section 5. 1 & 5.2). This was also related to 30 cm 3 s -1 of the prototype peak discharge to obtain a design S.F of 2.6 (i.e., 78/30= 2.6) (refer to Table 4). From the table above, a biased FWS program was created in the Arduino development environment and later downloaded onto the Arduino board. After coding the system in the Arduino Programming language, a visual circuit diagram was drawn in AutoCAD as shown in Figure 15, which was designed. It shows the selection and assignment of different microcontroller pins to the input devices (Ultrasonic sensor, Flow sensor, and meter) and to the output devices (LCD, Buzzer and GSM). It additionally shows the full telemetry and wiring system of the secondary components like the LED lights and Power source.

Testing of the FWS
To ensure that the FWS was in line with the specified requirements, two types of tests were done, i.e., an overall working system analysis and a failure mode investigation. The formerly involved testing the working system for accuracy errors, while the latter included the addition of more water to the prototype and alteration of the system source code to run the system until failure. From the two tests, the following modes of analysis were identified; errors in the input process, lights getting deemed or not going on, buzzer not going on, resistors burning out and GSM module not sending messages. This necessitated highlighting areas of action and calculating a Risk Priority Number (RPN). The radius for the prototype operation was approximately 10 meters for audibility. For the applied field system, the radius is estimated between 5-7 kilometres.

Buzzer Not Going On/ GSM Module Not Sending Messages
The action points were identified by checking the source code and removing all the possible errors before uploading it to the raspberry pi controller chip. Correct connections to the correct pin port (digital pin A5) on the controller were also made.
For the buzzer to work effectively, the 12 V power supply was regulated to about 5V. This reduced the measures of severity, occurrence, and detection to 2, 2, and 2 respectively. A new RPN of 8 (Severity x Occurrence X Detection = 2 x 2 x 2 = 8) was obtained.

Resistors Burning Out/ Lights Getting Deem or Not Going On
During the testing of the prototype, it was observed that some resistors got burnt thus there was no current flow to some sections. To prevent this from re-occurring, the following action points were taken: Using correct size resistors which are compatible with the required voltage rating of 12V.
Ensuring that the power from the mains (240V AC) is stepped down and rectified into Direct Current (DC), the correct code for the right pins to which the deeming lights are connected was debugged and corrected.
After taking note of the above action points; the system reliability improved greatly. Using the PRN method to determine system reliability; the highest value obtained was 96/1000. The mean time to failure of each component is assumed to be independent of the mean time to failure of any other component in the system.

Errors in the Input Process
The input data read by the ultrasonic sensor (refer to Table 4) was related to the actual depths (measured using a meter rule) of water in the prototype. Additional data in Table 6 (i.e., H = 16 -18 cm) and in Table 7 (i.e., Q = 35 -40 cm 3 s -1 ) was added to draw better conclusions from the tests. This generated error margins of percentages ranging from 0% to 3.75%, as shown in Table 6. A similar test was also done for values read by the Flow sensor (refer to Table 4), also generating error margins of percentages ranging from 0% to 10% as shown in Table 7. From observation, since the percentage errors from both input processes are relatively small, the FWS can reliably be adopted for application.

FWS Cost-Benefit Analysis
A cost-benefit analysis for the FWS was carried out based on a profitability index (PI) method for implementation decision purposes by government/organizations with interest. This involved relating the prototype components to durable and robust outdoor components that would be installed for a full real-time FWS of the river as shown in Table 8. Since the Profitability Index, P.I is greater than 1, this is a positive deduction that the FWS is viable in the case study area. The value of P.I is also considerably high because the benefit of this flood warning system has a bigger monetary value as compared to the low sums of money used during initial investment.

CONCLUSION
The study ultimately led to the design and construction of a cheap to install and reliable to operate FWS for any community affected by floods. It begins with a baseline review of hydrological and hydraulic parameters of a given river to ascertain its flood risk extent and peak flood levels that are used to monitor fluctuating water levels over time. This gives the technical personnel and the general populace ample time for evacuation to save lots of lives and property. For the case of River Nyamwamba, the floodplain map within its catchment area was generated using Geospatial tools of GIS. It involved the development of a hydro-geospatial hydraulic model through ArcGIS 10.1, HEC-GeoRAS, and HEC-RAS software. DEM, TIN, topographical maps, river discharge, manning's coefficient values, river cross-sections, and the drainage network of the River catchment, were the major inputs of the model for spatial and hydrological datasets. This generated a floodplain map which was overlaid to a Google earth Image to determine the different areas that require the installation of the FWS. The FWS of River Nyamwamba can, therefore, be adopted in flood monitoring and detection to prevent or reduce the impact of the unavoidable disaster if it was to occur again.
Hydrological and hydraulic datasets are highly dependent on the land cover. The 1995 land-use dataset was not readily available due to the changes in land cover to date (2019). A poor resolution of DEM can affect the results, thus a 90 m x 90 m Uganda DEM from the department of GIS and Survey to develop the required TIN. Also, during the development of the river flood map, required flow discharges of the river were recorded for a period of about 20 years . The bottleneck was acquiring the actual river Nyamwamba flow discharges since, until December 2015, there was not any operational discharge gauge along the river. The only directly accessed discharge values were for 2016 and 2017, while the preceding years (1997)(1998)(1999)(2000)(2001)(2002)(2003)(2004)(2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015) were generated from River Mobuku using theoretical hydrological ratios.
As earlier stated, the methodology applied in this study can also be adopted for any other flooding river in the world, provided one can access all the required hydrological and hydraulic datasets of that given place. For this system to be applicable for most of our local flooding rivers in Uganda like River Unyama, River Manafwa, and others, the Ministry of Water and Environment should install flow gauging stations and rain gauges in the river catchment areas to provide adequate data for running better models during baseline review studies. There is a need to equip and educate the local populace on flood risk management and sustainable watershed planning throughout the country to give them better approaches to the application and response to flood warning systems. Conclusively, for a more reliable FWS that provides better risk knowledge in times of disaster, further studies can also be done in not only monitoring river water levels and discharge flow rates but also including rainfall data and catchment run-offs.

Funding
This study was supported by research grants awarded by the Faculty of Engineering, Busitema University.