# HX711 mV/V information needed

1. ## Re: HX711 mV/V information needed

Now, what is wrong in my latest equation?
As said, the factor of 1.16.

2. ## Re: HX711 mV/V information needed

The factor of 1.16279 is only for my Proteus setup of AVDD 4.3V. For hardware, I will change it based upon the HX711 module's AVDD.

Here it shows ratiometric operation.

https://www.analog.com/en/analog-dia...echniques.html

DOUT or HX711_rawValue = AIN / AVDD

Is this correct? AIN = AIN+ - AIN-

If my Capacity is set to 30 Kgs and ADdcResolution is 2^24 then what final equation I have to use to get the weight value using ratio metric operation?

I thought about using the 1.16279 (which will be set accordingly for each weighing machine based on it's HX711 module's AVDD and Load Cell max output based on AVDD).

Another question related to HX711 hardware designing.

In this HX711 internal circuit:

Why should I use the transistor to get AVDD or VREF voltage for the ADC? Why can't I omit the transistor and connect the DVDD directly to AVDD pin and also E+ pin and get 10mV output from my current Load Cell (2mV/V, 1000 Ohms)?
What is the purpose of the transistor?

- - - Updated - - -

These are my Load Cell's output voltages. See attached images.

@FvM

Tell me the super simple equation to get the final weight value.

- - - Updated - - -

Tested and working fine in Proteus. Will test on hardware today.

The only issue in code is I have to set these values manually based on each weighing scales HX711's AVDD and Load Cell's output value.

Code:
```#define AVDD_Recommended 5.0
#define AVDD_Actual 4.3

#define HX711_Full_Scale_value_mV_Per_V_For_Gain_128 40 //+/-20 mV/V = 40 mV
#define Load_Cell_Full_Scale_Value_mV_Per_V_Multiplied_By_Excitation_Voltage 10 //2 mV/V * 5V = 10mV```
See video.

https://mega.nz/#!eUBjWYgZ!v4c6YKncE...PE2ycRGqGWbwOg

- - - Updated - - -

Proteus Load Cell model displays value as 0 to 100% as it is a general transducer model.

My Capacity settings is 30.0 Kgs.

See this video. I am getting exact values.

18% on Proteus Load Cell model and 5.4 Kgs on 7 Segment display.

30.0 Kgs * 18% = 5.4 Kgs

https://mega.nz/#!LQ4GQYIQ!I7SokqHca...7LHD4u_x6viDUg

•

3. ## Re: HX711 mV/V information needed

@FvM, Klaus and other experts,

Of these two codes which one is correct?

Code - 1

Code:
```#define Adc_Resolution 16777216.0

#define HX711_Full_Scale_Value 40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV
#define Load_Cell_Max_Output   10.0	//Sensitivity = 2mV/V, For 5V Excitation Voltage it is 2mV/V * 5V = 10mV

#define HX711_Full_Scale_AVDD 5.0	//For Full Scale 40mV AVDD should be 5.0V
#define Excitation_Voltage    4.3	//Actual AVDD

* weighingScale.capacityInKgs
* (HX711_Full_Scale_AVDD / Excitation_Voltage)
(40.0/10.0) * (5.0/4.3) = 4.6511

Code - 2

Code:
```#define Adc_Resolution 16777216.0

#define HX711_Full_Scale_Value 40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV
#define Load_Cell_Max_Output   8.6	//Sensitivity = 2mV/V, For 4.3V Excitation Voltage it is 2mV/V * 4.3V = 8.6mV

* weighingScale.capacityInKgs
(40/8.6) = 4.6511

According to me Code - 2 is correct.

Edit 1:

Same as Code - 2 but more readable and understandable.

Code - 3

Code:
```#define Adc_Resolution 16777216.0

#define HX711_Full_Scale_Value		40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV

#define Load_Cell_Excitation_Voltage     4.3	//AVDD or E+

* weighingScale.capacityInKgs

4. ## Re: HX711 mV/V information needed

Why should I use the transistor to get AVDD or VREF voltage for the ADC? Why can't I omit the transistor and connect the DVDD directly to AVDD pin and also E+ pin and get 10mV output from my current Load Cell (2mV/V, 1000 Ohms)?
What is the purpose of the transistor?
It's an AVDD regulator, useless in ratiometric bridge configuration if your power supply is at least short time stable and ripple-free. I would connect DVDD and AVDD.

As long as the load cell is supplied by AVDD, the digital output does not change with varying AVDD. Just use nominal 5V ADC range and 5V load cell sensitivity for your calculations. If actual AVDD is different, both values scale with the same factor. The ADC offset effect increases with reduced AVDD, but it's compensated by your unload measurement.

1 members found this post helpful.

•

5. ## Re: HX711 mV/V information needed

I have a new question.

Client needs auto-calibration of Load Cell feature. HX711 will be used.

So, how to get these values automatically?

Code:
```#define HX711_Full_Scale_Value		40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV

