Smart Health Monitoring Device | PCB | Pulse Oximeter | ESP8266 | Blynk
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.
Download: Gerber File MAX301000 Pulse Oximeter ESP8266
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
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.
Recommended: https://iotbyhvm.ooo/blynk-tutorials-blynk-iot-platform-how-to-use-blynk/
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.
Source Code/Program
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.
The library files can be downloaded from here:
1. Arduino MAX30100 Library
2. OkaOLED Library
3. Adafruit GFX Library
4. BlynkSimpleEsp8266.h Library
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
#include <Wire.h>
#include “MAX30100_PulseOximeter.h”
#define BLYNK_PRINT Serial
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include “Wire.h”
#include “Adafruit_GFX.h”
#include “OakOLED.h”
#define REPORTING_PERIOD_MS 1000
OakOLED oled;
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
PulseOximeter pox;
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
};
void onBeatDetected()
{
Serial.println(“Beat Detected!”);
oled.drawBitmap( 60, 20, bitmap, 28, 28, 1);
oled.display();
}
void setup()
{
Serial.begin(115200);
oled.begin();
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println(“Initializing pulse oximeter..”);
oled.display();
pinMode(16, OUTPUT);
Blynk.begin(auth, ssid, pass);
Serial.print(“Initializing Pulse Oximeter..”);
if (!pox.begin())
{
Serial.println(“FAILED”);
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println(“FAILED”);
oled.display();
for(;;);
}
else
{
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println(“SUCCESS”);
oled.display();
Serial.println(“SUCCESS”);
pox.setOnBeatDetectedCallback(onBeatDetected);
}
// The default current for the IR LED is 50mA and it could be changed by uncommenting the following line.
//pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);
}
void loop()
{
pox.update();
Blynk.run();
BPM = pox.getHeartRate();
SpO2 = pox.getSpO2();
if (millis() – tsLastReport > REPORTING_PERIOD_MS)
{
Serial.print(“Heart rate:”);
Serial.print(BPM);
Serial.print(” bpm / SpO2:”);
Serial.print(SpO2);
Serial.println(” %”);
Blynk.virtualWrite(V7, BPM);
Blynk.virtualWrite(V8, SpO2);
oled.clearDisplay();
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0,16);
oled.println(pox.getHeartRate());
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 0);
oled.println(“Heart BPM”);
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0, 30);
oled.println(“Spo2”);
oled.setTextSize(1);
oled.setTextColor(1);
oled.setCursor(0,45);
oled.println(pox.getSpO2());
oled.display();
tsLastReport = millis();
}
}
|
Output
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
You may also like : What Are 10k Resistors and Their Advantages?
Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.
Pingback: A Guide to Different Solder Mask Colors - IoTbyHVM - Bits & Bytes of IoT
Pingback: 10 Cloud-based PCB Designing Tools for Remote Work - IoTbyHVM - Bits & Bytes of IoT
Pingback: ZimaBoard Raspberry-Pi alternative - Versatile X86 single board all-rounder — APalgorithm.com
Pingback: PiCore (Tiny Core) Linux on Raspbeery Pi — APalgorithm.com
Pingback: Build Kernel on ROCK 5B - IoTbyHVM - Bits & Bytes of IoT
Pingback: Raspberry Pi Pico - IoTbyHVM - Bits & Bytes of IoT
Pingback: Understanding AI's Role in Search Engines | How AI and SEO are related
Pingback: Raspberry Pi released 8GB Raspberry Pi 4 — OnionLinux
Pingback: How is AI in IOT(Internet of Things)? - CompileIoT