HX711 noise-free resolution tests


Note added in 2020, based on this thread. Board 1 also does not have E- grounded, so the on-board voltage regulator does not work properly. That may explain some of the differences with Board 2.


Thought I’d share results of tests I did on two HX711 boards using a barebones Arduino and different power sources. Each test consisted of taking 10,000 samples and then processing the reads as indicated.

Quick summary: looks like this 24 bit ADC will give about 14 to 15 noise-free bits. Maybe 16 if you’re careful with grounding and shielding and use a very low noise power supply and sensor.

These tests do not reflect degradation that occurs due to creep, hysteresis, gain errors, etc. except to the extent that any time-related effects (e.g., creep) occurred during sampling (10000 samples at 10 sps takes about 17 minutes).

The most significant physical difference between the boards seems to be that Board 1 has no copper ground fill and is not shielded, whereas Board 2 has fill and is shielded.

At 10 sps, Board 2 has significantly better “inputs grounded” resolution than Board 1 (see row 8 ), but with a load cell attached, they have approximately the same resolution (see rows 9 and 10 ). There’s one significant exception (see far right column with “24v/MAX” power source).

Capture.JPG

Notes:

A. ebay seller = kingfull-electronic-company

B. Board 2 has copper ground fill; board 1 has none.

C. Board 2 has metal shield, user-installed

D. Board 1 has the rate pin tied low (with great care, perhaps it could be de-soldered and tied high, to switch it from 10 Hz to 80 Hz.) Board 2 has the rate pin tied high, but it has a jumper that can be soldered closed to take it low.

E. Both HX711 inputs (A- and A+) tied to ground - best case scenario for noise

F. HX711 inputs connected to a four-wire load cell hacked from an American Weigh Scales 200 gr scale; no load on the load cell during sampling.

G. power sources
wall wart = 5v switch-mode power supply

bat/7805 = 9 v battery thru 7805 powers HX711 and 328p

USB = USB power from laptop computer thru FTDI powers both

bat/ADR02 = HX711 powered by 9 v battery through ADR02,
a low-noise regulator by Analog Devices (surface mount);
328p is powered by a 5 v wall wart.

24v/ADR02 = HX711 powered by 24v wall wart through ADR02,
a low-noise regulator by Analog Devices;
328p is powered by a 5 v wall wart.

24v/MAX = HX711 powered by 24v wall wart through MAX6350,
a low-noise reference by Maxim in DIP form, but the
328p is powered by 24v wall wart thru Murata
a 78SR-5/2-C 5v 2amp dc-dc converter. This will be my
my project’s power source.

H. the number 2 raised to the power of (NFR load cell); gives the noise free resolution, expressed in terms of the ADC “count” (versus the max achievable = 2^24 =16,777,216), rounded to the nearest thousand.

Abbreviations:
Hz = sloppy for samples per second
n/t = not tested
n/a = not applicable
NFR = Noise-Free Resolution = 24-log(6.6 x rms noise) (log is to base 2)
rms noise = std dev of ADC count
USD = United States dollars

Other remarks:

From the HX711 datasheet: input noise at 10 Hz = 40 uV (rms) and at 80 Hz = 90 uV (rms), so the resolution of board 2 at 80 Hz is expected to be worse (and it is, with the inputs shorted to ground) [see comment, below].

The 328p is on a breadboard and has 0.1uF caps close to the DVCC and AVCC pins. There are also 0.1uF caps and 1 uF tantalum caps on each rail of the breadboard. When using the wall wart, the HX711 was fed thru a 10uH inductor.

Interesting that Board 2 “inputs grounded” resolution is the same regardless of power source.

Comment added much later…shorting inputs to ground violates the common mode range: common mode shouldn’t go lower than AGND+1.2v. Not sure what effect that has on the results.

Is this all at full bandwidth? What is the source impedance of the load-cell?

The load cell is a 1125 ohm unit with a 0.9mV/V sensitivity (previously said 1.1 mV/V was an error).

As described in note E, the HX711 was first tested with both inputs shorted to ground. That shows approximately the best resolution that the HX711 is capable of delivering under the circumstances. The second test (note F) was with the load cell attached, but with no load on the cell. Testing with no load is also a "best case" scenario, since it eliminates (mostly) creep and nonlinearities (gain and hysteresis errors) that occur with load on a load cell.

