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..!!
delay(5000);