
HX710B Air Pressure Sensor Library for Proteus Simulation

Hello friends, I hope you all are doing great. Today, I am going to share the new HX710B Air Pressure Sensor Library for Proteus Simulation. The HX710B module is a tiny board with a pressure sensor and a hose nipple on one side and four pins on the other. Inside, a bridge sensor turns the air pressure into a few millivolts and the HX710B, a 24-bit converter, turns those millivolts into a number for your microcontroller. With this library you can run a full Proteus simulation of that module, clock its 24 bits out with an Arduino, choose its channel and speed with the number of pulses, and see the limit that surprises almost everybody who buys one.
HX710B Air Pressure Sensor Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo is a water tank level gauge: a thin tube runs from the bottom of a tank to the sensor, and the water squeezes the air in the tube. An Arduino UNO V4.0 reads the pressure 40 times a second, turns it into centimetres and litres, shows them on a 16x2 LCD, lights LOW, OK and FULL LEDs - and says OVER RANGE when the converter runs out of numbers.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the water sensor board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the HX710B Air Pressure Sensor Library for Proteus Simulation:
What Is the HX710B Air Pressure Sensor Module?
The module carries two parts. The first is a gauge pressure sensor rated 0 to 40 kPa: a small 7 x 7 mm body with a round boss and a 3 mm hose nipple, so a soft tube of about 2.5 mm inside diameter pushes onto it. Inside is a silicon diaphragm with four resistors in a bridge. The pressure bends the diaphragm, the bridge goes out of balance and a small voltage appears across it - 50 to 100 mV for the full 40 kPa with 5 V on the bridge. The sensor measures the pressure against the air around it, and it is made for clean, dry air - never water.
The second part is the HX710B, a 24-bit analog-to-digital converter in an 8-pin package with an amplifier of gain 128 in front. It is a smaller cousin of the HX711 that weighs things in our HX711 Load Cell Library for Proteus. The board itself is about 18.6 x 13.5 mm with a 4-pin header: VCC, OUT, SCK and GND. It runs on 3.3 V or 5 V and draws about 2 mA.
Ratiometric by Design
The bridge is fed from VCC, and the converter uses the same VCC as its reference. If the supply drops by 5 %, the bridge's output drops by 5 % and so does the reference, so the number stays the same. That is why the module reads the same on 3.3 V as on 5 V.
The Two-Wire Protocol
The HX710B is not I2C or SPI, even though one wire is called SCK. It has its own simple protocol:
- OUT HIGH means the converter is busy. Keep SCK low.
- OUT goes LOW when a new result is ready.
- 24 pulses on SCK bring the result out, most significant bit first. Each bit appears on OUT just after a rising edge.
- 1 to 3 more pulses - 25, 26 or 27 in all - choose what the NEXT conversion measures. The 25th rising edge also pulls OUT high again.
- The result is a 2's complement number from 0x800000 to 0x7FFFFF: bit 23 is the sign.
25, 26 or 27 Pulses
This is the main difference from the HX711. On the HX710B the pulse count chooses both the input and the speed:
- 25 pulses: the sensor (the differential input), 10 results a second.
- 26 pulses: DVDD minus AVDD - the difference between the chip's two supply pins, 40 a second. It is meant for battery checks; on this module both pins sit on VCC, so it reads near zero.
- 27 pulses: the sensor again, 40 results a second.
After power-up and after every change of input or speed, the converter needs 4 data periods to settle - 400 ms at 10 Hz, 100 ms at 40 Hz - and OUT stays high until then. Two more rules: each SCK high time should stay under 50 us, and if SCK stays high for more than 60 us the chip powers down. When SCK goes low again it resets and settles once more.
The Limit Nobody Mentions
With gain 128 the converter's full scale is +-0.5 x VREF / 128 - only +-19.53 mV on 5 V. The sensor gives up to 100 mV at 40 kPa and may have an offset of up to 25 mV. So the converter saturates long before the sensor's limit: with a typical sensor (a 4.6 mV offset and 1.69 mV per kPa) the number hits 0x7FFFFF at about 8.8 kPa - roughly 90 cm of water or 66 mmHg. The 40 kPa on the label is the sensor's range, not the module's. Some sellers even list the module as -10 to +10 kPa, which is closer to the truth.
Features of the HX710B Library
- A real-looking module: the board at its true size with the sensor, its nipple, the HX710B and the header; at Run rings of dots around the nipple grow with the pressure and turn red when the converter saturates.
- The protocol of the datasheet: OUT high while busy, low when ready, the bits on SCK rising edges, the 25th edge pulling OUT high.
- The pulse count: 25, 26 and 27 pulses choose the next conversion; a wrong count is reported as an error.
- Settling and power-down: 4 periods after every change, a power-down when SCK stays high over 60 us.
- Gain 128 and saturation: the code sticks at 0x7FFFFF or 0x800000 outside +-19.53 mV.
- Any sensor: OFFSET and SENS set the bridge's zero and slope; the pressure comes from the DEMO tank or a STEADY value.
- A pop-up: the pressure in kPa, mmHg, cm of water and psi against the converter's window, the last 24-bit read bit by bit; graphs, an event log and a check page.
- A complete package: about 2.7 MB with the library, our I2C LCD, resistors, LEDs and buzzer, our Arduino UNO V4.0 and the demo, without the source code of the model.
The HX710B in Proteus
The device is HX710BTEP in TEPHX710B.LIB, under Modules > Sensors, with the model TEPHX710B.DLL. Search HX710B or pressure in Pick Devices. Its four pins are the header of the real board. Four properties set it up: PROFILE (DEMO or STEADY), PRESSURE (kPa for STEADY), OFFSET (the bridge's output at 0 kPa, mV at 5 V) and SENS (mV per kPa at 5 V).
Download HX710B Air Pressure Sensor Library for Proteus Simulation
Click the button below to download HX710B-Air-Pressure-Sensor-Library-for-Proteus-v1.0.zip (about 2.7 MB, without the source code of the models):
HX710B Air Pressure Sensor Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPHX710B.LIB,TEPI2CLCD16X2.LIB,TEPRESISTOR.LIB,TEPLED5MM.LIB,TEPBUZZER.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPHX710B.DLL,TEPLCD.DLL,TEPRESISTOR.DLL,TEPLED5MM.DLL,TEPBUZZER.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (Wire only).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install HX710B Air Pressure Sensor Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPHX710B.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for HX710B.
Proteus Simulation of a Water Tank Level Gauge
A water level by air pressure is an old trick. Dip a tube to the bottom of a tank and close its top at the sensor: as the water rises, it pushes into the tube and squeezes the air above it, and the air pressure equals the depth of the water - 1 kPa for every 10.2 cm. The sensor stays dry and out of the tank, and nothing in the water can corrode. Our demo tank is 100 cm tall and holds 500 litres, 5 litres per centimetre.
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0. The module (U1) has OUT on D2 and SCK on D3. A 16x2 LCD from our I2C LCD 16x2 Library for Proteus sits on the I2C bus at 0x27; three LEDs on D5 to D7 show the level - green FULL from 80 cm, yellow OK, red LOW under 20 cm - and BZ1 from our Active Buzzer Library for Proteus on D8 beeps. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open HX710B-Tank-Level-ArduinoUnoV4.pdsprj.
The DEMO pressure is a recorded run of such a tank, played in fast time: it fills, stays full, drains, sits low and is then filled to the brim - past the point the module can measure.
The Sketch
One function does the whole protocol. It waits for OUT to go low, then gives the pulses with the interrupts off, so that no SCK pulse ever gets near the 60 us power-down:
while (digitalRead(HX_OUT) == HIGH) {} // OUT low = a new result is ready
digitalWrite(HX_SCK, HIGH); delayMicroseconds(1);
if (i < 24) v = (v << 1) | digitalRead(HX_OUT); // each bit comes after a rising edge, MSB first
digitalWrite(HX_SCK, LOW); delayMicroseconds(1);
Bit 23 is the sign, so a negative reading needs its top byte filled with ones:
if (v & 0x800000) v |= 0xFF000000; // bit 23 is the sign (2's complement)
At start-up the sketch uses the pulse count to read the supply check, then switches to the sensor at 40 Hz. Notice that each read chooses the next one:
hxRead(26); // the power-up result (10 Hz); 26 pulses: next, the supply check
const long supply = hxRead(27); // DVDD - AVDD; 27 pulses: next, the sensor at 40 Hz
Then it tares: 16 readings with the tank empty give the zero, and the sketch works out how deep the water can go before the converter saturates. Every loop averages four results - ten levels a second - and turns them into centimetres with a calibration constant, 71,183 counts per cm of water. If any of the four results is 0x7FFFFF, the level is not shown at all: the sketch says OVER RANGE.
HX710B Simulation Results
Open the project and press Run. The demo runs 6.6 simulated seconds and took about 2 minutes 35 seconds on our PC with the pop-up open and the pictures being taken. Click U1 for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Start-Up: Settling, the Supply Check and the Zero
At power-on the HX710B starts at differential 10 Hz and settles for four periods: OUT stays high until 401 ms. The sketch's first read ends with 26 pulses, so the next conversion is the supply check at 40 Hz - another 100 ms of settling - and the read after that ends with 27 pulses, which switches to the sensor at 40 Hz with its own 100 ms of settling. The Event log shows the three changes at 401.8 ms, 502.5 ms and 602.5 ms. The supply check reads -62 counts: zero plus the converter's noise, because both supply pins sit on VCC. Then 16 readings with the tank empty give the zero, 1,975,682 counts. That is the sensor's own offset - 4.6 mV of the 19.53 mV full scale - and it tells the sketch how much room is left: (8,388,607 - 1,975,682) / 71,183 = 90.1 cm of water before the converter saturates. At 1.01 s the monitor prints "LOW at 0.0 cm": the tank is empty, the red LED lights and the buzzer beeps.
Filling
From 1.2 s the tank fills. At 1.64 s the level passes 20 cm and the monitor prints "OK at 23.8 cm" with the yellow LED. The pop-up at 1.8 s shows 3.02 kPa - 22.6 mmHg, 30.8 cm of water - and the last 24-bit read bit by bit: 4,082,575 counts, taken a few milliseconds earlier while the water was still rising. At 2.14 s the monitor reads raw 5,494,425: 49.4 cm, 247 litres. On the sheet, the rings of dots around the nipple grow with the pressure.
Full
At 2.76 s the monitor prints "FULL at 81.1 cm": the green LED lights and the buzzer gives a short beep. The tank stays at 82.0 cm, and the pop-up at 3.0 s shows the arithmetic: the code 7,812,693 / 8,388,608 x 19.531 mV = 18.190 mV at the input; minus the 4.6 mV offset that leaves 13.59 mV, and 13.59 / 1.69 = 8.04 kPa = 82.0 cm of water. The sketch gets the same from its side: (7,812,693 - 1,975,682) / 71,183 = 82.0 cm. The LCD shows "Level 81.1 cm" and "405L 81% FULL" from its last update.
Draining and Low
From 3.2 s the tank drains. At 3.29 s the monitor prints "OK at 75.9 cm" and the yellow LED takes over. The pop-up at 3.9 s reads 4.21 kPa, 42.9 cm and the code 5,122,332; the monitor at 4.19 s shows raw 3,779,145, 25.3 cm, 127 litres.
At 4.31 s the level falls under 20 cm - "LOW at 18.7 cm" - with the red LED and a longer beep. The tank sits at 15.0 cm: the pop-up at 4.55 s shows 1.47 kPa, 11.0 mmHg, the code 3,043,418 and 7.086 mV from the bridge.
Over the Range
From 4.7 s the tank is filled again, this time to the brim: "OK at 25.1 cm" at 4.81 s, 54.3 cm at 5.21 s, "FULL at 85.1 cm" at 5.64 s - and at 5.74 s "OVER RANGE: the ADC at 0x7FFFFF - the water above 90.1 cm". The Event log shows the moment: at 5.753 s and 8.97 kPa the bridge gives 4.6 + 1.69 x 8.97 = 19.76 mV, past the 19.53 mV full scale. The pop-up at 5.95 s turns red: 9.32 kPa - 95.0 cm of water, 69.9 mmHg - while the read is 0x7FFFFF, bit 23 clear and every other bit set. Without the check, the sketch would show 90.1 cm for any level above that; with it, the LCD says "Level >90.1 cm" and "OVER RANGE!", the red LED flashes and the buzzer beeps.
From 6.1 s the overflow drains back to 85 cm. At 6.34 s the average of four is already below the limit - 8,355,173, 89.6 cm - but one of the four results is still 0x7FFFFF, so the sketch keeps saying OVER RANGE; at 6.44 s all four are inside and the monitor prints "back in range at 87.7 cm". The pop-up at 6.6 s shows 8.34 kPa, 85.0 cm, the code 8,059,001 - and TIMES SATURATED 1.
The Graphs, the Event Log and the Check Page
The Graphs page plots the true pressure, the converter's code, the water level and a flag for saturation. The code follows the pressure in a straight line until it flattens at 8.39 million - the saturation is easy to see as a plateau while the pressure keeps rising. The Event log lists the settling, every change of channel and the saturation. The Check page sums up the run: the supply at 5.00 V, ratiometric; 237 reads, the last with 27 pulses, and no communication errors; the longest SCK high time 11.4 us, far under the 50 us limit, and no power-downs; the converter saturated once - on this module its range ends at 8.8 kPa, 90 cm of water, not at 40 kPa; and 242 conversions at differential 40 Hz.
The Arduino's built-in serial monitor prints the supply check and the zero at start-up, then a line every second - the time, the raw average, the level and the litres - and a line of its own for each change of state: LOW, OK, FULL, OVER RANGE and back in range. Its times come from millis(), which starts when the sketch starts, a few hundredths of a second after the simulation does.
HX710B or HX711?
Both chips use the same idea: OUT low when ready, 24 bits on SCK, extra pulses for the next conversion. The HX711 in our HX711 Load Cell Library for Proteus has two inputs and three gains (128 and 64 on channel A, 32 on channel B), and 25, 26 or 27 pulses choose among them. The HX710B has one input and one gain, and its pulses choose the speed and the supply check instead. An HX711 library will read an HX710B, but its "gain 32" setting reads the supply difference, not the sensor.
Which Pressure Sensor?
For small air pressures - a tube in a tank, a breath, a bottle - the HX710B module is cheap and very sensitive. For water pressure in a pipe, many bar, the stainless transducer in our Water Pressure Transducer Library for Proteus is the right part. For the weather and altitude, a barometric sensor such as the one in our BMP280 Library for Proteus measures the absolute air pressure around it.
Try It Yourself
- Click U1 while the simulation runs and use the chips: 5 kPa shows about 51 cm, 12 kPa saturates the converter at once, 0 kPa brings the tank back to empty.
- Set OFFSET to -10: the zero moves far below 0, and the module can now measure up to about 17 kPa before it saturates.
- Change hxRead(27) to hxRead(25) in loop(): every read takes 100 ms instead of 25 ms, and the level updates only 2.5 times a second.
- Read 28 pulses: the Event log reports a communication error and the read is dropped.
- Add delayMicroseconds(80) while SCK is high: the first long pulse powers the chip down and SCK falling resets it, so the readings turn to nonsense - the Event log and the Check page count the power-downs.
Ideas to Extend the Demo
- Control a pump or a valve: fill the tank when it is LOW and stop when it is FULL.
- Use a bubbler instead of a closed tube: a small air pump pushes a slow stream of bubbles out of the tube's end, so the tube never fills with water.
- Measure your breath: blow gently into the tube and plot the pressure.
- Choose a sensor with less output, or set OFFSET negative, to use more of the converter's range.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real HX710B Module
- Air only: never let water reach the sensor; keep the top of the tube above the tank.
- Tare every time: the zero differs from module to module and drifts with the temperature - about 0.035 kPa per degree.
- Calibrate: the slope varies from sensor to sensor; use a known depth of water or a manometer.
- The range: plan for about 9 kPa, not 40 kPa.
- A closed tube leaks: air slowly dissolves in the water; lift the tube out now and then to refill it with air.
Troubleshooting
- The sketch hangs at the start: OUT never goes low - check OUT, SCK and the supply.
- It reads about 2 million with nothing on the nipple: that is the sensor's offset - tare it.
- The code is always 8388607: the pressure is past the converter's range.
- The readings freeze: an SCK pulse lasted over 60 us and the chip powered down - keep the interrupts off while reading.
- The part is not simulated:
TEPHX710B.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The protocol, the pulse counts, the rates, the settling, the power-down, gain 128 and the saturation follow the HX710A/B datasheet; the board is our own drawing.
- Our own figures: OFFSET 4.6 mV and SENS 1.69 mV per kPa as defaults, 21 counts rms of noise at 10 Hz and 43 at 40 Hz, the supply check at 0, and the reset to 10 Hz after a power-down (the datasheet copies disagree here).
- The DEMO is a recorded tank in fast time.
- Not modelled: the sensor's temperature drift, its non-linearity and hysteresis, damage above 120 kPa.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the makers of the HX710B or the sensor.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the HX710B Air Pressure Sensor Library for Proteus Simulation. I hope it helps you measure small pressures - and know where the module's range really ends. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!























Comments
0