@@ -83,6 +83,11 @@ This library does not provide means to control the **RATE** yet.
83
83
If there is a need (issue) I will implement this in the library.
84
84
For now one can add an IOpin for this and use ** digitalWrite()** .
85
85
86
+ If you need more SPS you could consider using the HX71708 device.
87
+ This is a close "relative" of the HX711 that allows to set the SPS to
88
+ 10, 20, 80, or 320 Hz.
89
+ - https://github.com/beniseman/HX71708
90
+
86
91
87
92
### Related
88
93
@@ -95,6 +100,13 @@ For now one can add an IOpin for this and use **digitalWrite()**.
95
100
Discussion about resolution of the ADC
96
101
- https://forum.arduino.cc/t/scale-from-50-kg-to-5000kg-what-adc/1139710
97
102
103
+ Support for the HX71708 device (close related)
104
+ - https://github.com/beniseman/HX71708 allows to set the SPS to 10, 20, 80, or 320 Hz
105
+
106
+ Load cells go to very high weights, this side sells them up to 200 ton.
107
+ Never seen one and cannot tell if it will work with this library.
108
+ - https://stekon.nl/load-cells
109
+
98
110
99
111
### Faulty boards
100
112
@@ -108,16 +120,19 @@ First action is to call **begin(dataPin, clockPin)** to make connection to the *
108
120
Second step is calibration for which a number of functions exist.
109
121
- ** tare()** measures zero point.
110
122
- ** set_scale(factor)** set a known conversion factor e.g. from EEPROM.
111
- - ** calibrate_scale(WEIGHT, TIMES)** determines the scale factor based upon a known weight e.g. 1 Kg.
123
+ - ** calibrate_scale(weight, times)** determines the scale factor based upon a known weight e.g. 1 Kg.
124
+ The weight is typical in grams, however any unit can be used.
112
125
113
126
Steps to take for calibration
114
- 1 . clear the scale
115
- 1 . call tare() to set the zero offset
116
- 1 . put a known weight on the scale
117
- 1 . call calibrate_scale(weight)
118
- 1 . scale is calculated.
127
+ 1 . clear the scale.
128
+ 1 . call ** tare()** to determine and set the zero weight offset.
129
+ 1 . put a known weight on the scale.
130
+ 1 . call ** calibrate_scale(float weight)** , weight typical in grams, however any unit can be used.
131
+ 1 . scale factor is calculated.
119
132
1 . save the offset and scale for later use e.g. EEPROM.
120
133
134
+ Note that the units used in ** calibrate_scale()** will be returned by ** get_units()** .
135
+
121
136
122
137
## Interface
123
138
@@ -135,12 +150,18 @@ The fastProcessor option adds a 1 uS delay for each clock half-cycle to keep the
135
150
Since 0.3.4 reset also does a power down / up cycle.
136
151
137
152
138
- ### Read
153
+ ### isReady
154
+
155
+ Different ways to wait for a new measurement.
139
156
140
157
- ** bool is_ready()** checks if load cell is ready to read.
141
158
- ** void wait_ready(uint32_t ms = 0)** wait until ready, check every ms.
142
159
- ** bool wait_ready_retry(uint8_t retries = 3, uint32_t ms = 0)** wait max retries.
143
160
- ** bool wait_ready_timeout(uint32_t timeout = 1000, uint32_t ms = 0)** wait max timeout milliseconds.
161
+
162
+
163
+ ### Read
164
+
144
165
- ** float read()** raw read.
145
166
- ** float read_average(uint8_t times = 10)** get average of times raw reads. times = 1 or more.
146
167
- ** float read_median(uint8_t times = 7)** get median of multiple raw reads.
@@ -222,8 +243,10 @@ Note that in **HX711_RAW_MODE** the times parameter will be ignored => just call
222
243
223
244
- ** float get_value(uint8_t times = 1)** read value, corrected for offset.
224
245
- ** float get_units(uint8_t times = 1)** read value, converted to proper units.
225
- - ** bool set_scale(float scale = 1.0)** set scale factor which is normally a positive number larger than 50. Depends on load-cell used.
246
+ - ** bool set_scale(float scale = 1.0)** set scale factor which is normally a positive
247
+ number larger than 50. Depends on load-cell used.
226
248
Returns false if scale == 0.
249
+ Note that for some specific applications, scale might be negative.
227
250
- ** float get_scale()** returns set scale factor.
228
251
- ** void set_offset(int32_t offset = 0)** idem.
229
252
- ** int32_t get_offset()** idem.
@@ -233,20 +256,41 @@ Returns false if scale == 0.
233
256
234
257
Steps to take for calibration
235
258
1 . clear the scale.
236
- 1 . call ** tare()** to determine and set the zero offset.
259
+ 1 . call ** tare()** to determine and set the zero weight offset.
237
260
1 . put a known weight on the scale.
238
- 1 . call ** calibrate_scale(weight)** .
239
- 1 . scale is calculated.
261
+ 1 . call ** calibrate_scale(float weight)** , weight typical in grams, however any unit can be used .
262
+ 1 . scale factor is calculated.
240
263
1 . save the offset and scale for later use e.g. EEPROM.
241
264
265
+ Note that the units used in ** calibrate_scale()** will be returned by ** get_units()** .
266
+
242
267
- ** void tare(uint8_t times = 10)** call tare to determine the offset
243
268
to calibrate the zero (reference) level. See below.
244
269
- ** float get_tare()** returns the offset \* scale.
245
270
Note this differs after calls to ** calibrate_scale()** .
246
271
Use ** get_offset()** to get only the offset.
247
272
- ** bool tare_set()** checks if a tare has been set.
248
273
Assumes offset is not zero, which is true for all load cells tested.
249
- - ** void calibrate_scale(uint16_t weight, uint8_t times = 10)** idem.
274
+ - ** void calibrate_scale(float weight, uint8_t times = 10)**
275
+ The calibration weight averages times measurements to improve accuracy.
276
+ Weight is typical in grams, however any unit can be used.
277
+ Be aware this unit will also be returned by ** get_units()** .
278
+
279
+ Since 0.6.0 the weight is defined as float which allows easier calibration in
280
+ other units e.g. define the weight as 2.5 kg instead of 2500 gram.
281
+ The function ** GetUnits()** will then return its value in kg too.
282
+
283
+ Also by using a float the range of calibration weights is substantially increased.
284
+ One can now define 250 gram as 250000 milligram, where before the value was max
285
+ 65535 units (theoretical increase of precision from 4.8 to 6.9 digits).
286
+ This allows the calibration of superheavy load cells, e.g 500 kg and use a
287
+ defined weight of 100000 gram.
288
+ Finally the use of floats allow the use of decimals e.g. a calibration weight
289
+ of 125.014 kg or 306.4 gram.
290
+
291
+ Note: calibrate_scale() uses averaging and does not use the mode set.
292
+
293
+ Note: calibrate_scale() can have a negative value as weight e.g. force of a balloon.
250
294
251
295
252
296
### Tare & calibration II
@@ -256,15 +300,21 @@ The function **get_tare()** is used to measure this raw value and allows the use
256
300
to define this value as a zero weight (force) point.
257
301
This zero point is normally without any load, however it is possible to define
258
302
a zero point with a "fixed" load e.g. a cup, a dish, even a spring or whatever.
259
- This allows the system to automatically subtract the weight of the cup etc.
303
+ This allows the system to automatically subtract the weight / force of the cup etc.
260
304
261
- Warning: The user must be aware that the "fixed" load together with the
305
+ ** Warning** : The user must be aware that the "fixed" load together with the
262
306
"variable" load does not exceed the specifications of the load cell.
263
307
264
308
E.g. a load cell which can handle 1000 grams with a cup of 300 grams should not
265
309
be calibrated with a weight of more than 700 grams.
266
310
In fact it is better to calibrate with a weight in the order of 80 to 90% of
267
311
the maximum load so in this example a weight of 500 to 600 grams.
312
+ That would make the total 800-900 grams == 80/90% of the max load.
313
+
314
+ Another point to consider when calibrating is to use a weight that is
315
+ in the range you want to make your measurements.
316
+ E.g. if you want to measure coffee beans in portions of 250 grams, use
317
+ a weight in the range 200-300 grams. Could just save an extra bit.
268
318
269
319
Furthermore it is also important to do the calibration at the temperature you
270
320
expect to do the weight measurements. See temperature section below.
0 commit comments