Help Needed: HX711 Raw Value Calculation Issues

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
KBENABDI
New user
Posts: 3
Joined: 30 Oct 2024, 13:33

Help Needed: HX711 Raw Value Calculation Issues

#1 Post by KBENABDI » 30 Oct 2024, 13:38

I'm trying to understand how the HX711 works and I'm facing some challenges. I recently conducted tests using a 5 kg load cell and applied standard weights while measuring the voltage across the strain gauge for each weight.

Here's a summary of my procedure:

Connection of the Load Cell: I connected the wires of the load cell as follows:
Excitation terminals to E+ and E-
Output terminals to A+ and A- of the HX711.

Voltage Measurement: I measured the voltage across the gauge for each applied weight.

Retrieval of Raw Values: I then connected the load cell to the HX711 circuit and retrieved the raw values corresponding to the same weights used previously.

However, when I calculated the raw values using the following formulas, I found values that were very different from those measured:

Amplification Formula:
Vout=Gain×Vin(with Gain = 128)


Analog-to-Digital Conversion Formula:
Raw Value=(VrefVout)×(2n−1)


Could anyone clarify this discrepancy in results? Does the HX711 use a different method for amplification or signal conversion?

Thank you for your help!

bidrohini
Normal user
Posts: 127
Joined: 03 Nov 2022, 16:24

Re: Help Needed: HX711 Raw Value Calculation Issues

#2 Post by bidrohini » 30 Oct 2024, 13:46

Calibration becomes essential since each HX711 setup can vary due to factors like gain precision and slight variations in the reference voltage. You can record the raw values for known weights. Then you can use these as calibration points to linearly map raw values to weights.

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Help Needed: HX711 Raw Value Calculation Issues

#3 Post by Ath » 30 Oct 2024, 13:53

To account for the differences in each HX711 chip and each load-cell, please use the calibration settings to get best results. You might need to adjust the calibration from time to time, and, f.e. depending on load-cell temperature changes, that can be quite often. It will probably depend on the environmental circumstances your load-cells are in.
/Ton (PayPal.me)

KBENABDI
New user
Posts: 3
Joined: 30 Oct 2024, 13:33

Re: Help Needed: HX711 Raw Value Calculation Issues

#4 Post by KBENABDI » 30 Oct 2024, 13:57

bidrohini wrote: 30 Oct 2024, 13:46 Calibration becomes essential since each HX711 setup can vary due to factors like gain precision and slight variations in the reference voltage. You can record the raw values for known weights. Then you can use these as calibration points to linearly map raw values to weights.

Thank you for your response. I understand that calibration is important due to variations in the HX711 setup. However, my question specifically relates to the discrepancies I observed between the calculated raw values and the values I measured with known weights.

Could you provide insights on how the HX711 processes the input signals, or why my calculations might not match the measured values? Any clarification on the internal workings or potential factors that could lead to these discrepancies would be greatly appreciated.

KBENABDI
New user
Posts: 3
Joined: 30 Oct 2024, 13:33

Re: Help Needed: HX711 Raw Value Calculation Issues

#5 Post by KBENABDI » 30 Oct 2024, 14:00

Ath wrote: 30 Oct 2024, 13:53 To account for the differences in each HX711 chip and each load-cell, please use the calibration settings to get best results. You might need to adjust the calibration from time to time, and, f.e. depending on load-cell temperature changes, that can be quite often. It will probably depend on the environmental circumstances your load-cells are in.


Thank you for your input. I understand the importance of calibration and how it can impact the results due to variations between HX711 chips and load cells. However, my analysis specifically focuses on the raw values output by the HX711 without any calibration.

I measured the raw values directly from the HX711 using known weights and noticed significant discrepancies when compared to the expected values based on my calculations.

Could you provide insights into how the HX711 processes these raw signals or if there are any common factors that could cause such differences? Any further clarification on this would be very helpful.

User avatar
Ath
Normal user
Posts: 4007
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Help Needed: HX711 Raw Value Calculation Issues

#6 Post by Ath » 30 Oct 2024, 14:33

KBENABDI wrote: 30 Oct 2024, 14:00 I measured the raw values directly from the HX711 using known weights and noticed significant discrepancies when compared to the expected values based on my calculations.

Could you provide insights into how the HX711 processes these raw signals or if there are any common factors that could cause such differences? Any further clarification on this would be very helpful.
I've stopped trying to understand why the HX711 works the way it does. It just works that way. And, AFAICS, it just works :).
Voltages from a load-cell are in the micro to milli volt range, and need specific amplification to be measurable with some stability and accuracy. To understand how that should work would only be interesting if one is trying to build a similar chip, and I don't have that intention nor ambition :lol:.
For specifics about the inner workings of that chip, please direct your questions to the manufacturer(s), as I don't have that information available.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 9360
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Help Needed: HX711 Raw Value Calculation Issues

#7 Post by TD-er » 30 Oct 2024, 20:56

I have to look into it again as it was quite a long time ago I did a deep-dive into those chips (years ago)

What I do remember is that those chips may show some drift over time (as in minutes/hours, not days/weeks) and also are quite susceptable to how they are actually wired.

Also the stability of the applied voltage to the chip may play a role and since they do measure really low voltages, external noise is also a factor here.

So maybe you can already find some discussions online when searching for "hx711 drift".
I don't have time right now to dive into this and refresh my memory as I just got home from a looooong day away and have a daughter to put to bed.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests