Difference between revisions of "Component: Load Cell (HX711) (Force)"
Line 103: | Line 103: | ||
The readings may not be 100% linear so it's best to take several samples based on different weights across the range you want to be able to measure and from this you can work out a close fitting average. | The readings may not be 100% linear so it's best to take several samples based on different weights across the range you want to be able to measure and from this you can work out a close fitting average. | ||
+ | |||
+ | |||
Line 108: | Line 110: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===SetScaling=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 126: | Line 129: | ||
+ | ===ScaledSample=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 139: | Line 143: | ||
+ | ===Zero=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 152: | Line 157: | ||
+ | ===RawSample=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 165: | Line 171: | ||
+ | ===SetChannelAndGain=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 188: | Line 195: | ||
+ | ===SetSampleCount=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 211: | Line 219: | ||
+ | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:51, 3 February 2023
Author | Matrix TSL |
Version | 2.0 |
Category | Force |
Contents
Load Cell (HX711) component
The HX711 load cell amplifier is used to get measurable data out from a load cell or strain gauge.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Load_Cell_HX711.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Load_Cell_HX711.fcfx
Detailed description
No detailed description exists yet for this component
Examples
A simple example showing how to get a meaningful reading out of the HX711 IC connected to a load cell sensor. Zeros/Tares the reading when the switch is pressed.
The scale factor was determined by performing calibration with a unity scale of 1.0 and fixed weight weights. A table of weight vs reading was constructed to provide the correct scale factor.
Here is a guide to calibrate your sensor
When 0g was present on the load cell we zero the output.
When 10g was present on the load cell we get a reading of approx 2170.
2170 / 10g = 217 per g.
When 20g was present on the load cell we get a reading of approx 4340.
4340 / 20g = 217 per g.
1 / 217 = Scale Factor of 0.004608
The readings may not be 100% linear so it's best to take several samples based on different weights across the range you want to be able to measure and from this you can work out a close fitting average.
Macro reference
SetScaling
![]() |
SetScaling |
Sets the scaler for the samples to provide a meanningful value. Default scaler is set to 1.0 | |
![]() |
Scaler |
Unity Scale = 1.0 | |
![]() |
Return |
ScaledSample
![]() |
ScaledSample |
Takes a raw sample and then applies the scaling factor to return a real world value. | |
![]() |
Return |
Zero
![]() |
Zero |
Zeros the reading at the current sample | |
![]() |
Return |
RawSample
SetChannelAndGain
![]() |
SetChannelAndGain |
Allows the preselected input channel and gain to be overridden. | |
![]() |
Channel |
Range: 0-1 / 0=A 1=B | |
![]() |
Gain |
Channel A can be 128 or 64, Channel B can be 32 | |
![]() |
Return |
SetSampleCount
Initialise