Component guide · Beginner · 3 min read
HX710B Air Pressure Sensor Module (0-40 kPa)

Wiring, Code and Water Level
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The HX710B module pairs a small 0 to 40 kPa gauge pressure sensor (MPS20N0040D) with the HX710B 24-bit ADC, so an Arduino or ESP32 reads it with two digital pins, much like an HX711 load cell. It is cheap and popular for air pressure, cuff pressure demos and tank level via a tube. Readings are raw counts, so you calibrate offset and scale yourself.
Key specs at a glance
- Sensor
- MPS20N0040D piezoresistive bridge, 0 to 40 kPa gauge
- ADC
- HX710B, 24-bit, 10 or 40 samples per second
- Supply
- 3.3 to 5 V
- Interface
- Two wire: OUT (data) and SCK (clock), not I2C
- Port
- 3 mm barb for silicone tube
- Media
- Air only
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
What the HX710B air pressure sensor module is
The HX710B is clocked like the HX711: wait for OUT to go low, then pulse SCK 24 times to read the value, plus one or more extra pulses to set the next mode. The HX710B library or a short function does this.
40 kPa is about 4 m of water, so the module can measure tank level when a tube is pushed down into the water and the trapped air pressure is read at the top.
HX710B air pressure sensor module pinout
The pins on the HX710B air pressure sensor module and what each one does.
| Pin | Function |
|---|---|
| VCC | 3.3 to 5 V |
| GND | Ground |
| OUT | Data output |
| SCK | Clock input |
- VCC
- 3.3 to 5 V
- GND
- Ground
- OUT
- Data output
- SCK
- Clock input
Wiring the HX710B air pressure sensor module
Connect the HX710B air pressure sensor module like this.
| HX710B air pressure sensor module pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 3V3 |
| GND | GND | GND |
| OUT | D2 | GPIO 16 |
| SCK | D3 | GPIO 4 |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- OUT
- Arduino Uno:
- D2
- ESP32:
- GPIO 16
- SCK
- Arduino Uno:
- D3
- ESP32:
- GPIO 4
Example code
Find COUNTS_PER_KPA by applying a known pressure, such as a water column of known height (1 cm of water = 0.098 kPa). Average readings for a steady value.
const int OUT = 2, CLK = 3;
long offset = 0;
const float COUNTS_PER_KPA = 1.0e5; // calibrate for your module
long readHX710() {
while (digitalRead(OUT)); // wait for data ready
long v = 0;
for (int i = 0; i < 24; i++) {
digitalWrite(CLK, HIGH); delayMicroseconds(1);
v = (v << 1) | digitalRead(OUT);
digitalWrite(CLK, LOW); delayMicroseconds(1);
}
digitalWrite(CLK, HIGH); delayMicroseconds(1); digitalWrite(CLK, LOW); // 25th pulse: next read 10 Hz
if (v & 0x800000) v |= 0xFF000000; // sign extend
return v;
}
void setup() {
Serial.begin(9600);
pinMode(CLK, OUTPUT); pinMode(OUT, INPUT);
for (int i = 0; i < 10; i++) offset += readHX710();
offset /= 10; // zero with the port open
}
void loop() {
float kPa = (readHX710() - offset) / COUNTS_PER_KPA;
Serial.println(kPa, 2);
delay(200);
}Setup and tuning
take the offset with the port open to air.
a water column or a reference gauge gives a second point for the scale.
use soft silicone tube and check for leaks, which show as slow drift.
it will not appear on an I2C scanner.
What you need
Shop this list7 of 8 found in our store · ₹1,181
HX710B Air Pressure Sensor Module (0–40KPa) with Straight Pin Header: the part this guide coversHX710B Air Pressure Sensor Module (0–40KPa) with Straight Pin Header₹128
Generic HX710B Air Pressure Sensor Module (0-40 kPa) with Straight Header – Analog Voltage Output: another version this guide coversHX710B Air Pressure Sensor Module (0-40 kPa) with Straight Header – Analog Voltage Output₹163
Generic HX710B Pressure Sensor Module Interposer – 0-40 kPa, 3.3V/5V, SOP-16: another version this guide coversHX710B Pressure Sensor Module Interposer – 0-40 kPa, 3.3V/5V, SOP-16₹93- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
R385 diaphragm water pump 12V: a pump to control from the pressure readingR385 / R365 Diaphragm Water Pump 12V₹220Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- HX711 load cell amplifier: the same style of 24-bit ADC for weight.
- NXP MPX pressure sensors: analog sensors with a datasheet formula.
- MEMS pressure sensors: barometric I2C sensors.
Common mistakes to avoid
- Expecting calibrated kPa without calibration.
- Scanning for it on I2C.
- Letting water into the sensor port.
- Exceeding 40 kPa, which damages the bridge.
Frequently asked questions
Is it the same as HX711?
Similar protocol; the HX710B has a fixed gain and is used with this pressure sensor.
Can it measure blood pressure?
It can read cuff pressure in a demo; it is not a medical device.
What is 40 kPa in other units?
About 0.4 bar, 5.8 psi or 4 m of water.
Does it work on 3.3 V?
Yes.
Why is the reading negative?
The offset was taken under pressure, or the bridge is reversed; re-zero with the port open.
Parts for this guide
Projects that use it
Put this into practice: 1 step-by-step build in our project library uses parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

