IoT-BangladeshSalah Uddin
Published © LGPL

Covid-19 Patient Monitoring Device based on LoRa

Lora network based covid-19 patient monitoring device.

AdvancedFull instructions providedOver 2 days9,969
Covid-19 Patient Monitoring Device based on LoRa

Things used in this project

Hardware components

The Things Uno
The Things Network The Things Uno
×1
The Things Gateway
The Things Network The Things Gateway
×1
MAXREFDES117# Heart-Rate and Pulse-Oximetry Monitor Development Platform
Maxim Integrated MAXREFDES117# Heart-Rate and Pulse-Oximetry Monitor Development Platform
×1
Grove - Temperature Sensor
Seeed Studio Grove - Temperature Sensor
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Gravity:Digital Push Button (Yellow)
DFRobot Gravity:Digital Push Button (Yellow)
×1
Grove - Vibration Sensor (SW-420)
Seeed Studio Grove - Vibration Sensor (SW-420)
×1
Buzzer
Buzzer
×1
LED (generic)
LED (generic)
×1
Grove - Temperature, Humidity, Pressure and Gas Sensor (BME680)
Seeed Studio Grove - Temperature, Humidity, Pressure and Gas Sensor (BME680)
×1

Software apps and online services

Android Studio
Android Studio
Arduino Web Editor
Arduino Web Editor
AWS IoT
Amazon Web Services AWS IoT
Visual Studio Code Extension for Arduino
Microsoft Visual Studio Code Extension for Arduino

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

circuit diagram

Code

source

Arduino
#include <TheThingsNetwork.h>
#include <SPI.h>
#include <MAX30100_PulseOximeter.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>


// Set your AppEUI and AppKey
const char *appEui = "0000000000000000";
const char *appKey = "00000000000000000000000000000000";

#define loraSerial Serial1
#define debugSerial Serial

// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan REPLACE_ME

//VARIABLE TO HOLD THE SENSORS DATA
int bpm;
int spo2;
float temp;

//the sea level presure in your region (****)
Adafruit_BME280 bme; 		// BME280  Sensnor declaration 
unsigned long currentMillis;   //hold the current time



//pulse oximeter time period (measurment time period)
#define REPORTING_PERIOD_MS     1000
PulseOximeter pox;
uint32_t tsLastReport = 0;

// Callback (registered below) fired when a pulse is detected
void onBeatDetected()
{
    // Serial.println("Beat!");
}


void measured_pulse(){
    
    pox.update();
    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
      bpm=pox.getHeartRate();
      tsLastReport = millis();
    }
    
}


TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);

void setup()
{
  loraSerial.begin(57600);
  debugSerial.begin(9600);

  // Wait a maximum of 10s for Serial Monitor
  while (!debugSerial && millis() < 10000)
    ;

  debugSerial.println("-- STATUS");
  ttn.showStatus();

  debugSerial.println("-- JOIN");
  ttn.join(appEui, appKey);
  
  Serial.println(F("BME280 test"));
  Serial.println("Initializing MAX30100");
  
  pox.begin();
  pox.setOnBeatDetectedCallback(onBeatDetected);
  
  bool status;
  
  status = bme.begin();
  if (!status) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }

  pinMode(7, OUTPUT);
  pinMode(A0,INPUT);
  pinMode(8,INPUT);
  pinMode(6,INPUT);

}



void loop()
{
  debugSerial.println("-- LOOP");
  
  h_rate = analogRead(A0);
  button = digitalRead(8);
  temperature = pox.getTemperature();
  spo2 = pox.getSpO2();
  bpm =  bpm;
  humidity =  bme.readHumidity();
  movement = digitalRead(6);
 
 
 
 
 


  byte payload[6];
  payload[0] = highByte(bpm);
  payload[1] = lowByte(temperature);
  payload[2] = highByte(humidity);
  payload[3] = lowByte(movement);
  payload[4] = lowByte(spo2);
  payload[5] = lowByte(button);
  payload[6] = lowByte(h_rate);

  debugSerial.print("Temperature: ");
  debugSerial.println(temperature);
  debugSerial.print("Humidity: ");
  debugSerial.println(humidity);
  
  debugSerial.print("BPM: ");
  debugSerial.println(bpm);
  debugSerial.print("SPO2: ");
  debugSerial.println(spo2);
  
  debugSerial.print("H_rate: ");
  debugSerial.println(h_rate);
  
  debugSerial.print("Button: ");
  debugSerial.println(button);
  debugSerial.print("Movement: ");
  debugSerial.println(movement);


  ttn.sendBytes(payload, sizeof(payload));

  delay(20000);
}

Credits

IoT-Bangladesh

IoT-Bangladesh

19 projects • 46 followers
Salah Uddin

Salah Uddin

44 projects • 138 followers
Technology and IoT Hacker, Robot Killer and Drone lover.

Comments

Add projectSign up / Login