Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Mathematical formula that converts voltage to weight the HX711 is using

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hello guys, im currently working on a load cell project using strain gauges and the HX711 amplifier.

Coding wise all good but ive been searching and reading everywhere but still could not find how the HX711 converts voltage coming from the load cell into weight? is there a formula that converts voltage to weight ? if so whatt is this mathematical formula that the HX711 is using?
I tried to see if maybe the arduino does the conversion of the voltage to weight but still no clue.
It would be a great help if u could point me to the right article or the formula in question because i want to understand the principle behind going from voltage to weight and if you would be kind to explain if the microcontroller does the conversion to weight and the hx711 just amplifies the signal or not.



I use a 5 kg loadcell and a NodeMCU ESP8266 microcontroller with a load cell input voltage of 3.3 V



Loadcell Specifications:
Rated Load: 5Kg
Rated Output: 1.0mV/V±0.15mV/V
Zero Output: ±0.1mV/V
Creep: 0.03%F.S./30min
Input End: Red+(power), Black-(power)
Output End: Blue/Green+(signal), White-(signal)
Recommended operating voltage: 3 ~ 12 VDC
Maximum operating voltage: 15 VDC
Input Impedance: 1115±10%?
Output Impedance: 1000±10%?
Protection class: IP65

Thank you ...
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
Hi,

the HX711 does not convert to weight.
It converts an analog value into a digital value.
But there are some parameters that have influence on conversion factor.

Better show the schematic and the code.

Klaus
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,726
Helped
1,155
Reputation
2,322
Reaction score
1,236
Trophy points
1,393
Location
California, USA
Activity points
31,229
for a 5Kg load, the loadcell will output 1mV per volt of applied voltage. In other words, if you have a 10 volt excitation, your loadcell will output 5mV. As Klaus points out, HX711 simply coverts this voltage to a digital number.
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi,

the HX711 does not convert to weight.
It converts an analog value into a digital value.
But there are some parameters that have influence on conversion factor.

Better show the schematic and the code.

Klaus
sorry, that's what I meant.
calibration factor = -258678/526 = -491,783269961977 (526 weight of an object / grams)

I need formula to change the reading from load cell output voltage to HX711 digital output. thank you
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    60.7 KB · Views: 28
  • Screenshot_4.png
    Screenshot_4.png
    92.6 KB · Views: 29
  • Screenshot_5.png
    Screenshot_5.png
    59.1 KB · Views: 28
  • Screenshot_6.png
    Screenshot_6.png
    52.9 KB · Views: 27
Last edited:

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
for a 5Kg load, the loadcell will output 1mV per volt of applied voltage. In other words, if you have a 10 volt excitation, your loadcell will output 5mV. As Klaus points out, HX711 simply coverts this voltage to a digital number.
Okay, I understand.
how do i calculate the output change of hx711 with the specs i attached ? thank you
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hello all,

I have finished the program. now I do a comparison of the results between measurements with calculations using a formula. until now I have not found a formula to change the load cell output voltage to digital output hx711.
here I am looking for a formula for changing from analog load cell sensor data to digital data using hx711. can anyone help me ?

Here I attach the program and load cell circuit :

calibration factor = -258678 / 526 = -491,783269961977 (526 weight of an object / grams)

I use a 5 kg loadcell and a NodeMCU ESP8266 microcontroller with a load cell input voltage of 3.3 V

Loadcell Specifications:
Rated Load: 5Kg
Rated Output: 1.0mV/V±0.15mV/V
Zero Output: ±0.1mV/V
Creep: 0.03%F.S./30min
Input End: Red+(power), Black-(power)
Output End: Blue/Green+(signal), White-(signal)
Recommended operating voltage: 3 ~ 12 VDC
Maximum operating voltage: 15 VDC
Input Impedance: 1115±10%?
Output Impedance: 1000±10%?
Protection class: IP65
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    60.7 KB · Views: 24
  • Screenshot_4.png
    Screenshot_4.png
    92.6 KB · Views: 25
  • Screenshot_5.png
    Screenshot_5.png
    59.1 KB · Views: 25
  • Screenshot_6.png
    Screenshot_6.png
    52.9 KB · Views: 24

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
Hi,

do you use the bare HX711?
Or do you use a HX711 module? If so, you need to tell this .. and give a link to the module´s datasheet.

