DIY MAX30102 Heart Health Monitor Using ESP8266

by Amazing11 in Circuits > Arduino

48 Views, 0 Favorites, 0 Comments

DIY MAX30102 Heart Health Monitor Using ESP8266

DIY MAX30102 Heart Health Monitor Using ESP8266
20241116_092644.jpg

Creating your own heart health monitor with an ESP8266 is a fantastic way to dive into DIY electronics while enhancing your wellness journey. This compact device allows you to monitor key indicators of heart health, including your heart rate (BPM) and blood oxygen levels (SpO2), all displayed in real-time on a small screen. By tracking these metrics, you gain valuable insights into your cardiovascular health, making it a unique tool for personal wellness.

The project isn’t just functional—it’s interactive. It includes a visual breathing monitor that responds to your inhale and exhale patterns, with colours changing to reflect each breath cycle. This breathing feature, along with the heart rate display, adds a mindful, meditative element to the monitor, helping you observe your breathing and its impact on your heart health.

Whether you're a beginner in electronics or an experienced maker, this heart monitor project with ESP8266 is a rewarding experience. Not only will it expand your tech skills, but it also provides a portable wellness tool that can help you stay conscious of your heart health in real-time.

Keep in mind, this is a prototype intended for personal wellness insights, suitable for general daily check-ups for healthy individuals. However, if you have a serious cardiovascular condition, it’s important not to rely on this as a primary monitoring tool, as the readings may occasionally differ from clinical values. Please use it as a supplementary device rather than a substitute for professional medical equipment.

Supplies

IMG_4055.JPG

1x ESP8266 NodeMCU Module

1x MAX30102 Heart Rate Sensor

1x1.8 Inch ST7735 LCD Display (In future, you can update with the other displays.)

1x Neopixel LED (This is not the serious component, it’s just for heart beat visualization, you can add this or not it’s your choice.)

1x 470uF Capacitor 25V(for smooth the voltage and reduce noise)

1x 100nF Capacitor(for smooth the voltage and reduce noise)

How This Circuit Works

DALL·E 2024-11-16 11.32.24 - A clear and simple illustration of the MAX30102 heart rate and SpO2 sensor in action. The image shows a finger placed on the sensor, with red and infr.jpg

(This is AI Based image and not so much accurate or detailed)

The heart of this DIY heart health monitor is the MAX30105 sensor, which is specially designed to measure heart rate and SpO2 (blood oxygen saturation). This sensor uses photo plethysmography (PPG) to detect changes in blood volume by shining LED light (red, infrared, and green) through your skin and measuring how much light is absorbed. Variations in light absorption correspond to heartbeats, which allows the sensor to calculate both your pulse and SpO2 levels. The ESP8266 reads these measurements, processes the data, and displays the information on a screen.

In the code, the checkForBeat() function monitors infrared light levels from the sensor, detecting peaks that signal heartbeats. Each peak is processed to calculate beats per minute (BPM), while a simple SpO2 formula computes oxygen levels based on the ratio of red to infrared light absorption. The ESP8266 also updates the display with this data, using the added memory to ensure smooth, accurate readings. This combination of hardware and code creates a functional and compact heart health monitor prototype, providing real-time feedback on your pulse and oxygen levels in a user-friendly display.

Why I Chose ESP8266 Over Arduino Boards

The ESP8266 offers a significant advantage over standard Arduino boards, especially when it comes to memory management and handling more complex code. In this heart health monitor project, the sensor readings, display updates, and data buffering all demand substantial memory. With limited memory on most Arduino boards, adding code for continuous monitoring, displaying BPM and SpO2 values, and rendering graphics would quickly exceed their capabilities, leading to slower performance or even crashes.

The ESP8266, however, has a larger memory capacity and can handle this more demanding setup with ease. This extra memory allows for smoother data processing and larger buffers, meaning it can store and update sensor values more effectively, which is crucial for maintaining accurate real-time readings. Additionally, the ESP8266’s support for Wi-Fi makes it ideal for future upgrades, like sending health data to a smartphone app or cloud storage. Overall, the ESP8266 is a better choice for this project, balancing memory needs and enabling additional features beyond what typical Arduino boards can handle.

Connections or Circuit Diagram

ESP8266+Heart+Rste+Monitor_bb.jpg

Setting up the ESP8266 Heart Health Monitor involves a few simple connections between the ESP8266, MAX30105 sensor, and the display. The MAX30105 sensor communicates with the ESP8266 via I2C, requiring only two pins for data transfer, which keeps the wiring straightforward. The display is also connected to the ESP8266 using specific data pins, allowing the screen to display real-time heart rate and SpO2 readings effectively.

In this setup:

  1. 3V3 and GND provide the power and ground connections to the sensor and display.
  2. I2C Lines (D1 and D2) connect the MAX30105 sensor for heart rate and SpO2 data.
  3. SPI Lines (D5, D7, D8 and D4) control the display to show the readings.

The simplicity of these connections makes this project accessible to beginners, while the ESP8266’s processing power and memory allow it to handle real-time calculations and display updates efficiently.

Code

Copy or Download the code from here- Elecotechoz

The code for this DIY Heart Health Monitor with ESP8266 gathers heart rate (BPM) and SpO2 data from the MAX30105 sensor, processes the readings, and displays them on the screen. It starts by initializing the sensor and display, then enters a continuous loop where it checks for heartbeats, calculates SpO2 levels, and shows the results in real time. Each heartbeat triggers a visual pulse, and the display updates with BPM, SpO2, and indicators for breathing and heart status.

To upload the code, open the Arduino IDE, select ESP8266 as the board, choose the correct COM port, and copy-paste the code. After uploading, the device should be ready to monitor and display live heart health data in real-time.

Conclusion

IMG_4116.PNG

Congratulations! You've now successfully built a heart rate and SpO2 monitoring system using the MAX30102 sensor and an ST7735 TFT display. This project not only provides real-time health monitoring but also includes an interactive Neopixel heartbeat animation, enhancing the visual appeal and user experience.

The versatility of this setup opens doors for exciting upgrades:

  1. WI-FI Integration: Send the BPM and SpO2 data to a mobile app for remote health tracking.
  2. Battery Operability: Make the device portable by incorporating a rechargeable battery.
  3. Data Logging: Store the readings over time on an SD card for trend analysis.
  4. Advanced Visuals: Upgrade to a larger display or add touch functionality for easier interaction.
  5. Health Alerts: Integrate sound or vibration alerts for abnormal readings.

With further refinements, this project could even be the foundation for a wearable health tracker. Feel free to experiment and expand the functionality as your skills grow. If you found this tutorial helpful, don’t forget to share your creations and improvements!

Happy making! 😊