SMART HEALTH MONITOR - PROJECT REPORT
- PROJECT OVERVIEW
The Smart Health Monitor is a console-based application written in C designed to help users track their daily health metrics. It allows users to store, view, and analyze vital signs such as Heart Rate, Blood Pressure, and Blood Sugar levels. The system ensures data persistence by saving records to a text file, allowing users to maintain a long-term health history.
Key Features
Data Entry: Simple interface to add daily health records. Data Persistence: Automatically saves and loads data using a text file named "health_data.txt". Health Analysis: Calculates averages and flags abnormal values (e.g., High BP, Low Heart Rate). Tabular View: Displays all historical data in a clean, readable format. Lightweight: Runs efficiently with minimal memory usage.
- SYSTEM ARCHITECTURE
The program follows a modular design with four main functions triggered by a menu-driven interface: Input Module: Captures user data (Date, HR, BP, Sugar). Storage Module: Handles File I/O (Input/Output) using standard C file handling. Analysis Module: Processes the array of records to compute statistics. Display Module: Formats and prints data to the console. Program Flow: Start -> Load Data from File -> Show Menu -> User Selection -> Execute Function -> Loop or Exit
- DATA STRUCTURES
The project uses a single structure named "Record" to define a health entry. This structure contains the following variables: date (String): Stores the date (e.g., "25-01-2026"). heart_rate (Integer): Stores Beats Per Minute. sys_bp (Integer): Stores Systolic Blood Pressure. dia_bp (Integer): Stores Diastolic Blood Pressure. sugar (Integer): Stores Blood Sugar levels in mg/dL. Storage Strategy: A static array named "data" with a size of 100 is used to store these records in memory while the program is running.
- FILE STORAGE FORMAT
The program uses a custom text format for simplicity. File Name: health_data.txt Format Line 1: The total number of records (Integer). Subsequent Lines: Space-separated values for each record. Example File Content: 2 25-01-2026 72 120 80 95 26-01-2026 85 140 90 110
- ALGORITHMS
Analysis Logic The analysis function iterates through the data array once to calculate averages and check thresholds.
Average Calculation: Sum of Metric divided by Total Count. Heart Rate Check: Warning if greater than 100 (High) or less than 60 (Low). Blood Sugar Check: Warning if greater than 140 (High). Blood Pressure Check: Counts incidents where Systolic is greater than 130 or Diastolic is greater than 85.
File Loading Algorithm
Open "health_data.txt" in read mode. Read the first integer to get the Record Count. Loop "Count" times to read each record using the fscanf function. Close the file.
- TECHNICAL SPECIFICATIONS
Language: C Lines of Code: Approximately 140 lines Libraries Used: stdio.h, stdlib.h, string.h Time Complexity: O(n) for analysis functions. Space Complexity: O(n) where n is the maximum number of records (100).
- TEST CASES
Test Case 1: Normal Vitals Input: Date: 25-01-2026, HR: 72, BP: 120/80, Sugar: 90 Expected Output: Status "Normal" Result: Pass Test Case 2: High Blood Pressure Input: Date: 26-01-2026, HR: 75, BP: 145/95, Sugar: 95 Expected Output: Alert "Frequent High BP detected" Result: Pass Test Case 3: High Blood Sugar Input: Date: 27-01-2026, HR: 80, BP: 120/80, Sugar: 160 Expected Output: Sugar Status "(WARNING: High)" Result: Pass Test Case 4: Memory Full Input: Attempt to add the 101st record. Expected Output: Error message "Memory full!" Result: Pass
- FUTURE ENHANCEMENTS
Implementing CSV export for opening data in Excel. Adding BMI (Body Mass Index) calculation. Adding password protection for user privacy. Searching functionality to find records by specific date.