#define Load_Cell_Excitation_Voltage     4.3	//AVDD or E+
I can get AVDD or E+ in runtime using 10-bit ADC of PIC. What about others?

- - - Updated - - -

Edit:

This value is fixed.

Code:
`#define HX711_Full_Scale_Value		40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV`
AVDD or E+ I can get from ADC 10-bit of PIC.

How to find out Sensitivity of Load Cell for auto-calibration that is I can't put say 2mV/V in code but need to get it when device is first powered and saved it in eeprom. How to do it?

•

6. ## Re: HX711 mV/V information needed

Auto calibration is only useful with a calibration weight.

AVDD has no effect on calibration.

1 members found this post helpful.

7. ## Re: HX711 mV/V information needed

Originally Posted by FvM
Auto calibration is only useful with a calibration weight.

AVDD has no effect on calibration.
Yes, I found out that myself.

I found out the auto-calibration procedure myself. Will post it here after project completes.

Currently, I am using the max capacity of the Load Cell as the calibration weight that is if Load Cell Capacity is 30 Kgs then I will use 30 Kgs as the calibration weight.

- - - Updated - - -

Auto-calibration process

This will be hardcoded

Code:
```#define Adc_Resolution			16777216.0
#define HX711_Full_Scale_Value		40.0	//Channel A, Gain 128, Clocks 25 = +/-20mV = 40mV```
So, for 40mV HX711 output will be 16777216.0

Now, if rawAdcValue is say 3607101.44 then

we can auto-calibrate by using

loadCell.maxOutput = (3607101.44 * 40) / 16777216.0 = 8.6 (mV)

This completes the auto-calibration.

Then I can use this code to find out weight.

Code:
```weighingScale.weight = (double)(HX711_Read() - weighingScale.noLoadCounts)
* weighingScale.capacityInKgs
With known lower weight than capacity of load cell

30 kgs = 3607101.44
2 kgs = t
t = (2 kgs * 3607101.44) / 30 kgs = 240473.42933333333333333333333333

Eg:

If rawAdcValue = 240473.42933 for 2 Kgs known weight, then

loadCell.maxOutput = (((240473.42933 * 30.0) / 2.0) * 40.0) / 16777216.0

8. ## Re: HX711 mV/V information needed

Hi,

Mybe the customer means auto offset calibration...

Klaus

9. ## Re: HX711 mV/V information needed

Originally Posted by KlausST
Hi,

Mybe the customer means auto offset calibration...

Klaus
No. Only auto-calibration which is done at factory or field by enabling a jumper.

•

10. ## Re: HX711 mV/V information needed

I have one more issue.

I have a parameter named Accuracy for weight. It has three options 1, 2 and 5.

How to implement these?

Code:
```1.	If set the Acc = 1, then machine will increase like (0.000), (0.001) , (0.002) , (0.003) , (0.004) , (0.005) , (0.006) , (0.007) , (0.008) , (0.009, (0.010) Up to (30.000), Every time Increase only 1 number.

2.	If set the Acc = 2, then machine will increase like (0.000), (0.002) , (0.004) , (0.006) , (0.008) , (0.010) , (0.012) , (0.014) , (0.016) , (0.018, (0.020) Up to (30.000), Every time Increase only 2 number.

If set the Acc = 5, then machine will increase like (0.000), (0.005) , (0.010) , (0.015) , (0.020) , (0.025) , (0.030) , (0.035) , (0.040) , (0.045, (0.050) Up to (30.000). Every time Increase only 5 number```

11. ## Re: HX711 mV/V information needed

Hi,

For 0.001 you may multiply with 1000, then do the roundung to integer, then divide by 1000
For 0.002 ... multiply with 500
For 0.005 ... multiply with 200

But I assume there are better ways to do this.

Klaus

1 members found this post helpful.

12. ## Re: HX711 mV/V information needed

What are the other better ways?

--[[ ]]--