As a point of reference: Here is an example of results for another 24 bit ADC, the AD7780 (see that doc's Table 8 ). At 10 sps, a gain of 128, and a differential input of 0 volts (same as my tests), the AD7780 has a noise-free resolution of about 18 bits.

I should have added that this was intended to be a test of the hardware only. It might be possible to improve resolution using the averaging and decimation techniques described here.

Thanks, Dave Evans

I've been fighting a long time HX711 module with 4 load cells (50 kg each) of a bathroom scale, and thought something was wrong. I show readings in raw binary format on the serial console, and check that the last bits 8-9 are not stable. I put the module in a metal box connected to ground, close to the load cells, but does not improve much. The power source is a solar power bank.

I will use the first 16 bits: a maximum weight of 200 kg, 200000/65535 = 3 grams resolution, are the calculations right?

It depends on how much of the HX711 “bandwidth” you are using. If zero to full load on your cells is using half of the ADC’s capability, and if you are really getting 16 noise-free bits out of the ADC, then your noise-free resolution would be about 6 grams, not 3 grams.

You can use this formula to estimate the noise-free resolution: (full scale load) / ((2^bits)0.128S) where bits = noise-free bits and S=load cell sensitivity in mV/V, provided that the gain is 128 (the usual for HX711 channel A), S is less than 3.9 (so 0.128*S<0.5), and no load on the scale produces a differential voltage (across A+ and A-) of approximately zero (that is, you’re using half of the ADC’s full range).

If those conditions are true, then in your case with full scale load = 200,000 gr, bits = 16, and S=3.9 mV/V, then the noise-free resolution would be 6 gr, or 1/32,000 of full scale. For another example, if in fact bits=14 and if S=1mV/V, then NFR=95 gr, or 1/2,000 of full scale.

Also, as I mentioned in my first post, there are lots of other sources of error to consider. Achieving an accuracy of 1/20,000 or better is, according to this document, very difficult. To learn more, read that doc and Google ADC errors.

Replaced the table that disappeared from my first post...

Thanks for sharing this !

I noticed a heavy thermal drift with the boards (the green one) i'm testing. Even with both inputs grounded, i could use the output as a thermometer !

Did you notice that also ?

My graphs : http://www.egloff.eu/apaguard/apaguard_graph.php

Click on "3days" to see the thermal behavior. Even small temperature variations are causing a weight drift.

Patrick,

The tests in my original post on this thread were fast (17 minutes at the most), so temperature drift was not an issue. However, this post shows temperature effects in some of my longer tests (see posts 5 and 7).

Thanks,

I see you had same issues... You said, you started to work on compensation.

Did you succeed ? I also wanted to do that, but the variations are quite erratic, so it seemed difficult to me. And i have no knowdledge in this domain.

Cheers,

The following image shows how I did my temperature corrections.

I took a lot of samples at various temperatures at 0 grams (no load), 100 grams, and 200 grams (full scale). Then I plotted deviation from actual weight vs temperature - that’s what the first set of graphs below show. The effect of temperature is obvious.

Then I used Excel to fit straight lines through the point clouds.

In my “production” project, when I take a weight reading, I also take a temperature reading. Then I use two of the lines to “correct” the weight reading to 65 deg F (e.g., if the “raw” weight is 85 grams, then I’d use the 0 gram and 100 gram lines), and then I interpolating to get a single corrected weight.

I’m not especially happy with the results. Subsequent tests showed that it improves accuracy somewhat, but not as much as I’d hoped.

TempCorrSummary.JPG

The following graphs are my “check” of the “corrected” results - not so great:

TempCorrCheck.JPG

Thanks for this,

Has someone used a moving averaging of the results from the HX711 library ?

The included averaging methode is only a mean averaging and can probably be improved ..

Thanks

You could just do it yourself, starting with code like this (essentially from the HX711 datasheet) for one read, and using one of the simple smoothing techniques easily found by googling arduino smoothing, or a smoothing library if you really think something more complex is necessary.

void readADC() {

  count = 0; 

  while(digitalRead(pinDAT));  // wait until goes low (when data is ready)

  // then get 24 bits, MSB first
  for(byte i=0;i<24;i++)
  {
    digitalWrite(pinCLK, HIGH);   
    count=count<<1; 	          // shift left, zero goes into LSB; 1st time thru just shifts all zeros
    digitalWrite(pinCLK, LOW); 
    if(digitalRead(pinDAT))       // read a bit; if high, change count LSB to 1
      count++;
  }
  digitalWrite(pinCLK, HIGH);   // channel A w/ 128 gain
  count=count^0x800000;         // convert two's comp (see notes below)
  digitalWrite(pinCLK, LOW);    // leave clock low
  // two's comp min = 0x800000 = -8388608 converted = 0
  // two's comp zero = 0x000000 = 0000000 converted = 2^23 = 8,388,608
  // two's comp max = 0x7FFFFF = +8388607 converted = (2^24)-1 = 16,777,215
  // 0x means the following number is hexadecimal
}

DaveEvans:
You can use this formula to estimate the noise-free resolution: (full scale load) / ((2^bits)0.128S) where bits = noise-free bits and S=load cell sensitivity in mV/V, provided that the gain is 128 (the usual for HX711 channel A), S is less than 3.9 (so 0.128*S<0.5), and no load on the scale produces a differential voltage (across A+ and A-) of approximately zero (that is, you’re using half of the ADC’s full range).

Hey everyone
,
I realice that this is an old topic, but because it’s so interesting I’ll try anyway. I’m trying to understand the formula for the noise-free resolution estimation in the quote, but I’m at a loss.

I have a load cell with 1000g capacity, S=2mV/V sensitivity and I use U=5V excitation voltage. I also presume that my HX711 has bits=14 noise-free bits. When my HX711 has a gain of 128, then voltage after the amplifier is SU128=1280mV at full load. If the reference voltage of the HX711 is 2500mV (is it?), then I utilize 1280mV/2500mV=51% of the ADC’s full range. Am I correct? Wouldn’t then the noise-free resolution be 1000g/((2^bits)*51%)=0.12g? Using the formula from DaveEvans in the quote I get 0.24g.

I’m sure I misunderstand something and would be very greatful if someone could enlighten me :slight_smile:

Jarl

P.S
I haven’t bought a HX711 yet, but what I need/ want is a scale with 1000g capacity and a ±0.3g accuracy. Is this realistic with the numbers I presented above?

In many applications, and the one my formula is based upon (as noted), load cells only use half, or less, of the available range, because they output a differential voltage that goes from approximately zero volts at no load to some maximum voltage at full load.

At a differential voltage of zero volts, the ADC will output half of its full count; for the HX711, that's about 2^24 divided by 2.

And, the ADC will output either zero or its full count (about 2^24 for the HX711) when a certain maximum differential voltage is applied to the sense inputs (if you switch the sense wires, you'll change whether you get zero or full count).

So if you have a load cell that has a sufficiently large sensitivity ("S" in the formula) to output exactly the maximum differential under full load, then the best possible resolution you can get is half of the full range, or full load divided by ((2^24) * 0.5), and that, of course, will not be "noise free."

But if you have a load cell with lower sensitivity, so it outputs less than the maximum differential voltage under full load, then the resolution will be even larger (worse)...note that "S" is in the denominator...so smaller (worse) sensitivity results in larger (worse) resolution...which makes sense.

To estimate the "noise free resolution," raise 2 to the assumed number of noise free bits (instead of 24 in the examples above). "Assumed" is italicized because it's a difficult number to pin down.

BTW, the HX711 has an on-board regulator that puts out an excitation voltage about 4.3 v, not 5v.

The maximum differential (which will cause the HX711 to output zero or about 2^24) is approximately plus or minus 17 mV (from half of 4.3 v divided by the 128 gain).

Your cell, with a sensitivity of 2 mV/V, will output a differential of about 9 mV at full load (2 mV/V times 4.3 volts excitation), so you will only be using about a quarter of the full range (half of the half range)...

Thanks a lot DaveEvans for your good explanation. I have now ordered a HX711,I'm looking forward to testing it :)

Thanks a lot, Dave. I am ordering an HX771 with a 'high precision' version of the load cell, according to the seller, who also sells a 'normal' lower precision load cell. I will refer to your post once i get delivery of the HX771 with the load cell and start experimenting with it to get meaningful and useful values to estimate the actual weight.

Hi all,

I want to thank to DaveEvans for his post that has served me as an introduction into the world of ADC and loadcells.

I am just a noob with no background in any engineering related experience but eager to learn in a sideproject hobby.

I've got in my hands some different HX711 boards (4 different models), some Max6350 and loadcell TAL221. As said my knoledge is quite low but I am willing to run my own test to complement the great DaveEvans post

Attached to this post you will find diferent pictures of the "ingredients" I have:

1.- HX711 Purple (marked with V10, seems a clone of the Sparkfun V10 breakboard)
2.- HX711 Red with shield (marked as J1 on bacside)
3.- HX711 Green "small" (marked with XFW-HX711)
4.- HX711 Green "big" (no identificative marks)
5.- Max6350 SOP8
6.- TAL221 Loadcell TAL221 DATASHEET PDF
7.- Arduino Uno, Mega, Breadboard, Usb power supply, 9v bat....

As said I would like to add more information for the community but I my knoledge is limited so I would appreciate very much some of you can:

a) Suggets wiring tips that would bring best results and wiring combinations about the Max6350 and other power supply.
b) One thing I dont understand is how to achieve the "number" of bits that each breakout board can get. Is is there any sketch that could be used to perform the readings, calculate the number of bits... should I use the bodge/hx711 library? Some sketch that I could use would be great.

