Design and Evaluation of an IoT-Enabled ESP32 Photoplethysmography Monitor for Heart Rate and SpOCC Muhhammad Iyan Putra Pratama1. Luthfan Hadi Pramono2. Adi Kurniawan Saputro1. Dian Neipa Purnamasari1. Muttaqin Hardiwansyah1 Teknik Elektro. Fakultas Teknik. Universitas Trunojoyo Madura Computer Engineering Department. Faculty of Information Technology. Universitas Teknologi Digital Indonesia E-mail: iyan. pratama@trunojoyo. id, luthfanhp@utdi. id , adi. kurniawan@trunojoyo. neipa@trunojoyo. id, muttaqin. hardiwansyah@trunojoyo. AbstractAi Cardiovascular disease (CVD) motivates affordable, continuous monitoring of heart rate and peripheral oxygen saturation (SpOCC). We present a singleMCU device using an ESP32 and MAX30102 photoplethysmography sensor that acquires heart rate and SpOCC and streams data to a ThingSpeak dashboard. Performance was evaluated over four consecutive days under normal conditions, with five paired measurements per day against a clinically approved fingertip oximeter. Using all paired observations, the proposed design achieved low errors with RMSE = 0. 84 bpm for heart rate and 0. percentage points for SpOCC, the maximum absolute error did not exceed 1 bpm or 1 pp, respectively. These results demonstrate end-to-end operation and good agreement with reference in resting conditions. Key wordsAiESP32. MAX30102. Heart rate. SpO2. Internet of Things. ThingSpeak. INTRODUCTION CVD is the leading cause of global mortality, accounting for approximately 17. 9 million deaths annually . Early and continuous monitoring of heart health parameters such as heart rate and peripheral oxygen saturation (SpOCC) is critical for timely detection and effective management of CVD. However, . ECGs, and stand-alone pulse oximeter. are often expensive, bulky, and confined to clinical settings, limiting access in resourceconstrained communities. Advances in the Internet of Things (IoT) and semiconductor technologies have enabled portable and affordable health-monitoring solutions. Low cost microcontroller families and an expanding ecosystem of sensors have lowered barriers to prototyping and A commonly used sensing modality is photoplethysmography (PPG). In parallel, cloudconnected IoT platforms . ThingSpea. facilitate data storage, analysis, and real-time visualization for both healthcare providers and patients. Prior work has explored IoT-based vital-sign monitoring, but several gaps remain. For example. Esmaeiliazad et al. describe an earlobe pulse-oximeter ISSN 2615-5788 Print . JURNAL TEKNIK ELEKTRO DAN KOMPUTER TRIAC https://journal. id/triac using the MAX30102 with an Arduino Uno and a 16y2 LCD, providing wiring details yet omitting experimental protocols and results. f, reliability claims are unsupported . Other proposed designs . integrate the MAX30102 for heart-rate monitoring but partition processing and connectivity across two microcontrollers . ne for sensing and another for WiF. , increasing cost and system complexity without clear performance benefits. Additional work . present patient-tracking systems using the MAX30102, facing similar cost-effectiveness concerns due to hardware choices. Apart from that, the proposed designs from the author . for heart rate and temperature monitoring using the DS18B20 and SEN11547 pulse-rate sensor, while attractive for simplicity, reliance on low-accuracy pulse-rate sensors raises questions about measurement validity. Moreover, several works has been done due to determining the quality of the heart rate monitoring In previous studies . MAX3010x modules . MAX30100/MAX30. demonstrated lower error than analog channel-based heart rate sensors such as the SEN-xx under normal This advantage stems primarily from the integrated acquisition chain, red LED driver, photodiode, ambient-light cancellation, high-resolution ADC, and digital sample averaging that suppresses noise floor and ambient light artifacts, resulting in more stable PPG signals. Based on these considerations, this study utilized the MAX3010x family as the primary sensor for heart rate and SpOCC To address these limitations, this work proposes a low-cost. IoT-enabled heart rate and SpOCC monitoring system that uses a single ESP32 microcontroller and a MAX30102 sensor. The ESP32 consolidates sensing and Wi-Fi connectivity, reducing bill of materials and simplifying firmware. The main contributions are: Reliability: A validated PPG sensing chain and processing pipeline targeting improved Vol 12 No. 2 @ 2025 Muhammad Iyan Putra Pratama. Luthfan Hadi Pramono. Adi Kurniawan Saputro. Dian Neipa Purnamasari. Muttaqin Hardiwansyah accuracy and stability for heart rate and SpOCC Connectivity: Seamless server integration via the ESP32Aos on-chip Wi-Fi for real-time upload and visualization. Cost-effectiveness: single-MCU architecture that lowers component count and overall system cost compared with dual-MCU Reproducibility: Open hardware/software experimental protocol against a clinical-grade reference device. II. METHODOLOGY Hardware Design Figure. MAX30102 basic structure As mentioned in the previous section, the proposed design utilizes an ESP32 microcontroller due to its onboard Wi-Fi module, eliminating the need for an external network module. The ESP32 used in this study is the Sed XIAO ESP32, which has compact Furthermore, the Sed XIAO ESP32 includes an onboard battery charger chip, simplifying battery integration without requiring additional external modules. The sensor employed is the MAX30102, a noninvasive PPG sensor. PPG is an optical technology used to measure heart rate by detecting light reflections from blood vessels beneath the skin . PPG sensors typically consist of two main components: an LED . ommonly green, red, or infrare. and a photodiode. As illustrated in Figure. when the LED illuminates the skin, the reflected light is captured by the photodiode. Changes in light intensity, caused by increased blood volume during a heart rate, serve as the basis for heart rate calculations by the PPG sensor. Additionally, the MAX30102 sensor features noisecancelling capabilities, improving the accuracy of sensor readings. Apart from that, by utilizing an I2C interface, providing superior data quality compared to an analog sensor. The choice of the MAX30102 sensor was also driven by the ESP32Aos limitations in processing analog signals. For the server side. ThingSpeak was selected due to its ease of access, real-time visualization, and efficient data storage, enhancing accessibility for healthcare providers and Beside utilizing ThingSpeak, the proposed design also employed an Organic Light Emitting Diode (OLED) to show the result of measurement directly to the user. The system architecture is illustrated in Figure 2. ISSN 2615-5788 Print . JURNAL TEKNIK ELEKTRO DAN KOMPUTER TRIAC https://journal. id/triac Figure. System architecture Firmware Design The proposed design operates in a standby mode using the ESP32Aos deep sleep feature, waiting for the sensor to detect a finger. During this waiting period, the entire system enters sleep mode to minimize power Upon detecting a finger via an external interrupt from the sensor, the system switches to active In active mode, the system reads heart rate data, and after a stable reading is achieved within a specified time frame, the measured heart rate and SpO2 values are displayed on an Organic Light Emitting Diode (OLED) screen. Simultaneously, the system activates its Wi-Fi network to transmit data to the ThingSpeak server. After successful data transmission, the system returns to deep sleep mode, repeating the cycle as needed. The initial condition of the proposed design is to remain in deep sleep mode, leveraging the ESP32Aos deep sleep feature for efficiency. The system Vol 12 No. 2 @ 2025 Muhammad Iyan Putra Pratama. Luthfan Hadi Pramono. Adi Kurniawan Saputro. Dian Neipa Purnamasari. Page 68-72 Muttaqin Hardiwansyah transitions to active mode via an external wake-up triggered by finger detection. In active mode, the system begins by reading heart rate and SpO2 data. Once the readings stabilize within a set time frame, the average heart rate and SpO2 values are displayed on the OLED screen. The system then activates its Wi-Fi network and connects to a router. Upon successful connection, data is transmitted to the ThingSpeak If the data transmission is successful . onfirmed by a success respons. , the system returns to deep sleep mode. This process repeats to ensure efficiency and reliability. The system is also equipped to handle two primary issues: Wi-Fi connection failures and data transmission If either issue occurs, the system retries up to three times. If unsuccessful after three attempts, an error message is displayed on the OLED screen, and the system returns to deep sleep mode. The workflow is illustrated in Figure 3. On the ThingSpeak server, received heart rate and SpO2 data are displayed as graphs to facilitate interpretation by medical professionals and users. Accuracy was measured using the rootmean-square error (RMSE). Oo Oc( . Where is the total number of samples, represents the reference value obtained from the conventional pulse oximeter, which is from the conventional pulse oximeter, and denotes the output value of the proposed design. Proposed Design Test Result Figure. 4 shows the test results of the proposed design when reading heart rate and oxygen saturation obtained with the proposed ESP32AeMAX30100 Measurements were collected in a reflective PPG configuration with the fingertip placed in direct contact with the sensor window. Stable performance requires proper finger alignment, moderate and consistent pressure, and protection from ambient light. Excessive pressure . indering perfusio. or insufficient contact . ausing movement and light leakag. degrades signal quality. All tests were performed after achieving a stable result. Figure. Proposed Design Test Result Figure. Flowchart of the system ThingSpeak Integration Test Result i. RESULT AND DISCUSSION We evaluated the proposed design by measuring heart rate (BPM) and peripheral oxygen saturation (SpOCC) for four consecutive days. On each day, five measurements were taken at fixed intervals under normal conditions. Testing took place in two phases: end-to-end integration testing before cloud transmission, and . functional testing with data streamed to ThingSpeak. A clinical-grade pulse oximeter served as the reference device. For each measurement, paired readings . eference vs. proposed desig. were ISSN 2615-5788 Print . JURNAL TEKNIK ELEKTRO DAN KOMPUTER TRIAC https://journal. id/triac Figure. Heart Rate Test Result Vol 12 No. 2 @ 2025 Muhammad Iyan Putra Pratama. Luthfan Hadi Pramono. Adi Kurniawan Saputro. Dian Neipa Purnamasari. Page 68-72 Muttaqin Hardiwansyah Heart Rate BPM 1 2 3 4 5 6 7 8 9 1011121314151617181920 Data Proposed Design Ref Device Figure. Oxygen Saturation Test Result Figure. Oxygen Saturation Test Result This test focuses on the system's ability to send data to the ThingSpeak server. The ThingSpeak server is used to enable remote monitoring of heart rate and peripheral oxygen saturation. Data are rendered on the ThingSpeak dashboard as line charts. For visualization, the dashboard in our setup is conFig. d to display the last 20 points, though this display window is configurable and does not limit the underlying dataset exported for analysis. Regarding throughput, free ThingSpeak channels enforce a minimum write interval of 15 seconds per channel while the licensed plans allow faster updates down to 1 second. These limits are defined by ThingSpeakAos service policies and should be considered when interpreting Aireal-timeAn monitoring in this work. Furthermore. Figure 5. Showing the result of heart rate monitoring while the Figure 6 Shows SpO2 monitoring result. The data presented on the ThingSpeak end-to-end The device successfully streams heart rate (BPM) and SpOCC readings to the cloud and renders them as live charts. This demonstrates functional data upload and visualization. Data Comparison This test compared the proposed device against a medical-grade pulse-rate and oxygen-saturation meter. The device streamed the same data to ThingSpeak as used for analysis. Across four consecutive days, five paired measurements per day were collected under resting conditions for each metric, yielding 20 paired observations per metric. Under resting conditions, the device achieved low error relative to the reference. Using all paired data, the root-mean-square error (RMSE) was 0. 84 BPM for heart rate and 0. 59% for SpOCC. The maximum absolute error across all samples did not exceed A1 bpm (HR) or 1% (SpOCC). These results indicate good agreement with reference within the tested conditions. ISSN 2615-5788 Print . JURNAL TEKNIK ELEKTRO DAN KOMPUTER TRIAC https://journal. id/triac SpOCC (%) SpOCC Data Proposed Design Ref Device Figure. Oxygen Saturation Test Result IV. CONCLUSION The proposed device successfully measures heart rate and oxygen saturation while simultaneously transmitting the same data to the ThingSpeak dashboard for live visualization. Compared to a clinical-grade reference oximeter, the device achieves low error under normal conditions. These findings demonstrate proper end-to-end operation. However, further work is needed to strengthen the mechanical enclosure to improve optical shielding, finger alignment, and pressure consistency, as well as to quantify telemetry Quality of Service (QoS) latency, completeness, jitter, and packet loss so that "real-time monitoring" is driven by measurements, rather than REFERENCES