Blood Pressure Coding

Hi

I am doing blood pressure monitor for my project and i tried to use the example provided, but the serial monitor did not come out the result shown but it turn out to be as the photo below. I am not sure what is the problem. NEED HELP!

Thank You :slight_smile:

/*
 *  eHealth sensor platform for Arduino and Raspberry from Cooking-hacks.
 *
 *  Description: "The e-Health Sensor Shield allows Arduino and Raspberry Pi 
 *  users to perform biometric and medical applications by using 9 different 
 *  sensors: Pulse and Oxygen in Blood Sensor (SPO2), Airflow Sensor (Breathing),
 *  Body Temperature, Electrocardiogram Sensor (ECG), Glucometer, Galvanic Skin
 *  Response Sensor (GSR - Sweating), Blood Pressure (Sphygmomanometer) and 
 *  Patient Position (Accelerometer)." 
 *  
 *  In this example we are going to get data stored in the blood pressure sensor 
 *  memory and show the result in the serial monitor.   
 *
 *  Copyright (C) 2012 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/> .
 *
 *  Version 2.0
 *  Author: Ahmad Saad  & Luis Martin
 */


#include <eHealth.h>

void setup() { 

  eHealth.readBloodPressureSensor();
  Serial.begin(115200);
  delay(100);    
}

void loop() { 

  uint8_t numberOfData = eHealth.getBloodPressureLength();   
  Serial.print(F("Number of measures : "));    
  Serial.println(numberOfData, DEC);   
  delay(100);


  for (int i = 0; i<numberOfData; i++) { 
    // The protocol sends data in this order 
    Serial.println(F("=========================================="));

    Serial.print(F("Measure number "));
    Serial.println(i + 1);

    Serial.print(F("Date -> ")); 
    Serial.print(eHealth.bloodPressureDataVector[i].day); 
    Serial.print(F(" of ")); 
    Serial.print(eHealth.numberToMonth(eHealth.bloodPressureDataVector[i].month));
    Serial.print(F(" of "));
    Serial.print(2000 + eHealth.bloodPressureDataVector[i].year);    
    Serial.print(F(" at "));

    if (eHealth.bloodPressureDataVector[i].hour < 10) {
      Serial.print(0); // Only for best representation.
    }

    Serial.print(eHealth.bloodPressureDataVector[i].hour);
    Serial.print(F(":"));

    if (eHealth.bloodPressureDataVector[i].minutes < 10) {
      Serial.print(0);// Only for best representation.
    }
    Serial.println(eHealth.bloodPressureDataVector[i].minutes);

    Serial.print(F("Systolic value : ")); 
    Serial.print(30+eHealth.bloodPressureDataVector[i].systolic);
    Serial.println(F(" mmHg"));
    
    Serial.print(F("Diastolic value : ")); 
    Serial.print(eHealth.bloodPressureDataVector[i].diastolic);
    Serial.println(F(" mmHg"));
    
    Serial.print(F("Pulse value : ")); 
    Serial.print(eHealth.bloodPressureDataVector[i].pulse);
    Serial.println(F(" bpm"));
  }

  delay(20000);
}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

What data rate is your serial terminal set to, as your sketch uses 115200

I use 115200 as my data rate but the outcome only came out to be as shown.

Hi

I looked in the eHealth.cpp library file. The readBloodPressureSensor() method is setting the serial monitor speed to 19200 and writing what seem to be control codes to it.

		Serial.begin(19200);
	 	Serial.write(0xAA);
		delayMicroseconds(1);
	 	Serial.write(0x55);
		delayMicroseconds(1);
		Serial.write(0x88);
	 	delay(2500);

If you change serial monitor speed to 19200 and remove your Serial.begin(), you will see characters appearing for these three bytes. Are they supposed to be going to an attached device?

Regards

Ray

This is my program code. And after i changed i still get the same result.

and i tried to use the example provided,

What example provided with what? It does NOT appear that the code is expecting to talk to the Serial Monitor. It appears, instead, as though the code is expecting to talk to something like a Processing app that will draw pictures based on the data it receives.

This might help, in fact the cook-hacks site looks as though it will answer some of your questions.

Tom..... :slight_smile: