G12: Smart Body Composition Analyzer - shalan/CSCE4301-WiKi GitHub Wiki
BioScale – Smart Body Composition Analyzer
| Name | GitHub |
|---|---|
| Mostafa Elshamy | https://github.com/MoShamy |
| Ahmed Elkhodary | https://github.com/aae121 |
| Kareem Sayed | https://github.com/kareems395 |
GitHub Repo: https://github.com/MoShamy/Body-Composition
1. The Proposal
Abstract / Elevator Pitch
Understanding body composition is essential for assessing overall health and achieving fitness goals. Traditional home scales provide only weight, which is insufficient for meaningful health insights.
BioScale is a smart body composition analyzer designed to estimate key physiological metrics including Body Fat Percentage, Total Body Water, Skeletal Muscle Mass, and BMI.
The system is built around an ESP32 microcontroller. It uses a load cell (via HX711) to measure weight, and a host-based interface to process and display results. A web-based GUI provides real-time visualization, historical tracking, and trend analysis.
The architecture is modular, allowing integration of additional sensing subsystems such as impedance measurement and automated height detection in later stages.
Project Objectives & Scope
Minimum Viable Product
- Calibrated weight acquisition subsystem using a load cell + HX711
- Host-based user interface for entering age and sex
- Embedded data transmission from ESP32 to GUI
- Implementation of body composition calculations:
- Body Fat %
- Fat Mass
- Lean Body Mass
- Skeletal Muscle Mass
- Total Body Water
- BMI
- Real-time visualization of results on a laptop interface
Stretch Goals
- Automated height measurement using ultrasonic sensor
- Integration of impedance-based body composition sensing
- Historical tracking and trend visualization
- Fully integrated real-time system
2. System Architecture
2.1 High-Level Block Diagram
(Insert updated diagram here with impedance subsystem removed)
2.2 Subsystem Breakdown (Updated)
The system consists of three primary subsystems:
Weight Measurement Subsystem
A load cell interfaced with the HX711 ADC module is used to measure weight. The ESP32 reads digital values and processes them into stable measurements.
User Interface & Data Processing Subsystem
A web-based GUI running on a laptop processes incoming data and computes:
- Body Fat %
- Total Body Water
- Skeletal Muscle Mass
- BMI
The interface displays results and tracks historical data.
Communication & Control Subsystem
The ESP32 handles sensor acquisition and transmits structured JSON data to the GUI. The system is designed using FreeRTOS for task separation.
Note:
The impedance measurement subsystem is currently under redesign due to component availability constraints and will be integrated later.
3. Hardware Design
Component Selection
- ESP32 Development Board
- Load Cell (50–100kg)
- HX711 ADC Module
- (Planned) Ultrasonic Sensor
Schematics & Wiring
- Load Cell → HX711 → ESP32
- HX711 DT → GPIO
- HX711 SCK → GPIO
(Add wiring diagram or breadboard image here)
Bill of Materials (BOM)
| Component | Quantity |
|---|---|
| ESP32 | 1 |
| Load Cell | 1 |
| HX711 | 1 |
| Wires / Breadboard | Several |
Power Budget
System powered via USB (5V). Current consumption remains within ESP32 limits.
4. Software Implementation
Software Architecture
The system uses:
- ESP32 firmware (Arduino framework on PlatformIO)
- Web-based GUI (HTML, CSS, JavaScript)
Implementation Progress
- Developed full GUI with modern mobile-friendly design
- Implemented body composition calculations
- Implemented JSON data parsing pipeline
- Added real-time UI updates
- Implemented local storage for historical tracking
- Added trend charts for:
- Weight
- Body Fat %
- Muscle Mass
Key Algorithms
The system computes:
- Total Body Water (TBW)
- Fat-Free Mass (FFM)
- Fat Mass (FM)
- Body Fat %
- Skeletal Muscle Mass
- BMI
Development Environment
- VS Code + PlatformIO
- Arduino framework (ESP32)
- Google Chrome (Web Bluetooth testing)
5. Testing, Validation & Debugging
Unit Testing
- Load cell and HX711 tested independently
- Serial output verified
Integration Testing
- Verified data processing pipeline using simulated inputs
- Confirmed correct calculation outputs
- Verified UI updates and chart rendering
Challenges & Solutions
AD5933 Unavailability
Redesigned impedance subsystem for future implementation.
iPhone BLE Limitations
Switched testing to laptop Chrome.
System Complexity
Adopted staged development: Software → Communication → Sensors → Integration
6. Results & Demonstration
Current Prototype
- Weight measurement subsystem implemented and tested
- GUI fully functional
- Data processing pipeline operational
Video Demonstration
Google Drive link: https://drive.google.com/file/d/1HqF47_nHq5qe8YSdN3K1U7s6HwfEBi2O/view?usp=sharing
Demonstrated Functionality
- Real-time weight measurement
- Data visualization
- Historical tracking and trend analysis
7. Project Management
7.1 Division of Labor
- Hardware (ESP32 + Sensors): Team Member 1
- Software (GUI + Processing): Team Member 2
- Integration & Testing: Team Member 3
7.2 Timeline
| Milestone | Status |
|---|---|
| Proposal | Completed |
| GUI Development | Completed |
| Weight System | Completed |
| Full Integration | In Progress |
8. Appendices & References
Source Code Repository
https://github.com/MoShamy/Body-Composition
References
- ESP32 Documentation
- HX711 Datasheet
- Body Composition Research Papers