Today we will create a “Smart Health Monitoring Device” in this tutorial. For this, a PCB will also be designed so that we can use the device well. You will get all that in this tutorial for PCB design and how to get PCB easily. Our Smart Health Monitoring Device will measure SpO2 (percentage of oxygen in the blood) and heart rate in BPM (Beat Per Minute). This device work just like a wearable device. You all must be using very wearable devices and many smart watches are available in the today market. This device useful for individuals or athletes to monitor their heart rate and blood oxygen levels during a workout. Here interested part is that you can connect this device to an Android app Blynk that will record and regularly update the data for both SPO2 & BPM on the internet. So you need develop any android app. You can easily view your reports and results in your mobile easily with help of Blynk. So please read full tutorial, I hope you will really like this DIY project.
This project can be very useful for any individual as well as any patient. Because the oximeters available in the market are very expensive. And you can not even see the data of cheap oximeter from any app. So let’s get started to make MAX30100 Pulse Oximeter with ESP8266.
MAX30100 Pulse Oximeter
MAX30100 Pulse Oximeter is one of the most popular pulse oximeter sensor. Features of this sensors are avilable given below :
- MAX30100 Pulse Oximeter consumes very low power (operates from 1.8V and 3.3V)
- Ultra-Low Shutdown Current (0.7µA, typ)
- Fast Data Output Capability
How MAX30100 Pulse Oximeter works
You should know that we need infrared light to know the pulse rate. In this sensor has two LEDs, one emitting red light, another emitting infrared light. Both the red light and infrared light is used to measure oxygen levels in the blood.
When the heart pumps blood, there is an increase in oxygenated blood as a result of having more blood. As the heart relaxes, the volume of oxygenated blood also decreases. By knowing the time between the increase and decrease of oxygenated blood, the pulse rate is determined.
It turns out, oxygenated blood absorbs more infrared light and passes more red light while deoxygenated blood absorbs red light and passes more infrared light. This is the main function of the MAX30100: it reads the absorption levels for both light sources and stored them in a buffer that can be read via I2C.
For a better understanding, Please read this article https://www.dnatechindia.com/basic-working-pulse-oximeter-sensor.html
How to interface MAX30100 Pulse Oximeter with NodeMCU ESP8266
Here we will interface MAX30100 Pulse Oximeter with NodeMCU ESP8266 and I2C 0.96″ OLED Display. Both the MAX30100 & OLED Display has common I2C Pins. So connect their SDA pins to D2 & SCL pins to D1 of NodeMCU ESP8266 Board. The power supply required by OLED Display & NodeMCU is 3.3V. So connect their VCC terminal to 3.3V of NodeMCU. Please follow given below diagram.
PCB Designing for IoT Based Pulse Oximeter with NEXTPCB
This is very interesting part. Here the PCB for IoT Benabled Pulse Oximeter device has been designed in EasyEDA online PCB making tool. Many other tools available on Internet that you can use for your project. I am sharing two images of design.
The gerber file for the PCB is given below. You can download the gerber file and order the PCB online from NextPCB.
How to get PCB? Don’t worry. Simply Visit NextPCB and upload gerber file and order the PCB. NextPCB is one of the most experienced PCB manufacturers in world. They offer very good quality PCB at reasonable price.
Why Buy Printed Circuit Board From NextPCB?
- 24 hours production lead-time*
- 99% on-Time Shipping with great support
- Great quality approved by customers all over the world
- Trusted Experience
- A 24/7 non-stop production and assistance service
- Low Minimums
- Factory PCBs with most competitive advantages
- A Chinese expert in Electronic Manufacturing Service (EMS)
Whenever you get your PCB then you can solder all the necessary components as per circuit diagram and make the final product ready.
Setting up the Blynk App
Blynk is an application that runs over Android and IOS devices to control any IoT based application using Smartphones. It allows you to create your Graphical user interface for IoT application. Here we will set up the Blynk application to monitor BPM & SPO2 over Wi-Fi using NodeMCU ESP8266.
You can get Blynk Application from Google Play store. After signup Create a project.
Now click on “New Project”. In the pop up set the parameters like Project name, Board and connection type as shown in the photo above. For this MAX30100 ESP8266 project select the device as NodeMCU and connection type as Wi-Fi. Then click on Create.
Now click on the “+” sign to add the widgets. We need to read the value of BPM & SpO2. So select a pair of widget named Value Display & Gauge.
After dragging the widgets, set their parameters as shown in the image above. Click on Value Display and set the pin to “V7” & “V8“. Similarly, in gauge settings, set the output pin to “V7” & “V8”.
After the successful creation of the Project, go back to setting and click on Send Email. You will get an Authenticate ID on registered mail. Save the Authenticate ID for future reference.
Once the hardware setup is done, now we need to flash the code to the NodeMCU ESP8266-12E Board. You need some libraries. So please download and add libraries in Arduino IDE.
#define BLYNK_PRINT Serial
#define REPORTING_PERIOD_MS 1000
char auth = “############”; // You should get Auth Token in the Blynk App.
char ssid = “##########”; // Your WiFi credentials.
char pass = “#############”;
// Connections : SCL PIN – D1 , SDA PIN – D2 , INT PIN – D0
float BPM, SpO2;
uint32_t tsLastReport = 0;
const unsigned char bitmap  PROGMEM=
0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x18, 0x00, 0x0f, 0xe0, 0x7f, 0x00, 0x3f, 0xf9, 0xff, 0xc0,
0x7f, 0xf9, 0xff, 0xc0, 0x7f, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xf0,
0xff, 0xf7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0xff, 0xe7, 0xff, 0xf0, 0x7f, 0xdb, 0xff, 0xe0,
0x7f, 0x9b, 0xff, 0xe0, 0x00, 0x3b, 0xc0, 0x00, 0x3f, 0xf9, 0x9f, 0xc0, 0x3f, 0xfd, 0xbf, 0xc0,
0x1f, 0xfd, 0xbf, 0x80, 0x0f, 0xfd, 0x7f, 0x00, 0x07, 0xfe, 0x7e, 0x00, 0x03, 0xfe, 0xfc, 0x00,
0x01, 0xff, 0xf8, 0x00, 0x00, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0x3f, 0xc0, 0x00,
0x00, 0x0f, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
oled.drawBitmap( 60, 20, bitmap, 28, 28, 1);
oled.println(“Initializing pulse oximeter..”);
Blynk.begin(auth, ssid, pass);
Serial.print(“Initializing Pulse Oximeter..”);
// The default current for the IR LED is 50mA and it could be changed by uncommenting the following line.
BPM = pox.getHeartRate();
SpO2 = pox.getSpO2();
if (millis() – tsLastReport > REPORTING_PERIOD_MS)
Serial.print(” bpm / SpO2:”);
tsLastReport = millis();
Once the code is uploaded, you can open serial monitor and see the following as BPM & SpO2 values are displayed after NodeMCU connects to wifi.
On the Blynk App, the BPM & SpO2 value is uploaded after a second and you can see a change in gauge and display parameters.
MAX30100 Not Working Troubleshooting
If your MAX30100 Module is not working, then it might not work as it has a serious design problem. The MAX30100 IC uses 1.8V for VDD and this particular module uses two regulators to achieve this voltage. Nothing wrong with that. However, if you look closely, the SCL and SDA pins are pulled-up via the 4.7k ohm resistors to 1.8V! This means it won’t work well with microcontrollers with higher logic levels.
Please visit this for solution : https://github.com/oxullo/Arduino-MAX30100/issues/51
Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.