1

I'm working with a digital blood pressure meter using arduino nano. I need to display the pressure reading during inflation and deflation of the cuff instantly. And when an input signal applied to a particular pin during deflation, I need to print the pressure value at that time of input signal, to a display. How to code for this logic. I made the code for showing pressure value during inflation and deflation. But need to pause the value and display constantly the pressure value at the time of input applied to the arduino pin. How this pausing of value can be done?. Finally I need to print both the systolic and diastolic pressure value constantly as: 120/80 mmHg (systolic/diastolic mmHg) In this project, the systolic pressure is noted when there is an input at digital pin.

In the case of diastolic pressure, it is noted according to input pulse duration. That is, If the duration of pulse is greater than 50 milli-seconds, print the diastolic pressure as current pressure minus the pressure when pulse duration equal to 50 milli-seconds.

Below is the code I have written for printing the systolic and diastolic pressure instantly.

#include <LiquidCrystal.h>//Don't forget to enter this library

LiquidCrystal lcd(12, 11,  10, 9, 8, 7);

int analogInPin = A1;     // Analog input pin that the pressure sensor output is attached to

int pressure = 0;
int sensorValue = 0;        // value read from the pressure sensor via the amplifier stage

void setup() {
 Serial.begin(9600); 
analogReference(INTERNAL);

void loop() {
lcd.clear();   
sensorValue = analogRead(analogInPin);            

pressure = sensorValue*(0.9226)-267.7; //Pressure value according to sensor value
  lcd.setCursor(0,1);  
  lcd.print("mmHg: ");   
  lcd.print(pressure);     
  delay(100);                     

}

I'm using a different method to note systolic as well as diastolic pressure values, like the stethoscope doing the job in conventional measurement method. The dual microphone arrangement will capture the sounds( korotkoff ) of blood flow. This sounds are processed (independent to arduino) by the external analog circuitry which outputs a 5VDC at every noticeable instant of pulse(during blood flow). This signal is then fed to a digital pin of arduino. Here, when the 5V signal reaches at the digial pin first, we note the systolic pressure as the pressure at the instant when the 5V signal is generated first. In the case of diastolic pressure, the generated 5V signal from the circuit is compared with an externally given unit step 5V using comparator. This compared signal output is fed to another digital pin of arduino, where the diastolic pressure is noted according to the input 5V pulse signal duration( Eg: If the duration is greater than 50ms ), the diastolic pressure is the pressure at which the pulse duration which is equal to 50ms).

I'm totally frustrated with remaining parts of code as mentioned. Thank you in Advance..!!

Mstar3
  • 11
  • 2
  • the answer to your question is in your own code, right after `delay(5000);` – jsotola Apr 06 '20 at 17:34
  • I need to print the two pressure values as Systolic/Diastolic with respect to the input signal to particular digital pins. And these values should displayed constantly as it is the final measurement value. Like: "Your Blood Pressure is: 120/80 mmHg" – Mstar3 Apr 06 '20 at 17:39
  • The Systolic/Diastolic pressure is the two pressure levels noted at instant when the signals are reached by externally to any two digital pins at two different time – Mstar3 Apr 06 '20 at 17:44
  • so, what is giving you the problem? .... you already have code for displaying data depending on pin input – jsotola Apr 06 '20 at 17:59
  • your code is poorly formatted ... that makes it more difficult to see program flow and more difficult to determine where to insert additional code for expanded functionality – jsotola Apr 06 '20 at 18:03
  • I just optimized the code for better understanding (I hope). Yes, I already have code for displaying data depending on pin input. That's working nice. But, I need to print the two pressure values among these broad pressure values, depending on an external signal as input to a digital pin. This is what I need to print constantly as Systolic pressure during the measuring of pressure. – Mstar3 Apr 06 '20 at 18:17
  • ok, now i know that i do not understand what you are trying to do ... my apologies ... maybe someone else can understand what you are asking – jsotola Apr 06 '20 at 18:21
  • In my project, The pressure is given to the sensor externally and it is represented as inflation here and after a pressure value of (say: 180 mmHg), the deflation valve is activated to decrease the pressure inside the cuff gradually. at this time of deflation, at a particular time of deflation, an input from external microphone is reached at a digital pin (say: pin4). Here, I need to pause or print the pressure value at the time of input signal given. – Mstar3 Apr 06 '20 at 18:27
  • Can I hope someone will solve my problem?. Anyway, thanks for follow up @jsotola – Mstar3 Apr 06 '20 at 18:43
  • i think that the problem may be with your thinking that the displaying of data is somehow related to acquiring data .... the two functions are totally separate .... what you do with data, is totally irrelevant to the "read data function" ... how you obtained the data is totally irrelevant to the "display data function" – jsotola Apr 06 '20 at 19:00
  • What is your overall hardware setup? Do you have the pulse detection circuit connect to the Arduino? My understanding of systolic pressure change is caused by the oscillation and therefore it can't just detected by reading the pressure. The amplitude of the pulse change when the pressure changed. The maximum amplitude represents the mean arterial pressure, and both systolic and diastolic can then be calculated based on the obtained mean arterial pressure. To obtain the pulse amplitude, you need a sensor (e.g. microphone) and a high-pass filter to filter out the pulse and the amplitude. – hcheung Apr 07 '20 at 03:07
  • Sir, I'm using a different method to note both the systolic as well as diastolic pressure. I just added the description of my hardware part in above main question. Please find it at the bottom of my code part. – Mstar3 Apr 07 '20 at 14:15
  • Still your code has nothing about the digital signal you mentioned. You need to read the change of the signal and record the pressure as diastolic. If you are using the cuffless technique, I would suggest you read the [pulsein()](https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/) function that might be useful for your application. – hcheung Apr 08 '20 at 01:18

0 Answers0