During the COVID-19 Health checkup is a measure issue we need to visit the checkpoint center for our checkup and wile the process of visiting it was a great chance to spread of infection and virus spread either by us to other doctors and people at hospital or by others to us. So here we need the technology that get the basic health reading from our body and send the doctor remotely so that doctors can do checkup remotely without coming in contact infected person. This technology enables us to do our checkup remotely while we are living in home quarantined .
Such a system also help us in RURAL HEALTH Checkup as there is very few doctors available in village area and requirements for health checkup is high in the time of COVID-19 so this system enables doctors to do checkup from any were without physically presenting there and also help in speeding up the process of checkup because it eliminates the time of traveling to checkup point .
What Our Device Do?
It takes the real time data from our body like SPO2, Pulse rate (We an also add the temp sensor to it to get temperature )and shows that data in real time on OLED display attached to it and along with this it also send the data to device cloud by which the doctors can access the patients health data using the URL in real time and can monitor the health and do checkup. This device is also capable of BLE MESH so this can be attached to every patients in hospital and connect all of them on mesh network so that all the patients can be monitored on a single computer.
Getting Started for Project.
First we need to buy all the components and then we have to open the particle account to do setup our Argon MESH device. To add the Device in mesh network follow the Particle mesh Instructions on the Particle website.
To create the particle account go tho particle website and signup if you are new otherwise you can login into it .
Next add the device to to your network . To add Argon device power on he argon and then open the particle app in phone and just follow the instructions it give to you . Next after addition of the device you can see the device name in devices list. As you can see in pic below.
We can Program our Argon either in workbench or in Particle WEB IDE using OTA (Over To Air). Here we are going to create code and program Argon in Web IDE. Open the Particle Web IDE and then create a new code and then go to library icon located in left side of WEB IDE UI and then Search the MAX30100 and SSD1306 Library and then add them in code as you can see in the pic below .
Now IN code We have include the fonts that we want to use in OLED display Liberary . Next we will set a heart bitmap that will blink on OLED according to our heart beat. Next we will create a setup function where we insilize the sensor and OLED Display and Also BLE MESH .
After that we have to set the BLE UUID and characteristics and services to transmit the health data over BLE.
const BleUuid serviceUuid("5c1b9a0d-b5be-4a40-8f7a-66b36d0a5176");
BleCharacteristic spo2Characteristic("spo2", BleCharacteristicProperty::NOTIFY, BleUuid("fdcf4a3f-3fed-4ed2-84e6-04bbb9ae04d4"), serviceUuid);
BleCharacteristic bpmSourceCharacteristic("bpm", BleCharacteristicProperty::NOTIFY, BleUuid("cc97c20c-5822-4800-ade5-1f661d2133ee"), serviceUuid);
BleCharacteristic beatCharacteristic("beat", BleCharacteristicProperty::NOTIFY, BleUuid("d2b26bf3-9792-42fc-9e8a-41f6107df04c"), serviceUuid);
Next we will create a loop function that will take the update of sensor data and display it on OLED Display and after that we will publish the health data on Device cloud also on BLE MESH using the following CODE
Mesh.publish("spo2", String(sp));
Mesh.publish("bpm", String(BPM));
if (millis() - tsLastReport1 > 1000) {
Particle.publish("BPM", String(BPM));
Particle.publish("spo2", String(sp));
Particle.publish("temp", String(t));
tsLastReport1 = millis();
}
Here is the complete code . You can copy it and upload the Code on Argon. To Upload the code first power the particle argon and wait the argon to connect to device cloud . Click on upload icon in Web IDE .
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_SSD1306_RK.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <FreeSerif12pt7b.h>
#include <FreeMono9pt7b.h>
#include <FreeMono12pt7b.h>
#include <FreeMonoOblique9pt7b.h>
#include <TomThumb.h>
#include <FreeMonoBold12pt7b.h>
#include <Org_01.h>
#include <FreeMonoBold9pt7b.h>
#define OLED_RESET D4
Adafruit_SSD1306 display(OLED_RESET);
#include "application.h"
SYSTEM_MODE (AUTOMATIC);
SYSTEM_THREAD (ENABLED);
#include "MAX30100_PulseOximeter.h"
#include "application.h"
#define REPORTING_PERIOD_MS 1000
#define slaveAddress 0x5A
PulseOximeter pox;
int BPM,sp;
float t;
uint32_t tsLastReport = 0;
uint32_t tsLastReport1 = 0;
int LED = D7;
int r1=0;
int r2=0;
// Callback (registered below) fired when a pulse is detected
//////////////////////////////////
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
};
///////////////////////////////////
//////////////////////////////////////////////////////////
const BleUuid serviceUuid("5c1b9a0d-b5be-4a40-8f7a-66b36d0a5176");
BleCharacteristic spo2Characteristic("spo2", BleCharacteristicProperty::NOTIFY, BleUuid("fdcf4a3f-3fed-4ed2-84e6-04bbb9ae04d4"), serviceUuid);
BleCharacteristic bpmSourceCharacteristic("bpm", BleCharacteristicProperty::NOTIFY, BleUuid("cc97c20c-5822-4800-ade5-1f661d2133ee"), serviceUuid);
BleCharacteristic beatCharacteristic("beat", BleCharacteristicProperty::NOTIFY, BleUuid("d2b26bf3-9792-42fc-9e8a-41f6107df04c"), serviceUuid);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
void onBeatDetected()
{
Serial.println("Beat!");
digitalWrite(LED,1);
display.drawBitmap( 2, 3, bitmap, 28, 28,0);
display.display();
//delay(100);
}
void setup()
{
pinMode(LED,OUTPUT);
Serial.begin(115200);
pox.begin();
pox.setOnBeatDetectedCallback(onBeatDetected);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.setTextWrap(false);
/// ble char setting
BLE.addCharacteristic(spo2Characteristic);
BLE.addCharacteristic(bpmSourceCharacteristic);
BLE.addCharacteristic(beatCharacteristic);
///for blr
BleAdvertisingData advData;
// Advertise our private service only
advData.appendServiceUUID(serviceUuid);
// Continuously advertise when not connected
BLE.advertise(&advData);
}
void loop()
{
pox.update();
BPM=pox.getHeartRate();
sp=pox.getSpO2();
t=pox.getTemperature();
digitalWrite(LED,1);
r1 =map(sp, 0,100,0,110);
r2 =map(BPM,0,100,0,110);
Serial.print("Heart rate:");
Serial.print(BPM);
Serial.print("bpm / SpO2:");
Serial.print(sp);
Serial.println("% ");
digitalWrite(LED,0);
uint8_t sp02level[1];
uint8_t bpmlevel[1];
sp02level[0] = sp>> 4;
bpmlevel[0] = BPM >> 4;
spo2Characteristic.setValue(sp02level);
bpmSourceCharacteristic.setValue(bpmlevel);
Mesh.publish("spo2", String(sp));
Mesh.publish("bpm", String(BPM));
if (millis() - tsLastReport1 > 1000) {
Particle.publish("BPM", String(BPM));
Particle.publish("spo2", String(sp));
Particle.publish("temp", String(t));
tsLastReport1 = millis();
}
oleddis();
}
void oleddis(){
display.clearDisplay();
display.setFont(NULL);
display.drawBitmap( 2, 3, bitmap, 28, 28, 1);
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(30,20);
display.setFont(&FreeMonoBold9pt7b);
display.print("=");
display.print(BPM);
display.setFont(NULL);
display.drawRoundRect(0, 30, 120, 8, 6, WHITE);
display.fillRoundRect(0, 30, r2, 8, 6, WHITE);
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,44);
display.setFont(&FreeMonoBold9pt7b);
display.print("Spo2=");
display.setFont(&FreeMonoBold9pt7b);
display.print(sp);
display.print("%");
display.drawRoundRect(0, 54, 120, 8, 6, WHITE);
display.fillRoundRect(0, 54, r1, 8, 6, WHITE);
display.display();
}
After Uploading the code now connect he components ad in circuit diagram and then power the device and go to he console of particle and copy the URL for fetching the data remotely and copy that URL. More version at electronicsforu
Now Go to CHROME and Paste the URL and you can now see the live health data on the chrome web browser . You can also use any BLE APP to get data on BLE . And the Health DATA can also be seen on the OLED DISPLAY. SO Congrats our OPEN SOURCE remote OXYMETER and and health monitor is ready
Comments