-->You need to read about basic operation of a strain gauge:
It´s output not only depends on the mechanical force, it also depends on the input voltage.
Currently we don´t know the input voltage, thus we can´t calculate it´s output voltage.

--> you need to read about HX711 operation.
It´s dgital output not only depends on the input voltage, it also depends on the gain (amplifier) setup.
If you using the typical application circuit of the HX711 datasheet, then the strain gauge supply voltage depends on R1 and R2. We don´t know what you use, thus we now have two unknown items. It makes it impossible to give you the expected answer.

Klaus
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
do you use the bare HX711?
Or do you use a HX711 module? If so, you need to tell this .. and give a link to the module´s datasheet.

-->You need to read about basic operation of a strain gauge:
It´s output not only depends on the mechanical force, it also depends on the input voltage.
Currently we don´t know the input voltage, thus we can´t calculate it´s output voltage.

--> you need to read about HX711 operation.
It´s dgital output not only depends on the input voltage, it also depends on the gain (amplifier) setup.
If you using the typical application circuit of the HX711 datasheet, then the strain gauge supply voltage depends on R1 and R2. We don´t know what you use, thus we now have two unknown items. It makes it impossible to give you the expected answer.

Klaus
Hello,

i am using hx711 module from avia semicondutor. I use an input voltage of 3.3 V which comes from NodeMCU ESP8266
how to set gain (amplifier) on hx711 module ?

Thank you,
 

Attachments

  • Data Sheet HX711.pdf
    160.4 KB · Views: 20

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
Hi,

please read my post thoroughly.

* I asked for a link to the module datasheet
* I asked for the strain gauge input voltage, not your power supply voltage

HX711 gain setting.
* I did not read the complete HX711 datasheet for you. I´m sure it is written there.
* Also I´m sure it is explaiend in your HX711 library documentation. I did not read it either.

Please read through the documentations. It´s really urgent. If there still any problems, please tell what you understand so far, and what information you can not find. Please refer to the documents (pages, sections...)

Klaus
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
Hi,

O.K. If you have 3.3V strain gauge supply...
Then 1mV/V for full load is given. Full load is 5kg.
So if you supply it with 3.3V then you get 1mV/V * 3.3V = 3.3mV at full load.
3.3mV for 5kg
or 3.3mV/5 = 0.66mV per kg.

Link: This is not the module datasheet. It is the bare HX711 datasheet.

Again: I expect that you go through the documents on your own. Then tell us what in detail you need. Read post#9.

Klaus
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi KlausST,

I have taken measurements using a 3.3V . supply

where i get the voltage result:
500 grams = 0.55 mV
400 grams = 0.48 mV
300 grams = 0.41 mV
200 grams = 0.34 mV
100 grams = 0.27 mV
0 grams = 0.20 mV

You give an example: 3.3mV/5 = 0.66mV per kg = 0.33 mV per 0.5 kg.

the measurement results are 500 grams = 0.55 mV and the calculation results are 0.33 mV

why is it different?
can you teach me about the difference?

thanks
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
5,726
Helped
1,155
Reputation
2,322
Reaction score
1,236
Trophy points
1,393
Location
California, USA
Activity points
31,229
you have an offset error and a gain error. you can calibrate these errors out. For starters, it’s obvious you’ve got 0.2 mV offset (0.2 mV out for 0 gms).

You’ve got tolerances in your load cell (+/-.15mV) as well as mechanical tolerances and analog errors.
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi barry,

do you know the formula for calculating the voltage from the load cell (mV) to the output data of the HX711 module based on the measurements I did above?

thank you
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
Hi,

I need some important informations:
* how / what measurement device / what connections ... did you measure the millivolts. A cheap voltameter may have problems with those low voltages.
* measure the voltage at the other two wires (input) of the strain gauge.

Klaus
 

ivanedpratama

Newbie level 6
Joined
Jun 25, 2022
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi barry & KlausST

I took measurements by providing a 3.3 supply from the load cell input and measuring the voltage from the load cell output so that I obtained the above voltage based on the given load

thank you
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
22,254
Helped
4,613
Reputation
9,242
Reaction score
4,880
Trophy points
1,393
Activity points
147,017
I need some important informations:
* how / what measurement device / what connections ... did you measure the millivolts. A cheap voltameter may have problems with those low voltages.
* measure the voltage at the other two wires (input) of the strain gauge.

How: you can show a photo of wiring during measurement, also showing the weight.

Klaus
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top