# Request for Assistance with Sphygmomanometer Readings Using HX710B Sensor

**URL:** <https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025>\
**Category:** Sensors\
**Created:** [September 16, 2024, 4:06am UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025 "2024-09-16T04:06:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![deyvin77](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/deyvin77/32/1100160_2.png) [@deyvin77](https://forum.arduino.cc/u/deyvin77)\
**Post date:** [September 16, 2024, 4:06am UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/1 "2024-09-16T04:06:28Z")

</div>

**Dear friends** ,  
I am developing a sphygmomanometer using the HX710B sensor and need your help with the data readings. My issue is that the sensor only measures up to 60 mmHg; when the pressure exceeds this value, I no longer get readings in my program. I would appreciate any guidance or suggestions. I have attached images for further clarity.

Program:

```arduino
#include "HX711.h"

// Pines de conexión
const int LOADCELL_DOUT_PIN = 3; // Pin de datos
const int LOADCELL_SCK_PIN = 4; // Pin de reloj

// Instancia del objeto HX711
HX711 scale;

// Factores que vamos a ajustar
float calibrationFactor = 104858.84; // Ajusta este valor según las pruebas
long offset = 30.00; // Se calibrará dinámicamente

// Número de lecturas para calcular el offset promedio
const int numLecturasOffset = 10;

void setup() {
  Serial.begin(115200);
  
  // Iniciar el HX711
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  
  // Establecer la ganancia del HX711
  scale.set_gain(128); // Cambiar a 64 o 128 según la celda de carga
  
  // Esperar unos milisegundos para estabilizar el sensor
  delay(500);
  
  // Calcular el offset basado en el valor promedio en reposo (sin presión)
  offset = obtenerOffsetPromediado();
  Serial.print("Offset ajustado: ");
  Serial.println(offset);

  // Mostrar instrucciones de calibración
  Serial.println("Calibración del offset completa. Si es necesario recalibrar el offset, presiona 'c'.");
}

void loop() {
  if (Serial.available()) {
    char comando = Serial.read();
    if (comando == 'c') {
      // Recalibrar el offset si se presiona 'c'
      offset = obtenerOffsetPromediado();
      Serial.print("Nuevo offset ajustado: ");
      Serial.println(offset);
    }
  }

  if (scale.is_ready()) {
    // Leer el valor crudo del sensor HX710B
    long lecturaBruta = scale.read();
    
    // Mostrar la lectura cruda y el offset
    Serial.print("Lectura cruda: ");
    Serial.println(lecturaBruta);
    Serial.print("Offset: ");
    Serial.println(offset);
    
    // Restar el offset y aplicar el factor de calibración
    float pressure = (lecturaBruta - offset) / calibrationFactor; // Calcula la presión en mmHg
    
    // Mostrar la presión en mmHg en el Serial Monitor
    Serial.print("Presión: ");
    Serial.print(pressure);
    Serial.println(" mmHg");
  } else {
    Serial.println("Sensor no está listo.");
  }

  delay(1000); // Esperar 1 segundo entre lecturas
}

// Función para obtener un offset promediado en reposo
long obtenerOffsetPromediado() {
  long sum = 0;
  for (int i = 0; i < numLecturasOffset; i++) {
    if (scale.is_ready()) {
      sum += scale.read();
      delay(100); // Pequeño retardo entre lecturas
    }
  }
  return sum / numLecturasOffset; // Retornar el promedio de las lecturas
}

```

 ![ckto](https://europe1.discourse-cdn.com/arduino/original/4X/a/c/f/acfa07e75fb7988a2b07bb3e396949d70a4e8c60.jpeg)  
 ![reloj 0mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/b/d/f/bdfc6c4a12a496e49501c2cab8b114670e729d85.jpeg)  
 ![0mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/2/6/b/26b57516287996c6eebda23bb7289d6c0c00f36c.jpeg)  
 ![reloj 60mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/e/b/c/ebce1bd91fc5c1bd4c4e03647ead3f88ed407edc.jpeg)  
 ![60mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/1/c/0/1c0aa7fc5bcf2572edd53fb7b4f1f6e782972a0b.jpeg)  
 ![reloj 160mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/6/e/2/6e28b9c2dccca52c73086af7e7f1bfdbd241a4e3.jpeg)  
 ![160mmhg](https://europe1.discourse-cdn.com/arduino/original/4X/b/4/2/b4297546942f536225342969650be2d1d36cefc8.jpeg)

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [September 16, 2024, 6:56am UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/2 "2024-09-16T06:56:29Z")

</div>

Your topic has been moved. Please do not post in "Uncategorized"; see the sticky topics in [Uncategorized - Arduino Forum](https://forum.arduino.cc/c/using-arduino/uncategorized/184).

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [September 16, 2024, 8:30am UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/3 "2024-09-16T08:30:46Z")

</div>

> [@deyvin77](#):
>
> `long offset = 30.00;`

why decimals on long?

Remove all your calibration/offset etc from your code and leave only scale.read and print that.  
Try if you get output beyond 60mmHg.

---

<div class="post-metadata">

**Author:** ![jim-p](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jim-p/32/922840_2.png) [@jim-p](https://forum.arduino.cc/u/jim-p)\
**Post date:** [September 16, 2024, 8:55am UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/4 "2024-09-16T08:55:34Z")

</div>

> [@deyvin77](#):
>
> My issue is that the sensor only measures up to 60 mmHg; when the pressure exceeds this value, I no longer get readings in my program

What do you mean you no longer get readings?  
Are they zero, at the maximum?  
If the max is 60 anything above that is invalid, so why do you care?  
You are using a library for the HX711 not the HX710B

---

<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:** [September 16, 2024, 2:58pm UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/5 "2024-09-16T14:58:41Z")

</div>

**Before posting your code and schematic, please review the forum guidelines and use code tags to ensure clarity. Additionally, include links to the technical information for your hardware and provide a preliminary schematic that shows all power, ground, and power sources.**

For more guidance, please refer to this link:

- **[How to Get the Best Out of This Forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966)**

**Important Notes:**

- Breadboard diagrams (often referred to as "frizzes") are not considered proper schematics in this context.
- Wiring diagrams are helpful for assembly but are not effective for debugging.
- **Screenshots are discouraged** because they are often hard to read. Please provide text-based code and clear, high-quality images of schematics.

Providing the correct information will help others understand your setup and offer better assistance.

* * *

---

<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:** [September 16, 2024, 5:09pm UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/6 "2024-09-16T17:09:17Z")

</div>

You might find this tutorial useful, as it points to a library specifically for that sensor.  
[https://www.teachmemicro.com/arduino-pressure-sensor-tutorial/](https://www.teachmemicro.com/arduino-pressure-sensor-tutorial/)

Please do not post illegible pictures of text and code. Use cut/paste and code tags instead.

---

<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:** [March 15, 2025, 5:10pm UTC](https://forum.arduino.cc/t/request-for-assistance-with-sphygmomanometer-readings-using-hx710b-sensor/1302025/7 "2025-03-15T17:10:13Z")

</div>

Closed on March 15, 2025, 5:10pm UTC

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