Skip to content

1. Principles and practices

This week I worked on defining my final project idea and started to getting used to the documentation process.

Project title : Instant Help

what if the person has no knowledge about how to provide the first aid to the patient .. one second matters !!!

So, “instant help” comes to serve this issue .

👍🏻“Instant help” provides the first aid instructions that are stored in the system . And it appears once the button is pressed .

👍🏻“Instant help” measures the heart rate and decide whether it is within the range , below , or above normal . “

We will develop the project to: 👍🏻 minimize the size of the prototype and instead of viewing the instructions on the screen , we will use vocal instructions . The instructions may be images or videos instead of vocal only . especially in Bone fracture injuries cases .

👍🏻 tests can be embedded in the device such as : diabetes test

ProjectSketchup

Code

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most acurate BPM math.
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.
int heart_beats;
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns

char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {A4, A5, 13, 10}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad

//Create an object of keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


// Variables
const int PulseWire = A1; // PulseSensor PURPLE WIRE connected to ANALOG PIN 0
const int LED13 = 13; // The on-board Arduino LED, close to PIN 13.
int Threshold = 550; // Determine which Signal to "count as a beat" and which to ignore.
// Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting.
// Otherwise leave the default "550" value.

PulseSensorPlayground pulseSensor; // Creates an instance of the PulseSensorPlayground object called "pulseSensor"



void setup() {

 lcd.begin(16, 2);
 Serial.begin(9600);

}

void loop() {

  lcd.clear();
  lcd.setCursor(0, 0);
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13); //auto-magically blink Arduino's LED with heartbeat.
pulseSensor.setThreshold(Threshold);



  char key = keypad.getKey();// Read the key

  // Print if key pressed
  if (key){
    Serial.print("Key Pressed : ");
    Serial.println(key);
     if (key=='1'){
      lcd.setCursor(0, 0);
      lcd.print("instructions for");
        lcd.setCursor(0, 1);
      lcd.print("low blood pressure");
      delay(1000);
        lcd.clear();

    lcd.setCursor(0, 0);
      lcd.print("lying down. When ");
      delay(1000);
              lcd.setCursor(0, 1);
       lcd.print("you experience dizziness");
       delay(1000);
               lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print(",lightheadedness,");
        delay(1000);
         lcd.setCursor(0, 1);
      lcd.print("or other symptoms ");
       delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("of low blood ");
       delay(1000);
      lcd.setCursor(0, 1);
       lcd.print("pressure,lie on");
      delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("your back ");
      delay(1000);
      lcd.setCursor(0, 1);
      lcd.print("and close your");
      delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("eyes for a few ");
      delay(1000);
      lcd.setCursor(0, 1);
      lcd.print("minutes until");
      delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("you feel your");
      delay(1000);
       lcd.setCursor(0, 1);
      lcd.print("blood pressure,");
      delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("has returned to");
      delay(1000);
      lcd.setCursor(0, 1);
      lcd.print("normal levels");
      delay(1000);
     }

  }
if (key=='A'){
      lcd.setCursor(0, 0);
      lcd.print("put your index");
      delay(1000);
      lcd.setCursor(0, 1);
      lcd.print("on HB_sensor");
      delay(1000);
      heart_beats=analogRead(A1);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("heart_beats");
      lcd.setCursor(0, 1);
      lcd.print(heart_beats);
      delay(2000);

}
      if(key=='B'){
      if (pulseSensor.begin()) {

      Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset.
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("♥ Rate Monitor");
      delay(3000);

int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".
// "myBPM" hold this BPM value now.
if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a beat happened".
Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened".
Serial.print("BPM: "); // Print phrase "BPM: "
Serial.println(myBPM); // Print the value inside of myBPM.
lcd.setCursor(0,2);
lcd.print("HeartBeat Happened !"); // If test is "true", print a message "a heartbeat happened".
lcd.setCursor(5,3);

lcd.print("BPM: "); // Print phrase "BPM: "
lcd.print(myBPM);
}
delay(20); // considered best practice in a simple sketch.


}
}        

        }

Last update: February 2, 2022