Questions and answers on building a load-cell scale with an HX711: the Wheatstone bridge, calibration with a known mass, how much noise and drift to expect, and why temperature shifts the reading.
At a 5 V supply and a gain of 128, the full-scale input of an HX711 is plus or minus 20 millivolts, according to its datasheet. A load cell under real weight delivers a signal that fits inside that window, and the whole job of a kitchen-scale build is to read a few millivolts without drowning in noise.
The questions below are the ones readers tend to search when a first build misbehaves. Each answer leans on a manufacturer document, a library’s own source or a load-cell vendor’s reference, and where a number is only arithmetic, the text says so.
How does a load cell turn weight into a voltage?
A strain gauge changes resistance when it is compressed or stretched. As SparkFun explains, a typical load cell carries four of them wired as a Wheatstone bridge. Apply an excitation voltage across one diagonal, load the metal body, and the bridge unbalances; the difference between the two output wires is the signal.
That signal scales with the excitation. A Tacuna Systems datasheet guide gives an example: a 2.0 mV/V cell at 10 V excitation produces 20 mV at full capacity. At 5 V, the same cell would produce 10 mV by the same arithmetic, which uses half of the HX711’s gain-128 window.
Wire colors vary by maker, so read the cell’s own sheet. SparkFun’s typical scheme is red for excitation plus, black for excitation minus, white for output minus and green for output plus, with a yellow wire sometimes serving as a shield. If readings fall as weight rises, swap the two output wires.
What does the HX711 actually do?
It is a 24-bit analog-to-digital converter built for bridge sensors. It offers channel A at gain 128 (plus or minus 20 mV full scale) or gain 64 (plus or minus 40 mV), and channel B at a fixed gain of 32 (plus or minus 80 mV). Output rate is 10 samples per second with the RATE pin low and 80 with it high. The supply range is 2.6 to 5.5 V, and an on-chip regulator can power both the converter and the load cell.
A 24-bit label invites over-reading. Dividing the 40 mV span at gain 128 into 2^24 steps gives about 2.4 nV per code. The datasheet’s input noise at gain 128 is 50 nV rms at 10 SPS and 90 nV rms at 80 SPS. By that arithmetic, 50 nV spans roughly 21 codes, so the lowest several bits of each reading are noise, not weight.
The serial interface uses two pins, PD_SCK and DOUT. The count of clock pulses after a conversion selects the next one: 25 for channel A at gain 128, 26 for channel B at gain 32, and 27 for channel A at gain 64. Libraries hide this.
How do I read it from an Arduino?
The bogde/HX711 library wraps the protocol. Its header declares begin(byte dout, byte pd_sck, byte gain = 128), is_ready(), read(), read_average(byte times = 10), get_value(), get_units(byte times = 1), tare(byte times = 10), set_scale(float scale = 1.f) and set_offset(long offset = 0). Hardware wiring is the bridge to the E+, E-, A+ and A- terminals, then DOUT and SCK to two digital pins. Our Elegoo UNO R3 starter kit review covers one way to get the board.
Retail listings for load cells and HX711 boards are not linked here, since none could be checked against the retailer’s own product page. Search for a load cell with its rated capacity, a matching HX711 breakout and a rigid base.
By default the library runs in blocking mode and waits for the chip before returning a reading. If a loose wire might leave the converter silent, the README suggests wait_ready_timeout(1000), which returns false when the hardware is not ready in time, so the sketch can report a fault instead of freezing. For battery builds, power_down() and power_up() put the converter to sleep between readings.
How do I calibrate with a known mass?
The README’s recipe has five steps: call set_scale() with no argument, call tare() with nothing on the platform, place a known weight and read get_units(10), divide that reading by the weight, and pass the result to set_scale(), adjusting if needed.
#include "HX711.h"
const int DOUT_PIN = 3;
const int SCK_PIN = 2;
const float KNOWN_MASS_G = 500.0; // the reference mass you own
HX711 scale;
void setup() {
Serial.begin(115200);
scale.begin(DOUT_PIN, SCK_PIN);
scale.set_scale(); // no parameter: raw counts
scale.tare(); // zero with the platform empty
Serial.println("Place the known mass now.");
delay(10000);
float counts = scale.get_units(10);
Serial.print("Divider: ");
Serial.println(counts / KNOWN_MASS_G, 4);
}
void loop() {}
Suppose, with invented numbers, the 500 g reference reads 210,000 counts above the tare. The divider is 210,000 / 500 = 420 counts per gram. In the working sketch, scale.set_scale(420.0) followed by scale.tare() makes scale.get_units(10) return grams.
void loop() {
if (scale.is_ready()) {
Serial.println(scale.get_units(10), 1); // grams, 10-sample average
}
}
One reference mass fixes one point on the line. A second, different mass near the top of your intended range checks that the response is straight and tells you whether the divider needs a trim.
How much noise and drift should I expect?
Averaging helps. If the noise on each sample is random and independent, an average of 10 cuts it by about the square root of 10, a factor near 3.2. At 10 samples per second that costs one second per reading, a fair trade for a scale that only needs to settle once an object is placed. The 80 SPS rate is faster but noisier, going by the datasheet’s 90 nV figure against 50 nV.
Averaging cannot fix drift, which moves slowly. SparkFun cautions that a hobby-grade measurement can be off by plus or minus 5 percent from temperature, creep, vibration and drift together. Tacuna defines creep as the change in output under a constant load over time, listed on a datasheet as a maximum percentage of full-scale output over 30 minutes. A scale that settles upward while a heavy object sits on it is showing creep, not a software bug.
Read the spec sheet the way you would read the fine print on any measuring tool; our explainer on laser distance measurer accuracy walks through the same habit with a different instrument.
Why does temperature matter?
Because warmth changes the bridge output twice over. Interface, a load-cell maker, says temperature changes both the zero balance (output with no load) and the signal output, in either direction, and attributes the main strain-gage effect to the temperature coefficient of the modulus of elasticity of the force-bearing metal. Good cells are compensated by design; Interface quotes its own compensated range as 15 to 115 degrees Fahrenheit.
The two effects are not equally fixable. Per Tacuna, the zero shift can be removed by taring, because it appears even with no load. The span shift changes sensitivity and only shows up under load, so taring cannot cancel it. Tacuna’s example adds a zero effect and a span effect of 0.002 percent of full scale per degree Celsius each; across a 20 degree change that totals (0.002 + 0.002) × 20 = 0.08 percent of full scale.
Interface adds that when temperature changes during a test, zero and output can shift, and because the errors are repeatable they can be characterized and subtracted if the temperature effect on zero is known. For a home build, the practical takeaways are modest: let the electronics warm up before you tare, keep the cell out of sun and drafts, and re-tare when conditions change. The HX711 itself is specified for -40 to +85 degrees Celsius.
Parts list
- 20kg Load Cell Weighing Sensor Portable Electronic Kitchen Scale + HX711 AD Weighit Amplifier Module Pressure Sensor: A bar-style 20 kg load cell sold together with an HX711 amplifier board. See it on Amazon (affiliate link)
As an Amazon Associate I earn from qualifying purchases. A commission may be earned if you buy through this link, at no extra cost to you.
