Smart Blood Pressure Monitor
It should be noted that this device is not designed for clinical applications, however, it is a fun way to learn about pressure sensors and Arduino while creating a functional device applicable to the real world!
Pressure, also called hypertension, is deadly it can lead to heart failure, stroke, and kidney failure.
Parts used for this project:
1.Arduino Uno
char sbuffer[30], ch;
unsigned char pos;
unsigned char read1, read2, read3;
char sys;
void setup(){
Serial.begin(115200); // Serial is used for output on PCs "Serial Monitor"
Serial1.begin(9600); // Serial1 is used for serial input from connected sensor
Serial.println("BP Start reading......");
}
char mygetchar(void)
{ //receive serial character from sensor (blocking while nothing received)
while (!Serial1.available());
return Serial1.read();
}
void loop()
{
ch = mygetchar(); //loop till character received
if(ch==0x0A) // if received character is <LF>, 0x0A, 10 then process buffer
{
pos = 0; // buffer position reset for next reading
// extract data from serial buffer to 8 bit integer value
// convert data from ASCII to decimal
read1 = ((sbuffer[1]-'0')*100) + ((sbuffer[2]-'0')*10) +(sbuffer[3]-'0');
read2 = ((sbuffer[6]-'0')*100) + ((sbuffer[7]-'0')*10) +(sbuffer[8]-'0');
read3 = ((sbuffer[11]-'0')*100) + ((sbuffer[12]-'0')*10) +(sbuffer[13]-'0');
// Do whatever you wish to do with this sensor integer variables
// Show on LCD or Do some action as per your application
// Value of variables will be between 0-255
// example: send demo output to serial monitor on "Serial"
int Sys = (int)(read1);
int Dia = (int)(read2);
int Pulse = (int)(read3);
Serial.print("Sys: ");
Serial.println(Sys);
Serial.print("Dia: ");
Serial.println(Dia);
Serial.print("Pulse: ");
Serial.println(Pulse);
Serial.println("BP: ");
Serial.print(Sys);
Serial.print("/");
Serial.println(Dia);
} else { //store serial data to buffer
sbuffer[pos] = ch;
pos++;
}
}// end loop