From my knoledge I am just missing the Sparkfun breakout board and maybe some chinese variations but this could be a good knoledge base with the idea of find the best option to obtain the maximum number of bits Noise Free.

I am open for other suggestions. I look forward for hear from you all.

My best regards,

DaveEvans:

Note added in 2020, based on this thread. Board 1 also does not have E- grounded, so the on-board voltage regulator does not work properly. That may explain some of the differences with Board 2.


Thought I'd share results of tests I did on two HX711 boards using a barebones Arduino and different power sources. Each test consisted of taking 10,000 samples and then processing the reads as indicated.

Quick summary: looks like this 24 bit ADC will give about 14 to 15 noise-free bits. Maybe 16 if you're careful with grounding and shielding and use a very low noise power supply and sensor.

These tests do not reflect degradation that occurs due to creep, hysteresis, gain errors, etc. except to the extent that any time-related effects (e.g., creep) occurred during sampling (10000 samples at 10 sps takes about 17 minutes).

The most significant physical difference between the boards seems to be that Board 1 has no copper ground fill and is not shielded, whereas Board 2 has fill and is shielded.

At 10 sps, Board 2 has significantly better "inputs grounded" resolution than Board 1 (see row 8 ), but with a load cell attached, they have approximately the same resolution (see rows 9 and 10 ). There's one significant exception (see far right column with "24v/MAX" power source).

