Today Due to Breakout of COVID-19 have created a major problem to us and the use medical equipment needed at a large amount and the same time it also require the a number of doctors are need to monitor each patients and keep track the health data of all of them but it is very difficult keep track the health data of all patients and also manage visualize their health data so we have decided to make a smart health device that visualize the health of patients and that can be monitored from any ware and inside the hospital so that a single doctor can monitor the health of many effected person. we will also design a low cost Balena Ventilator and a global corona fighting devices tracker.
So in the project we are going to make the following 3 parts
1. Smart remote health monitor
2. Balena Ventilator
3. Corona fighting device monitor
1. Smart remote health monitor
First of all we need to setup the Raspbian os to balenna fin next we need to install the processing to the Balena fin's Raspbian os . you can install the processing using following command.
curl https://processing.org/download/install-arm.sh | sudo sh
Next we have enable the i2c and Serial port, VNC in Raspberry pi configuration .You can cahnge the raspberry pi configuration by following conflagration setting
sudo raspi-config
For visualizing the health data and hearth beat graph , O2 level on processing of balena fin. we need to set the arduino device because the processing takes the reading from arduino over the serial port and then visualize the graph on our Balnea fin desktop .
Setting Arduino. First install the following liberary in Arduino IDE
- Max30100
After their successful installation, Go to examples and upload the MAx30100 minim code to Arduino nano/pro micro.
then connect the sensor with Arduino as in circuit diagram.
Next open the processing in Balena fin's raspbian os and then paste health_graph the following code into the processing You can aslo find this code in max30100 example folder . Next plug the Arduino into the usb of balnea fin and the open the terminal and type the folowing syntx will show all the usb and serial ports and then copy th port name of Arduino . And change the port name of Arduino in processing code.
sudo lsusb
import processing.serial.*;
// NOTE: when using PULSEOXIMETER_DEBUGGINGMODE_RAW_VALUES
// set this to -1 to enable the auto range mode
final int ABSMAX = 800;
// Adjust to the serial port. Under OSX, UNO platforms and alike are auto-detected.
final String serialPort = "/dev/tty.usbmodemFD13131";
final int WIDTH = 1200;
final int HEIGHT = 600;
final int CHANNELS = 2;
final color[] colors = {color(0, 0, 0), color(255, 0, 0), color(0, 255, 0), color(0, 0, 255)};
float[][] series = new float[CHANNELS][WIDTH];
float heartRate = 0;
int spO2 = 0;
int redLedCurrentIndex = 0;
boolean beatDetected = false;
int ptr = 0;
Serial myPort;
void settings()
{
size(WIDTH, HEIGHT);
}
void setup ()
{
String attemptPort = serialPort;
for (int i=0 ; i < Serial.list().length ; ++i) {
String port = Serial.list()[i];
if (port.matches(".+tty\\.usbmodem.+")) {
attemptPort = port;
break;
}
}
println("Opening port " + attemptPort);
myPort = new Serial(this, attemptPort, 115200);
stroke(0);
fill(0);
textSize(8);
}
void draw ()
{
if (beatDetected) {
background(255, 200, 200);
beatDetected = false;
} else {
background(255);
}
stroke(30);
line(0, height/2, width, height/2);
float maxv=0, minv;
for (int s=0 ; s < CHANNELS ; ++s) {
float[] samples = series[s];
maxv = max(maxv, abs(max(samples)), abs(min(samples)));
if (ABSMAX != -1) {
maxv = min(maxv, ABSMAX);
}
}
// Avoids map() errors
if (maxv == 0) {
maxv = 1;
}
minv = -maxv;
for (int s=0 ; s < CHANNELS ; ++s) {
stroke(colors[s]);
float[] samples = series[s];
float seriesMax = max(samples);
text("ch " + s + " cur:" + samples[ptr] + " max:" + seriesMax + " min:" + min(samples), 0, 8 + 10 * s);
boolean maxDisplayed = false;
for (int i = 0 ; i < WIDTH ; ++i) {
if (i > 0) {
float ipy = HEIGHT - map(samples[i-1], minv, maxv, 0, HEIGHT);
float iy = HEIGHT - map(samples[i], minv, maxv, 0, HEIGHT);
if (abs(samples[i] - seriesMax) < 0.001 && !maxDisplayed) {
text("v=" + samples[i], i, iy);
maxDisplayed = true;
}
line(i - 1, ipy, i, iy);
}
}
}
text("Rate: " + heartRate, 200, 8);
text("SpO2: " + spO2 + "%", 200, 18);
text("RLI: " + redLedCurrentIndex, 200, 28);
}
void serialEvent (Serial myPort)
{
String sLine = myPort.readStringUntil('\n');
if (sLine == null) {
return;
}
if (sLine.substring(0, 2).equals("R:")) {
String[] sValues = split(sLine.substring(2), ',');
for (int i=0 ; i < sValues.length ; ++i) {
float sample = float(sValues[i]);
if (Float.isNaN(sample)) {
continue;
}
series[i][ptr] = sample;
}
ptr = (ptr + 1) % WIDTH;
} else if (sLine.substring(0, 2).equals("H:")) {
heartRate = float(sLine.substring(2));
} else if (sLine.substring(0, 2).equals("B:")) {
beatDetected = true;
} else if (sLine.substring(0, 2).equals("C:")) {
println(sLine);
} else if (sLine.substring(0, 2).equals("O:")) {
spO2 = int(float(sLine.substring(2)));
} else if (sLine.substring(0, 2).equals("I:")) {
redLedCurrentIndex = int(float(sLine.substring(2)));
}
}
After that run the code and a window will appear visulising the live graph of patiant health data .
Setting the Remote access and monitoring
Now we need to setup the vnc so that a single doctor an monitor all the patients data in a single screen. To do so we need to install the vnc on the balena in and connect all the devices with the wifi network of hospital and now doctor need to open the Window of all the pataints in the vnc NOw doctors can visualize different patiants data on a single screen in real time .
2. Balena Ventilator
Our ventilator prototype uses a servo motor that applies pressure on an air sack (
BVM bag), thus pushing oxygen-concentrated air into the lungs. When the servo motor comes back to its earlier position, it results in pressure being released from the air sack (BVM bag), making it retain its original shape. This helps to draw out CO2 from the lungs (similar to the process of breathing in and out). The entire ventilator mechanism of respiration should be in sync with a patient’s normal respiratory rate. This can be achieved by changing the speed of the servo motor in the program.
The model design is attached in 3d part .
When the code for the ventilator runs, the servo motor shaft starts moving and results in pressure being added on the BVM BAG. Hence, oxygen goes through the pipe and flattens the lung. Then the servo motor comes back to its original position, restoring the BVM bag to its previous stae. This continuous process simulates the contraction (breathing in) and relaxation (breathing out) of a human lung.
For health data visualization, simply put your finger on the MAX sensor. As soon as it will start to glow, the live graph of the data health will be obtained.
Comments