0% found this document useful (0 votes)
12 views5 pages

Requirements

Functional Requirements for Water management system TechH2O

Uploaded by

humzasadiq52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Requirements

Functional Requirements for Water management system TechH2O

Uploaded by

humzasadiq52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Feature: Data Analysis

1. Functional Requirements:

1. Water Usage Graphs:


o The system shall monitor and record water usage data from various sensors,
including flow sensors (YF S201), main water supply sensors, and tank level
sensors.
o The system shall store water usage data in a local database.
o The system shall provide real-time and historical water usage graphs for each
user.
o The system shall allow users to view water usage data for different time
periods (e.g., current usage, daily, monthly).
o The system shall synchronize local water usage data with the cloud database to
ensure data consistency and availability.
2. Water Quality Graphs:
o The system shall monitor and record water quality data from various sensors,
including turbidity sensors (TSD 10) and pH sensors (SEN 0161).
o The system shall store water quality data in a local database.
o The system shall provide real-time and historical water quality graphs for each
user.
o The system shall allow users to view water quality data for different time
periods (e.g., current quality, daily, monthly).
o The system shall synchronize local water quality data with the cloud database
to ensure data consistency and availability.
3. Data Synchronization:
o The system shall initiate synchronization when the network is available.
o The system shall ping the cloud database to check for connectivity.
o Once connected, the system shall request the database logs and synchronize
the local database with the cloud database.
o The system shall handle both data addition (INSERT) and removal (DELETE)
during synchronization.
4. Continuous Data Recording:
o The system shall continuously record data from flow, turbidity, and pH
sensors.
o The system shall calculate and update usage and quality data in real-time.
o The system shall log updates in the local database and synchronize them with
the cloud database periodically.
5. Real-Time Data Retrieval for Graphs:
o The system shall provide continuous data retrieval for real-time graph view.
o The system shall update graphs dynamically while the user view is open.
o The system shall support both current and historical data views for the graphs.

2. Non-Functional Requirements:

1. Performance:
o The system shall ensure real-time data updates and synchronization to provide
accurate and timely graphs.
o The system shall handle high volumes of data from multiple sensors
efficiently.
2. Reliability:
o The system shall ensure data consistency between the local and cloud
databases through robust synchronization mechanisms.
o The system shall handle network failures gracefully and retry synchronization
when the network is restored.
3. Usability:
o The system shall provide intuitive and user-friendly interfaces for viewing
water usage and quality graphs.
o The system shall allow users to easily switch between different time periods
for data analysis.
4. Scalability:
o The system shall support scaling to multiple buildings and apartments,
handling data from numerous sensors and users.
o The system shall ensure efficient data storage and retrieval mechanisms to
accommodate growing data volumes.

3. Sequence Diagram Analysis:

• Synchronization Sequence Diagram (Cloud ⇔ Local Database Synchronization):


o Arrows are correctly used to show the interaction between the database
controller, cloud database, and local database.
o Ensure consistent labeling (e.g., "query DELETE Record" should be "Query
DELETE Record").
• Continuous Data Recording Sequence Diagram:
o Arrows correctly depict the continuous data recording process from sensors to
the database controller.
o Ensure consistent function naming (e.g., "CalculateUsage()" and
"CalculateQuality()").
• Data Analytics Sequence Diagram:
o Arrows correctly show the interaction between the statistics controller,
database controller, and local database.
o Ensure consistent time period labeling (e.g., "Time period=Current" and
"Time period=Month").
Continuous Data Recording:

I. Since this is real-time data recording this function loops to continuously record sensor
data.
II. The microcontroller requests and gets readings from Actuators sensors, Inlet/Outlet
Flow Sensors (YF S201), Turbidity Sensor (TSD 10) and PH Sensor (SEN 0161) data
every 5 seconds.
III. The NodeMCU microcontroller processes and calculates water usage based on the
inlet and outlet flow sensor data
IV. The NodeMCU microcontroller processes and calculates water quality based on the
turbidity sensor data
V. The microcontroller sends the sensor data and calculated values to the Database
Controller (Backend Server) via the Network Module.
VI. The Backend Server forwards sensor data to the Health Recorder and then saves all
data in the Local Database and updates logs on successful operation.
VII. Health Recorder evaluates the sensor data to analyse the data for any anomalies. If an
anomaly occurs the alert is sent to the Control System which then handles the
situation given in XYZ diagram.

Cloud & Local Database Synchronization:


I. The Network Module checks for internet connectivity.
II. Upon network availability, the Network Module initiates synchronization by telling
the Database Controller to Ping the cloud database for connection.
III. The Database controller continuously pings the cloud database until database is
connected.
IV. Once connected, the Database Controller requests logs from both the Cloud Database
and Local Database.
V. The Database Controller compares both logs to identify difference.
VI. If any difference is found then the Database Controller queries the cloud database to
Remove or Insert data and synchronized logs are updated in both databases.

Data Analytics:
I. The User requests graph view by tapping graph and entering the time period of the
graph in the User Interface (UI) on the user’s device.
II. On the Statistics Controller the GenerateShowStatistics() function is initiated with the
“Time period” parameter. Which can either be “Current” or any month. Blank graphs
are also created for data to be plotted in it.
III. The Database Controller retrieves the current (Real-time) quality and usage data from
the Local Database and historical data from the cloud database.
IV. The Database Controller sends this data back to Statistics Controller which then
updates the graphs with the values plotted on the graph.
V. The Statistics Controller then send this graph to User Interface (UI) for rendering and
displaying it to the User.

You might also like