Notes:

A. ebay seller = kingfull-electronic-company

B. Board 2 has copper ground fill; board 1 has none.

C. Board 2 has metal shield, user-installed

D. Board 1 has the rate pin tied low (with great care, perhaps it could be de-soldered and tied high, to switch it from 10 Hz to 80 Hz.) Board 2 has the rate pin tied high, but it has a jumper that can be soldered closed to take it low.

E. Both HX711 inputs (A- and A+) tied to ground - best case scenario for noise

F. HX711 inputs connected to a four-wire load cell hacked from an American Weigh Scales 200 gr scale; no load on the load cell during sampling.

G. power sources
wall wart = 5v switch-mode power supply

bat/7805 = 9 v battery thru 7805 powers HX711 and 328p

USB = USB power from laptop computer thru FTDI powers both

bat/ADR02 = HX711 powered by 9 v battery through ADR02,
a low-noise regulator by Analog Devices (surface mount);
328p is powered by a 5 v wall wart.

24v/ADR02 = HX711 powered by 24v wall wart through ADR02,
a low-noise regulator by Analog Devices;
328p is powered by a 5 v wall wart.

24v/MAX = HX711 powered by 24v wall wart through MAX6350,
a low-noise reference by Maxim in DIP form, but the
328p is powered by 24v wall wart thru Murata
a 78SR-5/2-C 5v 2amp dc-dc converter. This will be my
my project's power source.

H. the number 2 raised to the power of (NFR load cell); gives the noise free resolution, expressed in terms of the ADC "count" (versus the max achievable = 2^24 =16,777,216), rounded to the nearest thousand.

Abbreviations:
Hz = sloppy for samples per second
n/t = not tested
n/a = not applicable
NFR = Noise-Free Resolution = 24-log(6.6 x rms noise) (log is to base 2)
rms noise = std dev of ADC count
USD = United States dollars

Other remarks:

From the HX711 datasheet: input noise at 10 Hz = 40 uV (rms) and at 80 Hz = 90 uV (rms), so the resolution of board 2 at 80 Hz is expected to be worse (and it is, with the inputs shorted to ground) [see comment, below].

The 328p is on a breadboard and has 0.1uF caps close to the DVCC and AVCC pins. There are also 0.1uF caps and 1 uF tantalum caps on each rail of the breadboard. When using the wall wart, the HX711 was fed thru a 10uH inductor.

Interesting that Board 2 "inputs grounded" resolution is the same regardless of power source.

Comment added much later...shorting inputs to ground violates the common mode range: common mode shouldn't go lower than AGND+1.2v. Not sure what effect that has on the results.