# suyashagnihotri/smart-health-monitoring-system-using-iot architecture

> Architecture diagram of the GitHub repository suyashagnihotri/smart-health-monitoring-system-using-iot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suyashagnihotri/smart-health-monitoring-system-using-iot
- Repository: https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot

## Overview

1. **Repository purpose**
   - This is an IoT health-monitoring project centered on **real-time vital sign acquisition** and **wireless display**.
   - The core monitored signals are **heart rate, SpO₂, and body temperature**.

2. **Hardware sensing layer**
   - The sensing node is implemented in **`nano_sensor_module.ino`** for an **Arduino Nano**.
   - It reads from a **MAX30100** sensor for pulse/oxygen-related measurements and an **LM35** for temperature.
   - This is the physical data-capture boundary of the system.

3. **Gateway / connectivity layer**
   - **`nodemcu_health_monitor.ino`** runs on a **NodeMCU (ESP8266)**.
   - The Nano sends sensor data to the NodeMCU over **serial communication**.
   - The NodeMCU acts as the networked gateway, bridging local sensor data to wireless access.

4. **User-facing dashboard**
   - The README indicates the NodeMCU hosts a **wireless dashboard** for live monitoring.
   - Architecturally, this is the main presentation layer: it receives the health readings and exposes them over Wi‑Fi for viewing.

5. **Embedded communication boundary**
   - The main embedded data flow is:
     - **Sensors → Arduino Nano → serial link → NodeMCU → wireless dashboard**
   - This is a two-board design, separating sensor acquisition from connectivity/UI hosting.

6. **Machine-learning / prediction subsystem**
   - The presence of **`disease_model.pkl`**, **`label_encoder.pkl`**, **`Health data.csv`**, **`a.py`**, and **`predict_app.py`** indicates a separate ML-based prediction pipeline.
   - This appears to be an offline-trained model packaged for inference, likely used to predict a health/disease category from recorded health data.

7. **Data assets for the ML pipeline**
   - **`Health data.csv`** is the dataset source.
   - **`disease_model.pkl`** stores the trained model.
   - **`label_encoder.pkl`** stores the class-label mapping used by the model.
   - These files form the model artifact boundary, distinct from the embedded sensing path.

8. **Python application layer**
   - **`predict_app.py`** is likely the runtime entry point for invoking the trained model.
   - **`a.py`** is probably a supporting script for training, preprocessing, or experimentation.
   - This part of the repo is separate from the Arduino/ESP8266 firmware and likely runs on a PC or server.

9. **Repo structure and concerns**
   - The repository combines **firmware**, **wireless monitoring**, and **ML prediction** in one place, but they are logically separate subsystems.
   - There is no obvious cloud backend, database server, or mobile app in the tree; the architecture is primarily **edge device + wireless dashboard + local ML artifacts**.

10. **Documentation / visuals**
   - The **`images/`** folder and its readme support the project diagram and presentation assets.
   - The top-level README is minimal and mainly describes the sensing and wireless monitoring path.

11. **Likely architectural diagram boundaries**
   - A clear diagram should show:
     - **Physical sensors**
     - **Arduino Nano acquisition**
     - **Serial link**
     - **NodeMCU Wi‑Fi dashboard**
     - **Python ML prediction component**
     - **Trained model files / dataset**
   - The live monitoring path and ML prediction path should be shown as related but distinct flows.

12. **Technology summary**
   - **Embedded:** Arduino Nano, NodeMCU/ESP8266, MAX30100, LM35
   - **Connectivity:** serial + Wi‑Fi
   - **ML/runtime artifacts:** Python scripts, pickle model files, CSV dataset

