# Blood pressure development

**URL:** <https://forum.arduino.cc/t/blood-pressure-development/1222237>\
**Category:** Sensors\
**Created:** [February 10, 2024, 1:45pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237 "2024-02-10T13:45:47Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 10, 2024, 1:45pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/1 "2024-02-10T13:45:47Z")

</div>

Good day, the great people of this forum. I have trouble determining the systolic and diastolic pressure using a pressure sensor and Arduino. Please I need help with the source code. Thanks

---

<div class="post-metadata">

**Author:** ![liaifat85](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@liaifat85](https://forum.arduino.cc/u/liaifat85)\
**Post date:** [February 10, 2024, 1:49pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/2 "2024-02-10T13:49:57Z")

</div>

Which pressure sensor are you using?

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 10, 2024, 2:28pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/3 "2024-02-10T14:28:21Z")

</div>

I am using mps20N0040D sensor with HX711 adc.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 10, 2024, 3:47pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/4 "2024-02-10T15:47:00Z")

</div>

> [@abu\_abdurrahman](#):
>
> mps20N0040D

Is this a module or the IC? Have you tried searching the internet?

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 10, 2024, 3:55pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/5 "2024-02-10T15:55:00Z")

</div>

it is a module with built-in adc.  
 ![download](https://europe1.discourse-cdn.com/arduino/original/4X/8/4/e/84ef6ef5252af72ca894b252c4f50619d7409f15.jpeg)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 10, 2024, 4:29pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/6 "2024-02-10T16:29:01Z")

</div>

> [@xfpd](#):
>
> searching the internet?

Try this internet site...

> **[MPS20N0040D Pressure Sensor Calibration with Arduino — Maker Portal](https://makersportal.com/blog/2020/6/4/mps20n0040d-pressure-sensor-calibration-with-arduino)**
>
> Pressure is defined as an evenly distributed force acting over a surface with a given area. The accurate measurement of pressure is essential for applications ranging from material testing to weighing scales, aircraft altitude prediction, and...

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 10, 2024, 9:16pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/7 "2024-02-10T21:16:39Z")

</div>

Thanks for your kind effort. I have done the calibration and the rest, but the issue is determining the systolic and diastolic pressure from the range of readings from the sensor. say 180mmHm to 60mmHg. That is my problem.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [February 10, 2024, 9:21pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/8 "2024-02-10T21:21:24Z")

</div>

> [@abu\_abdurrahman](#):
>
> mps20N0040D

Post your code using code tags, we should be able to help you.

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [February 10, 2024, 9:24pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/9 "2024-02-10T21:24:32Z")

</div>

If you have access to a sphygmomanometer you could tee off the gauge and calibrate your sensor based on the gauge readings.

Or maybe you are asking how to determine from the pressure readings when the systolic and diastolic pressures have occurred. How are you detecting the pulse from the brachial artery?

---

<div class="post-metadata">

**Author:** ![JohnRob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnrob/32/253560_2.png) [@JohnRob](https://forum.arduino.cc/u/JohnRob)\
**Post date:** [February 10, 2024, 10:44pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/10 "2024-02-10T22:44:10Z")

</div>

I don't know about reading the BP but I know Arduino development has raised mine (🙂

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [February 10, 2024, 10:50pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/11 "2024-02-10T22:50:36Z")

</div>

> [@abu\_abdurrahman](#):
>
> determining the systolic and diastolic pressure from the range of readings

To calibrate the module, consider using

1. a low pressure regulator (0mm Hg to 250Hg / 0 PSI - 5 PSI)
2. an air reservoir (like a soccer football).

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 11, 2024, 9:10am UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/12 "2024-02-11T09:10:09Z")

</div>

Thanks for your help, my issue is how to determine systolic and diastolic pressure. Below is the code I am using, I am stuck at the point where i suppose to determine the systolic and diastolic i don't know what next to do.

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 11, 2024, 9:14am UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/13 "2024-02-11T09:14:38Z")

</div>

```arduino

#include "HX710B.h"
#define DATA_ARRAY_SIZE 35
#define UPPER_THRESHOLD 170
#define LOWER_THRESHOLD 60
byte NO_TIMES = 10;
const int DOUT_Pin = 3; //sensor data pin
const int SCK_Pin = 4; //sensor clock pin
const int pump_pin = 9;
const int valve_pin = 8;

float average;
float pressure_pascal;
float pressure_mmHg;
long READ_TIMES = 10;
long OFFSET = -540000;; // used for tare weight
float SCALE = 1; // used to return weight in grams, kg, ounces, whatever
float RES = 2.98023e-7;

float pressure_data[DATA_ARRAY_SIZE];
float average_pressure(float pres[], size_t size){
    int max_wave = 0;
    float avg_pres = 0;
    for(int counter=0; counter < size; counter++){
        if(pres[counter]>avg_pres){
// max_wave = wave[counter];
            avg_pres = pres[counter];
        }
    }
    Serial.print("THE average_pressure IS ------------%f");
    Serial.println(avg_pres);
    return avg_pres;
}

HX710B pressure_sensor; 

void setup() {
  Serial.begin(9600);
  pressure_sensor.begin(DOUT_Pin, SCK_Pin,64);
   pinMode(pump_pin,OUTPUT);
   pinMode(valve_pin,OUTPUT);
}

void loop() {
  
  digitalWrite(valve_pin,HIGH);
  delay(500);
  unsigned long currentMillis = millis();
  if (pressure_sensor.is_ready()) {
    pressure_mmHg = ((pressure_sensor.read() - OFFSET)*RES) * 20 - 7.78 * 3.5;
    digitalWrite(pump_pin,HIGH);
    while(pressure_mmHg < UPPER_THRESHOLD ){
      pressure_mmHg = ((pressure_sensor.read() - OFFSET)*RES) * 20 - 7.78 * 3.5;
      
      Serial.println(pressure_mmHg);
      delay(10);
      
    }
    
    digitalWrite(pump_pin,LOW);
    delay(1000);
    for(int i = 0; i < DATA_ARRAY_SIZE; i++){
      pressure_mmHg = ((pressure_sensor.read() - OFFSET)*RES) * 20 - 7.78 * 3.5;
      if(pressure_mmHg < UPPER_THRESHOLD && pressure_mmHg > LOWER_THRESHOLD){
        pressure_data[i] = pressure_mmHg;
  // Serial.print("Pressure data in mmHg: ");
        Serial.println(pressure_data[i]);
         
        }
      delay(10);
      }
      
      
      
    digitalWrite(valve_pin,LOW);
    Serial.println("Done pumping.....");
 
    delay(50000);

// Check for the presence of Korotkoff sounds based on pressure changes
 

  } 
  
}

```

---

<div class="post-metadata">

**Author:** ![liaifat85](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@liaifat85](https://forum.arduino.cc/u/liaifat85)\
**Post date:** [February 13, 2024, 6:07pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/14 "2024-02-13T18:07:29Z")

</div>

Checking for Korotkoff sounds based on pressure changes. This would require some signal processing or analysis of the pressure data to detect these sounds. You might need to implement algorithms for this purpose.

---

<div class="post-metadata">

**Author:** ![abu\_abdurrahman](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/abu_abdurrahman/32/1041323_2.png) [@abu\_abdurrahman](https://forum.arduino.cc/u/abu_abdurrahman)\
**Post date:** [February 13, 2024, 6:16pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/15 "2024-02-13T18:16:46Z")

</div>

Ok, thanks for your response.

---

<div class="post-metadata">

**Author:** ![anon94801460](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@anon94801460](https://forum.arduino.cc/u/anon94801460)\
**Post date:** [February 13, 2024, 7:14pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/16 "2024-02-13T19:14:04Z")

</div>

> [@abu\_abdurrahman](#):
>
> determine systolic and diastolic pressure

The first step is to determine exactly how those quantities are defined.

The next step is to determine what other people have done, for many decades now, to extract those quantities from blood pressure data.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 11, 2024, 7:14pm UTC](https://forum.arduino.cc/t/blood-pressure-development/1222237/17 "2024-08-11T19:14:39Z")

</div>

Closed on August 11, 2024, 7:14pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
