# Using HX710b pressure sensor

**URL:** <https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374>\
**Category:** Programming\
**Created:** [April 13, 2020, 5:51am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374 "2020-04-13T05:51:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![falcon98](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@falcon98](https://forum.arduino.cc/u/falcon98)\
**Post date:** [April 13, 2020, 5:51am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/1 "2020-04-13T05:51:53Z")

</div>

Dear All,

I am using HX710b pressure sensor with arduino. The range of pressure sensor is 0 - 400mbar.  
Like others I am using HX711 library with the setup.

Does anyone has any reference code for the pressure sensor system. The readings I am getting are not clear and not consistent.

As per my understanding , the sensor in atmosphere should be saturated since its above its rated range.

---

<div class="post-metadata">

**Author:** ![falcon98](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@falcon98](https://forum.arduino.cc/u/falcon98)\
**Post date:** [April 13, 2020, 6:13am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/2 "2020-04-13T06:13:33Z")

</div>

Dear All,

I am using HX710b pressure sensor with Arduino. Like others i am using HX711 library to get the data..

Does anyone has any reference working code for the pressure sensor. Since the range of sensor is 0-400mbar, the output in open air should be saturated.  
Only if I can attach a syringe, shall I get a valid data.

Can anyone suggest me a proper reference

---

<div class="post-metadata">

**Author:** ![sherzaad](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sherzaad/32/226173_2.png) [@sherzaad](https://forum.arduino.cc/u/sherzaad)\
**Post date:** [April 13, 2020, 6:25am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/3 "2020-04-13T06:25:06Z")

</div>

> falcon98:  
> Dear All,
> 
> I am using HX710b pressure sensor with Arduino. Like others i am using HX711 library to get the data..
> 
> Does anyone has any reference working code for the pressure sensor. Since the range of sensor is 0-400mbar, the output in open air should be saturated.  
> Only if I can attach a syringe, shall I get a valid data.
> 
> Can anyone suggest me a proper reference

did you try an internet search?

this link seems to me to be a good example:  
[https://www.electroschematics.com/pressure-sensor-guide/](https://www.electroschematics.com/pressure-sensor-guide/)

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [April 13, 2020, 6:29am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/4 "2020-04-13T06:29:04Z")

</div>

Duplicate topics merged

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

---

<div class="post-metadata">

**Author:** ![falcon98](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@falcon98](https://forum.arduino.cc/u/falcon98)\
**Post date:** [April 13, 2020, 7:57am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/5 "2020-04-13T07:57:56Z")

</div>

> sherzaad:  
> did you try an internet search?
> 
> this link seems to me to be a good example:  
> [Pressure Sensor Guide - ElectroSchematics.com](https://www.electroschematics.com/pressure-sensor-guide/)

Yes I tried it but its giving following error:

"J:\Arduino Data\pressure\_2\pressure\_2.ino: In function 'void setup()':

pressure\_2:28:9: error: 'class HX711' has no member named 'begin'

scale.begin(A1, A0);

^ ~~~~

exit status 1  
'class HX711' has no member named 'begin'

.

Pls let me know how to solve it

---

<div class="post-metadata">

**Author:** ![falcon98](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@falcon98](https://forum.arduino.cc/u/falcon98)\
**Post date:** [April 13, 2020, 8:23am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/6 "2020-04-13T08:23:09Z")

</div>

I was able to get the code working and got some outputs as follows:

one reading: -233.6 | average: 2240.3  
one reading: -233.5 | average: 2515.3  
one reading: -233.0 | average: 2272.0  
one reading: -233.5 | average: 2262.6  
one reading: -233.5 | average: 2102.6  
one reading: -233.5 | average: 2272.7  
one reading: -233.4 | average: 2693.0  
one reading: -233.4 | average: 2593.2  
one reading: -233.3 | average: 2578.4  
one reading: -233.4 | average: 2077.1  
one reading: -233.0 | average: 648.3  
one reading: -233.4 | average: -392.4  
one reading: -232.9 | average: -3228.5  
one reading: -233.4 | average: -3228.5  
one reading: -233.3 | average: -547.9

The positive values are when I am pulling syringe upwards and negative values when I am pushing the syringe downwards.

The main issue is how to calibrate the readings. What is the scale of reading. Is it in mbar? since maximum reading should be 400 mbar so why is it giving negative and positive values.

Can anyone clarify this.

---

<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:** [May 6, 2021, 12:26am UTC](https://forum.arduino.cc/t/using-hx710b-pressure-sensor/648374/7 "2021-05-06T00:26:58Z")

</div>

Closed on May 6, 2021, 12:26am UTC


