Professional Documents
Culture Documents
RWLD Final Report
RWLD Final Report
(RWLD)
JANUARY 2023
2|R WL D
DECLARATION
I declare that this report is my original work and all references have been cited
adequately as required by the University.
MOHAMAD YUSOF
ID Number: 52101120020
Signature……………………
Full Name: NIK HAFIZUDDIN BIN
N AHMAD YANI
ID Number 52101120369
3|R WL D
APPROVAL PAGE
We have supervised and examined this report and verify that it meets the program and
University’s requirements for the Diploma In Information Technology
4|R WL D
ACKNOWLEDGEMENT
We would like to express our deepest appreciation to all those who have contributed
to the successful completion of this project. The development of the River Water Level
Detector (RWLD) system would not have been possible without the help and support
of numerous individuals. First and foremost, we would like to express our gratitude to
our supervisor, Ts. Yuhanis Binti Omar, for their invaluable guidance and support
throughout the duration of this project. Their expertise and encouragement have been
instrumental in helping us to complete this project. We are grateful to the members of
the Kampung Baru community for their participation in the deployment and testing of
the RWLD system. Their feedback and input were invaluable in ensuring that the
system met the needs of the community. We hope that the RWLD system will make a
positive impact on the community and help to mitigate the impact of floods in the future.
We would also like to thank our families and friends for their unwavering support and
encouragement throughout the course of this project. Their love and support have
been a constant source of motivation and inspiration. Finally, we would like to
acknowledge the support of Ts. Yuhanis Binti Omar in funding this project. Without
their financial support, this project would not have been possible. We hope that the
RWLD system will make a meaningful contribution to flood prevention and early
warning efforts in communities located near rivers and other bodies of water.
5|R WL D
CONTENTS
DECLARATION.................................................................................................................. 3
APPROVAL PAGE ............................................................................................................. 4
ACKNOWLEDGEMENT ..................................................................................................... 5
LIST OF FIGURES............................................................................................................. 8
LIST OF TABLES ............................................................................................................... 9
LIST OF ABBREVIATIONS ...............................................................................................10
ABSTRACT .......................................................................................................................11
CHAPTER 1: INTRODUCTION..........................................................................................12
1.1 Background of Study ...................................................................................................12
1.2 Problem Statement ......................................................................................................13
1.3 Project Aim..................................................................................................................13
1.3 Objectives ...................................................................................................................13
1.4 Scope of Study ............................................................................................................14
CHAPTER 3: METHODOLOGY.........................................................................................23
3.1 Introduction .................................................................................................................23
Figure 2 Agile Model..........................................................................................................23
3.2 Planning Phase ...........................................................................................................24
3.3 Requirement Analysis Phase .......................................................................................24
3.4 Design phase ..............................................................................................................26
3.4.1 System Visualization .................................................................................................27
3.4.2 Prototype Design ......................................................................................................28
3.4.3 Mobile Application Interface Design...........................................................................29
6|R WL D
3.5 Development Phase ....................................................................................................30
3.6 Testing Phase .............................................................................................................32
3.6.1 Functionality Testing .................................................................................................33
3.6.2 Usability Testing .......................................................................................................33
REFERENCES..................................................................................................................45
APPENDIXES ...................................................................................................................47
7|R WL D
LIST OF FIGURES
FIGURE PAGE
1 Flood Flow 16
2 Agile Model 23
3 Activity Diagram 27
4 Schematic Design 28
7 Test Case 33
8 Connecting to Firebase 39
9 Connected to Firebase 39
12 Sequence Diagram 51
TABLE PAGE
1 Features of Proposed 21
3 Development Phase 30
4 Testing Phase 32
9|R WL D
LIST OF ABBREVIATIONS
UI User Interface
10 | R W L D
ABSTRACT
11 | R W L D
CHAPTER 1: INTRODUCTION
Floods are a major natural disaster that can cause significant damage and loss of life.
As climate change continues to exacerbate weather patterns, flood risk has become
an increasingly pressing concern in many parts of the world. In order to mitigate the
impact of floods, it is important to have systems in place to monitor and predict flood
events, as well as to alert people in affected areas so that they can take necessary
precautions.
12 | R W L D
1.2 Problem Statement
A serious natural disaster that can result in severe damage and fatalities is flooding.
Every year, many local residents are affected by floods, suffering losses, injuries, and
even the loss of loved ones. The risk of injury or death due to rising water levels in the
home, particularly at night when victims may be unconscious or asleep, is a major
concern. In addition, the elderly and disabled may be particularly vulnerable in
emergency situations such as floods, due to factors such as age and disability, and
may require special attention and support. The monsoon season is a time of increased
anxiety for many people living in flood-prone areas, as the risk of natural disasters
such as floods increases.
The aim of this project is to develop a system to mitigate the impact of floods and
improve the safety of local residents by providing early warning of rising water levels
and supporting emergency response efforts.
1.3 Objectives
1. To provide early warning of rising water levels in nearby rivers, with a focus on
alerting elderly and disabled individuals to potential flood risk.
2. To minimize property loss and reduce the risk of death due to flooding by
encouraging potential flood victims to take timely action to protect their
valuables.
3. To support the safety and well-being of communities located near rivers and
other bodies of water by providing timely information about flood risk and
helping to coordinate emergency response efforts.
13 | R W L D
1.4 Scope of Study
The scope of this study is to develop a flood warning system for the Kampung Baru
community in order to mitigate the negative impacts of flooding on daily life. The
system will use ultrasonic sensor installed in a strategic location near the community
to continuously monitor water levels and transmit the data to a mobile application for
real-time updates. The goal of the project is to provide timely and accurate alerts to
residents in the event of a flood, enabling them to take necessary precautions and
reduce the impact of flooding on their daily activities.
14 | R W L D
CHAPTER 2: LITERATURE REVIEW
2.1 Introduction
This chapter will provide a comprehensive review of the existing literature that is
relevant to the proposed water level monitoring system with a mobile platform for the
community in Kampung Baru. The review will focus on various aspects of the project,
including monitoring systems, warning systems, and mobile platforms, as well as their
applications in the context of flood disasters. The chapter will also discuss related work
on water level monitoring and flood prevention, highlighting the strengths and
limitations of these approaches. To develop the proposed system, the project will
utilize advanced development techniques, including the use of ultrasonic sensor to
detect rising water levels and trigger notifications to nearby residents through a user-
friendly mobile application. This will enable the community to stay informed about
potential flood risks and take necessary precautions to mitigate the impact of floods
on their daily lives.
A flood is a natural event that occurs when an area is inundated with water from a
river, stream, or other body of water, often as a result of heavy rainfall, a dam or levee
failure, or a coastal storm surge. Floods can cause significant damage to
infrastructure, homes, and businesses, and can also pose a serious threat to human
life. A flash flood is caused by intense rainfall in a short period of time or high river
discharge, according to Archer, D., & Fowler, H. (2015, July). Physical infrastructure
such as residences, schools, health centres, roads, culverts, marketplaces, gabion
embankments, spurs, and hand pumps might be harmed. Natural catastrophes, such
as frequent flash floods, do significant harm to society, and they are especially
concerning when they occur in densely inhabited regions or places with large
concentrations of economic activity.
There are several types of floods that can occur, including riverine floods,
coastal floods, and flash floods. Riverine floods occur when a river overflows its banks
15 | R W L D
and inundates the surrounding area. Coastal floods occur when a storm surge or high
tides cause seawater to flood inland areas. Flash floods are sudden and intense floods
that often occur in areas with steep terrain and can be caused by heavy rainfall or a
dam or levee failure. According to reports, flash floods happened in this area once in
2002, once in 2008, once in 2011, and three times in 2014. The 2008 flash flood was
0.5-1.5 m high and swamped two-thirds of Kajang City (Krishnan, 2008).
Overall, floods are complex natural disasters that can have significant impacts on
communities. Effective flood prevention and management strategies are essential for
mitigating the risks and impacts of floods and helping communities to recover from
these events.
16 | R W L D
2.3 Water Level System (Sensors)
A water sensor, also known as a water level sensor or a liquid level sensor, is a device
that is used to measure the level of water in a tank, pool, or other container. Water
sensors can be used for a variety of applications, including monitoring the water level
in a water treatment plant, monitoring the water level in a swimming pool, or detecting
leaks in a plumbing system. According to Peggie L Olive (2006), a low cost, real-time
water quality monitoring system which can be applied in remote rivers, lakes, coastal
areas and other water bodies is presented.
Overall, water sensors are an important tool for monitoring the level of water in
a variety of applications, providing valuable information for water management, flood
prevention, and leak detection.
17 | R W L D
2.4 Internet of Things
Polymeni, Sofia, et al. (Nov. 2022). The Internet of Things (IoT) refers to the
interconnected network of physical devices, vehicles, buildings, and other objects that
are embedded with sensors, software, and network connectivity, allowing them to
collect and exchange data. The IoT enables these objects to communicate and interact
with each other and with people in a seamless and intelligent manner, leading to new
levels of efficiency, productivity, and convenience in various industries and
applications.
One of the key drivers of the IoT is the proliferation of low-cost and high-
performance computing and communication technologies, such as sensors,
microcontrollers, wireless networks, and cloud computing, which enable the
integration of intelligence and connectivity into a wide range of devices and systems.
Data on things including light intensity, temperature, humidity, soil pH, soil fertility, and
other things were gathered via the Internet of Things (Liu et al., 2019). The IoT also
relies on standard protocols and technologies, such as the Internet Protocol (IP), to
facilitate interoperability and data exchange among different devices and systems.
Karan, Ebrahim, et al. (July 2016). The potential benefits of the IoT are
numerous and diverse, ranging from energy efficiency and environmental monitoring
to transportation and healthcare. For example, the IoT can help reduce energy
consumption and greenhouse gas emissions by enabling smart buildings and cities
that optimize the use of resources and infrastructure. It can also improve transportation
safety and efficiency by enabling connected and autonomous vehicles to communicate
with each other and with traffic systems. In healthcare, the IoT can enable remote
patient monitoring and telemedicine, allowing healthcare providers to collect and
analyze vital signs and other data from patients in real-time and remotely.
Wheelus, Charles, and Xingquan Zhu. (Oct. 2020) However, the IoT also raises
significant challenges and concerns, such as data privacy and security, network
scalability and reliability, and ethical and regulatory issues. Ensuring the security and
privacy of data collected and transmitted through the IoT is a critical issue, as the IoT
involves the exchange of sensitive and personal information and may be vulnerable to
cyber-attacks and data breaches. Ensuring the scalability and reliability of the IoT
18 | R W L D
infrastructure is also important, as the number of connected devices is expected to
grow exponentially in the coming years. Finally, the IoT requires addressing ethical
and regulatory issues, such as the appropriate use of data and the potential impact of
the IoT on employment and social inequalities.
19 | R W L D
potential issues and allowing them to take timely and appropriate action (Brown et al.,
2017). They can also be used to track patient progress over time, allowing healthcare
providers to make informed decisions about treatment plans.
Taheri, Saman, et al. (Nov. 2022). In addition to the types of monitoring systems
mentioned above, there are also systems that monitor and control building systems,
such as heating, ventilation, and air conditioning (HVAC) systems, lighting, and
security systems. These systems can be used to optimize energy usage and improve
the overall functionality and comfort of a building.
20 | R W L D
2.6 Features of Proposed
This project's features, which are listed in Table 2, make it exceptionally user-friendly
and simple for people of all ability levels to use. Modern technology has been
incorporated to make this project more advanced and unique than other similar
systems now on the market. This project also follows current technical developments,
emphasising its applicability and efficiency in the current technological environment.
Overall, the project is a perfect solution for a variety of applications due to its user-
friendliness and integration of cutting-edge technologies.
21 | R W L D
• The purpose of the sound is to alert the
homeowner to the presence of water, so
they can take steps to address the issue
and prevent damage to their home
2.7 Summary
In conclusion, this chapter has provided a thorough overview of the research project,
including the design and implementation of the monitoring system, warning system,
and mobile platform. The use of the Internet of Things (IoT) was identified as the most
suitable approach for this project, as it allows for real-time data collection and analysis.
The goals and guidance for the project were outlined, along with the requirements and
development process for the water level monitoring system. It is crucial that all
technologies and systems involved in the project are fully understood before moving
forward with implementation. The success of the project depends on a solid foundation
of knowledge and understanding. Therefore, thorough research and analysis were
conducted to ensure that the project is well-informed and professionally executed.
22 | R W L D
CHAPTER 3: METHODOLOGY
3.1 Introduction
The methodology for developing the River Water Level Detector will be outlined in this
chapter. This methodology aims to provide a structured approach for creating the
project, taking into account the available methods, resources, and tools to complete
the work and achieve the project's goals. In order to achieve these goals, the agile
model methodology will be used for this project. The agile model methodology consists
of five phases: planning, requirement analysis, design, development, and testing.
These phases will be followed in order to complete the River Water Level Detector
project effectively and efficiently.
23 | R W L D
3.2 Planning Phase
The planning phase of the project, also referred to as the feasibility stage, was a critical
component in the overall success of the project. During this phase, we thoroughly
evaluated the goals, objectives, and potential challenges of the project in order to
develop a solid foundation and roadmap for moving forward. This process involved
identifying and analysing the problem being addressed, examining the current systems
in place, and determining the necessary resources and scope for effectively executing
the project. We also made efforts to anticipate and mitigate any potential issues that
could impact development, in order to ensure the smooth progress and completion of
the project. In addition, we established a clear and detailed project timeline in order to
meet any necessary deadlines and deliver the final product on time. Overall, the
thorough planning and organization efforts undertaken during this phase were
essential for the successful execution and completion of the project.
The requirement analysis phase is a crucial aspect of this project, as it allows for the
evaluation and understanding of the necessary requirements for a successful flood
disaster monitoring and warning system. In order to effectively address the problem s
faced by residents during a flood disaster, it is important to identify and examine
potential solutions through the analysis of relevant journal articles and studies. This
process helps to deepen our understanding of the monitoring and warning system
concepts, as well as the utilization of IoT technologies and mobile tools as platforms
for data monitoring.
Furthermore, the requirement analysis phase involves the examination of similar and
related work or approaches, with a particular focus on projects related to water level
monitoring. This is an important step in order to determine the most suitable
development methodology and sensor for the project. After careful review and
analysis, it has been determined that the water analogue liquid sensor is the most
effective choice to be used in conjunction with the NodeMCU microcontroller in this
project.
24 | R W L D
Overall, the requirement analysis phase is a vital part of the project development
process, as it helps to ensure that all necessary requirements are thoroughly
evaluated and understood, paving the way for a successful and effective flood disaster
monitoring and warning system.
Finished Chapter
Identify concept based 1& 2
Refer articles and
on Monitoring and
Warning System journals
25 | R W L D
3.4 Design phase
The design phase of a mobile application development project is a crucial step that
sets the foundation for the system's functionality and user experience. This phase
typically consists of three distinct phases: system visualization, prototype design, and
mobile application interface design.
The mobile application interface design phase focuses on creating the visual
elements of the application, such as the layout, colour scheme, and overall aesthetic.
This phase also involves designing the user interface (UI) elements, such as buttons,
icons, and input fields, to ensure a seamless and intuitive user experience.
Overall, the design phase plays a crucial role in the development of a mobile
application. By thoroughly planning and prototyping the system during this phase,
developers can ensure that the final product meets the needs of the users and the
business and provides a positive user experience.
26 | R W L D
3.4.1 System Visualization
System visualization aims to provide realistic view about the overall system process.
As a result, the system has to be visualised before the project's development begins.
The complete system process is illustrated in this project's activity diagram, which is
displayed in Figure. Draw.io will be used as the programme for creating the activity
diagram.
27 | R W L D
3.4.2 Prototype Design
A clear explanation of how the NodeMCU and Arduino components of the system can
work together is provided by the prototype design as shown in Figure. Before the real
components are linked together, the configuration of the prototype components may
be determined according to the prototype design. To avoid any problems from
occurring during the development process, the prototype design must be accurate.
28 | R W L D
3.4.3 Mobile Application Interface Design
Users could understand better how input was displayed through the mobile application
interface, which is designed to display data from water level monitoring. The interface
design of mobile applications is said to adhere to the HCI principles. The fundamentals
of human computer interaction focus on creating systems that are simple for users to
use and comprehend, regardless of the information presented. Thus, Balsamiq
software is used to sketch the proposed mobile application interface as shown in
Figure.
29 | R W L D
3.5 Development Phase
Next will be the development phase. The development phase includes four activities.
Figure depicts the phases of development that provide developers a clear picture of
what is happening throughout the process and reach the research goal, which is to
create a complete prototype for River Water Level Detector.
30 | R W L D
First, a new Firebase database project will be created to start off the development
process. As a result, since the Firebase database is a cloud-hosted database, an
internet connection is necessary while developing the Firebase database project. The
required component, including sensor and buzzer, will then be connected referred to
schematic design.
Once all the component are already connected, the development process will continue
by generating the program code. The NodeMCU microcontroller with the ultrasonic
sensor will be used to execute the programme code, which will be written using the
Arduino IDE software. All necessary variables will be defined, and algorithm code will
be written using the C programming language. For more detailed explanation of
development phase will be discussed in Chapter 4. Figure depicts overall view of
project from a broad perspective.
31 | R W L D
3.6 Testing Phase
The testing phase is an essential part of the development process, serving as the final
phase of the methodology and serving to evaluate the functionality and usability of the
completed water level monitoring prototype. This phase plays a critical role in ensuring
that the system functions as intended and that users are able to effectively utilize it
through the mobile app. By conducting thorough testing and analysis, we can ensure
that the prototype is reliable, user-friendly, and capable of effectively protecting the
community from the dangers of natural disasters. The actions involved in the
evaluation phase are shown in Figure.
System integration
Functionality functionality testing
testing of hardware and
software
Functionality
Conduct and usability
Usability testing
questionnaire testing of
River Water
Level Detector
Mobile
Application
32 | R W L D
3.6.1 Functionality Testing
Functional testing is a form of testing that aims to determine whether each application
feature functions in accordance with the programme requirements. Each function is
compared to the associated requirement to see if its output matches the end user's
expectations. The testing is carried out by supplying sample inputs, collecting the
resulting outputs, and ensuring that the actual outputs match the predicted outputs.
Figure below shows the test case to identify the functionality of the prototype and
mobile application of RWLD.
Respondents are asked to rate each statement on a 5-point Likert scale, where 1 =
Strongly Disagree and 5 = Strongly Agree. The overall SUS score is calculated by
averaging the scores for all 10 statements, with a possible range of 0-100. A higher
score indicates a more usable system.
33 | R W L D
34 | R W L D
35 | R W L D
36 | R W L D
37 | R W L D
CHAPTER 4: RESULT AND DISCUSSION
4.1 Introduction
The results and discussion chapter of a project is an important aspect of the report as
it presents and interprets the findings from the testing and evaluation of the system. In
the case of the River Water Level Detector, the prototype testing can be divided into
three categories: uploading test, ultrasonic sensor test, and mobile application test.
The ultrasonic sensor test assesses the accuracy and reliability of the sensor
in measuring the water level. It is crucial that the sensor is able to provide readings
accurately and consistently, as any errors or inconsistencies in the data can affect the
accuracy of the flood prediction and warning system.
Finally, the mobile application test evaluates the usability and functionality of
the app in displaying the data to users. It is important that the app is user-friendly and
able to effectively present the water level data to the users in a clear and concise
manner.
Generally, the results of these tests will provide valuable insight into the
functionality and effectiveness of the River Water Level Detector system and will help
to identify any areas for improvement.
The program code for the River Water Level Detector system was developed using
the Arduino Integrated Development Environment (IDE) software and uploaded to the
NodeMCU microcontroller. This code was necessary to establish connections
between all system components and facilitate the transmission of data to the Firebase
server. The process of creating and uploading the program code was successful, as
38 | R W L D
confirmed by the successful establishment of connections and data transmission
during subsequent testing.
39 | R W L D
4.3 Ultrasonic Test
The ultrasonic sensor plays a crucial role in the River Water Level Detector system,
as it is responsible for accurately measuring and detecting changes in the water level.
Using ultrasonic technology, the sensor is able to measure the distance from the water
surface to the sensor with a high level of precision. In order to ensure the effectiveness
and reliability of the system, it is important to thoroughly test the performance of the
ultrasonic sensor.
During the prototype testing phase of the project, the ultrasonic sensor was
tested for measurements ranging from 5 cm to 30 cm. An algorithm was developed
and implemented to enable the operation of the sensor in the system. The results of
the testing are presented in the table below, with the distance from the water surface
to the sensor and the corresponding ultrasonic reading.
40 | R W L D
Figure 10 Water Level Reading
In order to develop a mobile application for detecting rising water levels, it is necessary
to utilize Android Studio software for both the front-end and back-end of the
application. By using the empty template in Android Studio, a new project can be
created and the necessary user interface can be developed. Emulator is then used as
the mobile device to display the user interface of the application. The resulting mobile
app will be able to accurately detect rising water levels, providing a valuable tool for
those in potentially flood-prone areas.
41 | R W L D
Figure 11 Mobile Application Interface
42 | R W L D
CHAPTER 5: CONCLUSION
5.1 Introduction
The River Water Level Detector (RWLD) is a comprehensive system designed to help
protect people and property from the dangers of rising water levels. It utilizes multiple
methods of notification, including a mobile app and an alarm installed at the user's
home, to provide early warning and alert individuals to potential danger. The
notifications are issued based on the level of risk associated with the rising water,
allowing users to take appropriate precautions to protect themselves and their
possessions.
The RWLD system is particularly useful in areas prone to flooding, where rising
water levels can pose a significant threat to both life and property. By providing timely
notifications, RWLD helps users stay informed and make informed decisions about
how to respond to changing water levels. It also serves as a useful tool for emergency
responders, who can use the system to identify areas at risk and take appropriate
action to protect people and property.
In general, the RWLD system is a valuable tool for helping to mitigate the risks
associated with rising water levels. Its comprehensive approach to notification,
combined with its ability to provide early warning, makes it an essential resource for
individuals and communities living in flood-prone areas.
43 | R W L D
5.2 Future Recommendation
1. Expand water level detection area: In order to better predict the probability of
water rise in an area, it is recommended to expand the water level detection
area throughout Kampung Baru. This will allow for more data to be collected on
water rise patterns and improve the accuracy of flood warning systems.
2. Integrate with other systems: To optimize water usage and improve efficiency,
as well as improve water quality for residents, it is recommended to consider
integrating the water sensor monitoring system with other systems, such as
irrigation systems or water treatment plants. This will allow for real-time
monitoring of water quality and flow, enabling timely repairs and adjustments to
be made to the water treatment process. This integration will also allow for a
more comprehensive approach to water management in Kampung Baru,
helping to ensure that residents have access to clean, safe drinking water at all
times.
Overall, these recommendations aim to enhance the effectiveness of the water level
monitoring system in Kampung Baru, ensuring that local residents are alerted as soon
as possible in the event of unexpected flood warnings. By expanding the water level
detection area and integrating with other systems, we can improve the longevity and
reliability of the system, ultimately helping to protect the community from the dangers
of natural disasters.
44 | R W L D
REFERENCES
Khan, M. Q., & Lee, S. (2019, June 6). A Comprehensive Survey of Driving
Monitoring and Assistance Systems. PubMed Central (PMC). Retrieved January 2,
2023, from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6603637/
7 Phases of the System Development Life Cycle Guide. (2001, January 21). 7
Phases of the System Development Life Cycle Guide. Retrieved January 2, 2023,
from https://www.clouddefense.ai/blog/system-development-life-
cycle#:~:text=The%20planning%20stage%20(also%20called,objectives%20for%20t
heir%20new%20systems
Zhang, C., & Liu, Z. (2019, October). Application of big data technology in
agricultural Internet of Things. International Journal of Distributed Sensor Networks,
15(10), 155014771988161. https://doi.org/10.1177/1550147719881610
Archer, D., & Fowler, H. (2015, July 27). Characterising flash flood response to
intense rainfall and impacts using historical information and gauged data in Britain.
Journal of Flood Risk Management, 11, S121–S133.
https://doi.org/10.1111/jfr3.12187
Smalley, S. S. (2008, February). John Once More. The Expository Times, 119(5),
239–239. https://doi.org/10.1177/00145246081190050802
45 | R W L D
Wheelus, Charles, and Xingquan Zhu. “IoT Network Security: Threats, Risks, and a
Data-Driven Defense Framework.” IoT, vol. 1, no. 2, MDPI AG, Oct. 2020, pp. 259–
85. Crossref, https://doi.org/10.3390/iot1020016.
Hongbin, Y., Liang, L., & Yuandong, A. G. (2016, May). Capacitive micromachined
ultrasonic transducer (CMUT) based micro viscosity sensor. Sensors and Actuators
B: Chemical, 227, 346–351. https://doi.org/10.1016/j.snb.2015.12.061
Sosa, M. E., Gargiulo, M., & Rowles, C. (2015, August). Can Informal
Communication Networks Disrupt Coordination in New Product Development
Projects? Organization Science, 26(4), 1059–1078.
https://doi.org/10.1287/orsc.2015.0974
Hoppe, A., Kastensmidt, F. L., & Becker, J. (2021, November). Investigating real-
time control-flow error detection in hardware: How fast can we detect errors and take
action? Microelectronics Reliability, 126, 114264.
https://doi.org/10.1016/j.microrel.2021.114264
Taheri, Saman, et al. “Model Predictive Control of Heating, Ventilation, and Air
Conditioning (HVAC) Systems: A State-of-the-art Review.” Journal of Building
Engineering, vol. 60, Elsevier BV, Nov. 2022, p. 105067. Crossref,
https://doi.org/10.1016/j.jobe.2022.105067.
Brown, C. M., Kahn, R. S., & Goyal, N. K. (2017, March). Timely and Appropriate
Healthcare Access for Newborns: A Neighborhood-Based, Improvement Science
Approach. New Directions for Evaluation, 2017(153), 35–50.
https://doi.org/10.1002/ev.20234
46 | R W L D
APPENDIXES
Arduino Codes
#include <NewPing.h>
#define BUZZER_PIN D4
#define TRIGGER_PIN D5 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN D6 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum sensor distance is rated at 400-500cm.
#define SAFE_DISTANCE 30 // Safe distance to detect rising water level
#define CAUTION_DISTANCE 20 // Caution distance to detect rising water level
#define DANGER_DISTANCE 10 // Danger distance to detect rising water level
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins
and maximum distance.
//---------------------------------------------------------------------
#include <Arduino.h>
#if defined(ESP32)
#include <WiFi.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#endif
#include <Firebase_ESP_Client.h>
//Provide the token generation process info.
#include "addons/TokenHelper.h"
//Provide the RTDB payload printing info and other helper functions.
#include "addons/RTDBHelper.h"
// Insert your network credentials
#define WIFI_SSID "Repcoppp_2.4"
#define WIFI_PASSWORD "Arifyusof"
47 | R W L D
//Define Firebase Data object
FirebaseData fbdo;
FirebaseAuth auth;
FirebaseConfig config;
//unsigned long sendDataPrevMillis = 0;
//int count = 0;
bool signupOK = false;
void setup() {
Serial.begin(115200);
pinMode(BUZZER_PIN, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to Wi-Fi");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(300);
}
Serial.println();
Serial.print("Connected with IP: ");
Serial.println(WiFi.localIP());
Serial.println();
/* Assign the api key (required) */
config.api_key = API_KEY;
/* Assign the RTDB URL (required) */
config.database_url = DATABASE_URL;
/* Sign up */
if (Firebase.signUp(&config, &auth, "", "")) {
Serial.println("ok");
signupOK = true;
}
else {
Serial.printf("%s\n", config.signer.signupError.message.c_str());
}
48 | R W L D
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; //see addons/TokenHelper.h
Firebase.begin(&config, &auth);
Firebase.reconnectWiFi(true);
}
void loop() {
delay(1000);
}
Serial.println("______________________________");
if (ultrasonic_cm < DANGER_DISTANCE) {
Serial.println("");
Serial.print("DANGER LEVEL");
Serial.println("");
analogWrite(BUZZER_PIN, HIGH);
49 | R W L D
tone(BUZZER_PIN, 1000); // Send 1KHz sound signal...
delay(800); // ...for 1 sec
noTone(BUZZER_PIN); // Stop sound...
delay(800); // ...for 1sec
Serial.println("");
}else if(ultrasonic_cm < SAFE_DISTANCE){
Serial.println("");
Serial.print("SAFE LEVEL");
Serial.println("");
}
}
50 | R W L D
Figure 12 Sequence Diagram
51 | R W L D