Main entry points: [`nano_sensor_module.ino`](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nano_sensor_module.ino) (Nano firmware), [`nodemcu_health_monitor.ino`](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nodemcu_health_monitor.ino) (Gateway firmware), [`predict_app.py`](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/predict_app.py) (Predict app), [`a.py`](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/a.py) (Train script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_embedded["Embedded monitoring"]
  node_sensors(("Vital sensors<br/>physical inputs"))
  node_nano_fw["Nano firmware<br/>Arduino sketch"]
  node_serial_link(("Serial link<br/>board bridge"))
  node_nodemcu_fw["Gateway firmware<br/>ESP8266 sketch"]
  node_wifi_dashboard(("Wi‑Fi dashboard<br/>live UI"))
  node_sensor_stream(("Live readings<br/>data stream"))
end

subgraph group_ml["Prediction pipeline"]
  node_csv_data["Health data<br/>dataset<br/>[Health data.csv]"]
  node_train_script["Train script<br/>Python script<br/>[a.py]"]
  node_predict_app["Predict app<br/>Python runtime<br/>[predict_app.py]"]
  node_model_file["Disease model<br/>pickle artifact<br/>[disease_model.pkl]"]
  node_encoder_file["Label encoder<br/>pickle artifact<br/>[label_encoder.pkl]"]
  node_ml_output(("Prediction<br/>health class"))
end

subgraph group_docs["Documentation"]
  node_readme["README<br/>project docs<br/>[README.md]"]
  node_predict_docs["Predict notes<br/>support docs"]
  node_images_readme["Images notes<br/>support docs<br/>[readme.md]"]
end

node_sensors -->|"measure"| node_nano_fw
node_nano_fw -->|"send"| node_serial_link
node_serial_link -->|"deliver"| node_nodemcu_fw
node_nodemcu_fw -->|"serve"| node_wifi_dashboard
node_nano_fw -->|"emit"| node_sensor_stream
node_sensor_stream -->|"forward"| node_nodemcu_fw
node_csv_data -->|"train"| node_train_script
node_train_script -->|"fit"| node_model_file
node_train_script -->|"encode"| node_encoder_file
node_model_file -->|"load"| node_predict_app
node_encoder_file -->|"load"| node_predict_app
node_predict_app -->|"infer"| node_ml_output
node_readme -.->|"describes"| node_nano_fw
node_readme -.->|"describes"| node_nodemcu_fw
node_predict_docs -.->|"documents"| node_predict_app
node_images_readme -.->|"supports"| node_readme

click node_nano_fw "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nano_sensor_module.ino"
click node_nodemcu_fw "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nodemcu_health_monitor.ino"
click node_csv_data "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/Health data.csv"
click node_train_script "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/a.py"
click node_predict_app "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/predict_app.py"
click node_model_file "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/disease_model.pkl"
click node_encoder_file "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/label_encoder.pkl"
click node_readme "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/README.md"
click node_predict_docs "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/README_predictor.txt"
click node_images_readme "https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/images/readme.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sensors,node_nano_fw,node_serial_link,node_nodemcu_fw,node_wifi_dashboard,node_sensor_stream toneBlue
class node_csv_data,node_train_script,node_predict_app,node_model_file,node_encoder_file,node_ml_output toneAmber
class node_readme,node_predict_docs,node_images_readme toneMint
```

## Components

### Embedded monitoring

Hardware sensing and wireless dashboard path

- **Vital sensors**: physical inputs · Heart rate, SpO₂, and temperature sources
- [Nano firmware](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nano_sensor_module.ino): Arduino sketch · Reads MAX30100 and LM35, packages sensor values · `nano_sensor_module.ino`
- **Serial link**: board bridge · Transfers readings from Nano to NodeMCU
- [Gateway firmware](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/nodemcu_health_monitor.ino): ESP8266 sketch · Receives sensor data and serves the wireless monitor · `nodemcu_health_monitor.ino`
- **Wi‑Fi dashboard**: live UI · Wireless presentation of real-time health readings
- **Live readings**: data stream · Real-time vital sign data produced by the embedded path

### Prediction pipeline

Offline training artifacts and Python inference

- [Health data](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/HEAD/Health%20data.csv): dataset · Training or source data for the ML subsystem · `Health data.csv`
- [Train script](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/a.py): Python script · Model-building or preprocessing logic · `a.py`
- [Predict app](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/predict_app.py): Python runtime · Loads the model and runs health prediction · `predict_app.py`
- [Disease model](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/disease_model.pkl): pickle artifact · Serialized trained classifier · `disease_model.pkl`
- [Label encoder](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/label_encoder.pkl): pickle artifact · Serialized class-label mapping · `label_encoder.pkl`
- **Prediction**: health class · Predicted disease or health category

### Documentation

README and supporting visuals

- [README](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/README.md): project docs · Top-level project overview · `README.md`
- [Predict notes](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/README_predictor.txt): support docs · ML-specific usage notes · `README_predictor.txt`
- [Images notes](https://github.com/suyashagnihotri/smart-health-monitoring-system-using-iot/blob/main/images/readme.md): support docs · Documentation for visual assets · `images/readme.md`

## Connections

- Vital sensors → Nano firmware: measure · Physical signals are sampled by the Nano firmware
- Nano firmware → Serial link: send · Arduino Nano forwards readings over serial
- Serial link → Gateway firmware: deliver · NodeMCU receives the sensor payload
- Gateway firmware → Wi‑Fi dashboard: serve · Gateway exposes live readings over Wi‑Fi
- Nano firmware → Live readings: emit · Firmware packages the live health readings
- Live readings → Gateway firmware: forward · Streaming data reaches the gateway boundary
- Health data → Train script: train · Dataset supports model building and experimentation
- Train script → Disease model: fit · Training produces the serialized classifier
- Train script → Label encoder: encode · Training persists the label mapping
- Disease model → Predict app: load · Inference app consumes the trained model artifact
- Label encoder → Predict app: load · Inference app uses the label encoding
- Predict app → Prediction: infer · Python runtime generates the predicted class
- README → Nano firmware: describes · Repository overview documents the embedded path
- README → Gateway firmware: describes · Repository overview documents the wireless gateway
- Predict notes → Predict app: documents · Predictor notes explain the Python inference flow
- Images notes → README: supports · Image documentation supplements the main README
