How to make a WiFi Smart Oximeter with an Arduino ESP32 and MAX30102

Components and Supplies

Hardware

Max30102 Pulse Oximeter
Esp32 NodeMCU Board
Jumper Wires
Breadboard

Software

Arduino
Blynk

In this article, I’ll show you how to make your own WiFi-based smart oximeter with the MAX30102 and ESP32.

The project is basic and straightforward to construct.

Only two components are required: an ESP32 and a MAX30102 Sensor.

Simply place the sensor on your fingertip and within seconds, you’ll be able to see SPO2 (oxygen saturation) and Heart Rate (BPM) readings on your smartphone.

The Arduino core will be used to programme the ESP32 board for this project.

You can use the Arduino IDE, Visual Studio Code with PlatformIO, or any other IDE that supports PlatformIO.

Overview of the Project

What is the Process?

The raw MAX30102 sensor values are read using ESP32 — IR and Red light are delivered and read.

The SPO2 and Heartrate are calculated by ESP32 using these raw numbers.

Blynk is used to send the final readings to the phone for display.

The software may be adjusted to suit your needs.

If necessary, past data can be stored, logged, and retrieved through the app.

Prerequisites

Make sure you have the following setup before starting this tutorial:

1. Required components

You’ll need the following items to complete this project:

a) MAX30102 Pulse Oximeter: Any MAX30102 sensor will work, but make sure the sensor and I2C Signals are operating at the proper voltages.

Many low-quality boards do not conform to Maxims specifications, resulting in erroneous values and the possibility of failure.

MAX30102 Pulse Oximeter has shown to be the most reliable sensor.
During I2C communication, other sensors fail or have wrong voltage on the communication lines.

b) ESP32 NodeMCU Board: Only use ESP32.
Due to memory constraints, the Arduino UNO will not be able to perform the Maxim Algorithm.

c) Jumper wires: these are used to link the ESP32 to the sensor.

  1. Add-on for Arduino IDE and ESP32 Boards

We’ll use the Arduino IDE to programme the ESP32.
As a result, the Arduino IDE must have the ESP32 add-on installed.
For more information, see this article:
ESP32 Board Installation with Arduino IDE (Windows, Mac OS X, Linux)

  1. Public libraries

Install the required libraries on your Arduino IDE to complete this project:

a) MAX3010x Sensor Library SparkFun
(Install available on GitHub and Arduino Library Manager)

b) Blynk (Install available on Arduino Library Manager and also on GitHub)

2. Add-on for Arduino IDE and ESP32 Boards

We’ll use the Arduino IDE to programme the ESP32.
As a result, the Arduino IDE must have the ESP32 add-on installed.

For more information, see this article:
ESP32 Board Installation with Arduino IDE (Windows, Mac OS X, Linux)

3. Public libraries

Install the required libraries on your Arduino IDE to complete this project:

a) MAX3010x Sensor Library SparkFun
(Install available on GitHub and Arduino Library Manager)

b) Blynk (Install available on Arduino Library Manager and also on GitHub)

4. Blynk Application

Blynk app installed on a smartphone

The Arduino Library Manager may be used to install the first library.
Search for the library name in Sketch > Include Library > Manage Libraries.

Connections

The connections are plain and easy –

Developing the app

The Blynk Platform will be used to construct an app that will retrieve data from the ESP32 and show it on the smartphone.

The stages involved in developing the app —

  1. On your phone, make a new Blynk app.
  2. Create two Gauge and two Labeled Value Widgets, one for each Virtual Pin V3 and V4.
    You can format and label the data as needed.
    V3 is used for BPM and V4 is used for SPO2.

The pulse measurements will be sent to the V3 pin, while the SPO2 values will be sent to the V4 pins.
You’ll obtain a Blynk Auth Token when you create the app.
Make a note of it because you’ll need it later when programming the ESP32.

The Code in Action

Let’s have a look at the pertinent sections of this code.

In the auth[] character array, type your Blynk app auth key.
On the Blynk Server, this is used to identify your ESP32 and App.
After building the Blynk app in the previous stage, you will obtain the auth key.

        
char auth[] = " "; // You should get Auth Token in the Blynk App.
   

For the ESP32 to connect to your local wifi network, provide your network credentials in the following variables:

char ssid[] = " ";    // Enter your WiFi SSID here
char pass[] = " ";	// Enter your WiFi Password here    

Demonstration

After you’ve uploaded the application, you should see values in your Blynk App.
The BPM and SPO2 readings will appear instantly after you attach the sensor to your fingertip.
When there’s a change, notice how the readings update very instantly.

Contribute to the Society, But never Follow the Society

KP

“Live in present, But don’t underestimate the past and the future, be clear about your wants, bcas today no one uses landline” – KP

Self Eccentric

KP

Helping Hands.

About the author

pondabrothers

View all posts

Leave a Reply

Your email address will not be published.