Component: Load Cell (HX711) (Force)

From Flowcode Help
Revision as of 11:06, 17 November 2021 by Wiki bot (talk | contribs)
Jump to navigationJump to search
Author Matrix TSL
Version 2.0
Category Force


Load Cell component

The HX711 load cell amplifier is used to get measurable data out from a load cell or strain gauge.

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.


FC6 Icon.png HX711 Example


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.

Downloadable macro reference

Fc9-comp-macro.png SetScaling
Sets the scaler for the samples to provide a meanningful value. Default scaler is set to 1.0 
[[File:]] - Scaler
Unity Scale = 1.0 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ScaledSample
Takes a raw sample and then applies the scaling factor to return a real world value. 
[[File:]] - Return


Fc9-comp-macro.png Zero
Zeros the reading at the current sample 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RawSample
Allows the HX711 to be directly read returning the raw unscaled 24-bit reading. Reading is relative to the last defined Zero point. If a timeout occurs and the HX711 is not ready then we return the last valid reading. 
[[File:]] - Return


Fc9-comp-macro.png SetSampleCount
Specifies the number of samples to perform when taking a reading. The more samples the more filtered the signal will become from high frequency noise. 
Fc9-u8-icon.png - BYTE NumSamples
Default 1. Range 1-20 
Fc9-u16-icon.png - UINT Delay
Time to wait between samples in milliseconds. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Sets up the I/O ready for communications with the HX711 IC and performs an initial sample to set the channel and gain. Must be called before calling other HX711 component macros. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Input Channel
Selects which channel to sample A or B. Gain settings are channel specific. A Gain can be 128x or 64x B Gain is fixed at 32x 
Fc9-type-16-icon.png Input Gain
Gain settings are channel specific. A Gain can be 128x or 64x B Gain is fixed at 32x 
Fc9-type-5-icon.png Data
Data pin - connected to HX711 Data Out pin. 
Fc9-type-5-icon.png Clock
Clock pin - connected to HX711 SCK pin. 
Fc9-type-21-icon.png Clock Transition Delay
Number of microseconds to wait after each clock edge. Max theoretical: 10Hz Mode = 1uS / 80 Hz Mode = 4uS 
Fc9-type-7-icon.png Use Median Filter
 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations