A simulation-based smart health monitoring project that reads heart rate ❤️, oxygen level 🫁, and temperature 🌡️ using ESP32 with virtual sensor inputs. The project collects sensor data, saves it into a CSV file, and uses Python machine learning models to classify the patient status as healthy or risky.
This project is designed as a health monitoring prototype.
It uses:
- Potentiometer 1 for simulated heart rate input
- Potentiometer 2 for simulated oxygen input
- NTC thermistor for temperature
- OLED display for live values
- Buzzer for alert generation
The collected data is stored in CSV format and can be used to train and compare multiple machine learning models.
- Real-time simulated health sensor monitoring
- OLED display for live readings
- Buzzer alert for abnormal readings
- CSV data collection for machine learning
- Multiple ML model testing and comparison
- Easy to extend into a full IoT + ML project
- ESP32
- 2 Potentiometers
- NTC Thermistor
- OLED Display (SSD1306)
- Buzzer
- Wokwi / ESP32 Simulator
- Arduino IDE / PlatformIO
- Python
- Pandas
- NumPy
- Scikit-learn
- Matplotlib
- Streamlit
- Simulate sensor readings in Wokwi.
- ESP32 reads heart rate, oxygen, and temperature values.
- Data is printed through Serial Monitor.
- Python script collects the serial data and saves it into
data.csv. - Machine learning models are trained on the CSV file.
- Best model is selected and used for prediction.
- Streamlit dashboard shows results.
Smart Health Monitoring/
│
├── src/
│ └── main.cpp
├── collect_data.py
├── json_to_excel.py
├── diagram.json
├── wokwi.toml
├── data.csv
└── README.md- Load the project in Wokwi or your ESP32 simulator.
- Make sure the circuit is connected properly.
- Use
src/main.cppfor the simulation logic. - Check readings in the Serial Monitor.
- Run
collect_data.pyto capture serial data. - Save the output into
data.csv.
- Use Python to load the CSV.
- Try multiple models such as:
- Logistic Regression
- Decision Tree
- Random Forest
- SVM
- KNN
- Naive Bayes
- Use Streamlit to create a simple interface for model selection and prediction.
The CSV file contains readings like:
temperaturepot1pot2
Example:
temperature,pot1,pot2,label
25.5,620,304,healhty
33.5,1185,789,risky
18.9,4095,3731,criticalYou can compare multiple models and allow the user to select one:
- Logistic Regression
- Decision Tree
- Random Forest
- SVM
- KNN
- Naive Bayes
- Gradient Boosting
This project can be presented as a:
- Smart health monitoring prototype
- Simulated patient monitoring system
- ML-based abnormal condition detector
This project uses simulated sensor data, not medical-grade sensor data. It is built for learning, prototyping, and portfolio demonstration.
- Add real sensors later
- Add live dashboard using Streamlit
- Add model comparison chart
- Add confusion matrix and performance metrics
- Deploy the app online
- Connect real IoT hardware
Created as a Python + ESP32 + ML health monitoring project for learning purpose.