@@ -80,12 +80,21 @@ in the sensor readings.
8080
8181### 10 or 80 SPS
8282
83- The datasheet mentions that the HX711 can run at 80 samples per second SPS.
83+ The datasheet mentions that the HX711 can run at 80 samples per second ( SPS) .
8484To select this mode connect the ** RATE** pin(15) of the chip to VCC (HIGH).
8585Connecting ** RATE** to GND (LOW) gives 10 SPS.
8686
87+ Having the RATE set to 10 or 80 SPS also changes the time to start up.
88+ At 10 SPS it takes 400 milliseconds, at 80 SPS it takes 50 milliseconds.
89+
8790All breakout boards I tested have ** RATE** connected to GND and offer no
8891pin to control this from the outside.
92+ Adafruit however has a breakout board with ** RATE** exposed.
93+ See https://www.adafruit.com/product/5974
94+ There might be more.
95+
96+ If you have the schema of your board you should be able to expose the ** RATE**
97+ pin, e.g. by removing the pull down resistor to GND.
8998
9099This library provide experimental means to control the ** RATE** , see below.
91100
@@ -113,6 +122,9 @@ Load cells go to very high weights, this side sells them up to 200 ton.
113122Never seen one and cannot tell if it will work with this library.
114123- https://stekon.nl/load-cells
115124
125+ Breakout with RATE exposed by ADAfruit
126+ - https://www.adafruit.com/product/5974
127+
116128
117129### Faulty boards
118130
@@ -123,14 +135,18 @@ Never seen one and cannot tell if it will work with this library.
123135
124136First action is to call ** begin(dataPin, clockPin)** to make connection to the ** HX711** .
125137
126- Second step is calibration for which a number of functions exist.
127- - ** tare()** measures zero point.
138+ Second step is to check ** isReady()** to wait until the device is ready for measurements.
139+
140+ Next step is calibration for which a number of functions exist.
141+ - ** tare()** measures the offset of the zero point.
128142- ** set_scale(factor)** set a known conversion factor e.g. from EEPROM.
129143- ** calibrate_scale(weight, times)** determines the scale factor based upon a known weight e.g. 1 Kg.
130- The weight is typical in grams, however any unit can be used.
144+ The weight is typical in grams, however any unit can be used, depending on the
145+ load cell used.
131146
132147Steps to take for calibration
1331481 . clear the scale.
149+ 1 . wait until ** isReady()** returns true.
1341501 . call ** tare()** to determine and set the zero weight offset.
1351511 . put a known weight on the scale.
1361521 . call ** calibrate_scale(float weight)** , weight typical in grams, however any unit can be used.
@@ -149,16 +165,22 @@ Note that the units used in **calibrate_scale()** will be returned by **get_unit
149165### Constructor
150166
151167- ** HX711()** constructor.
152- - ** ~ HX711()**
153- - ** void begin(uint8_t dataPin, uint8_t clockPin, bool fastProcessor = false)** sets a fixed gain 128 for now.
154- The fastProcessor option adds a 1 uS delay for each clock half-cycle to keep the time greater than 200 nS.
155- - ** void reset()** set internal state to start condition.
156- Since 0.3.4 reset also does a power down / up cycle.
168+ - ** ~ HX711()** destructor.
169+ - ** void begin(uint8_t dataPin, uint8_t clockPin, bool fastProcessor = false, bool doReset = true)** sets a fixed gain 128 for now.
170+ - The parameter fastProcessor adds a 1 uS delay for each clock half-cycle to keep the time greater than 200 nS.
171+ - The parameter doReset is experimental in 0.6.3.
172+ It defaults to true (== backwards compatible) causing a call to reset(), taking extra time
173+ before the device is ready to make new measurements. See reset() below.
174+ Note that not calling reset() leaves the ADC in the previous or even an undefined state,
175+ so use with care. (needs testing)
176+ - ** void reset()** set internal state to the start condition.
177+ Reset() also does a power_down() / power_up() cycle.
178+ This cycle adds a delay of 400 (RATE = 10 SPS) or 50 (RATE = 80 SPS) milliseconds.
157179
158180
159181### isReady
160182
161- Different ways to wait for a new measurement.
183+ There are different ways to wait for a new measurement.
162184
163185- ** bool is_ready()** checks if load cell is ready to read.
164186- ** void wait_ready(uint32_t ms = 0)** wait until ready, check every ms.
@@ -168,7 +190,10 @@ Different ways to wait for a new measurement.
168190
169191### Read
170192
171- - ** float read()** raw read.
193+ Warning: the read calls are blocking calls, which can take up to 400 ms in the first read() call.
194+ Best practice is to check with isReady() before calling read().
195+
196+ - ** float read()** get a raw read.
172197- ** float read_average(uint8_t times = 10)** get average of times raw reads. times = 1 or more.
173198- ** float read_median(uint8_t times = 7)** get median of multiple raw reads.
174199times = 3..15 - odd numbers preferred.
@@ -215,7 +240,7 @@ so the device is in a known state.
215240
216241Warning 2: In practice it seems harder to get the channel and gain selection as reliable
217242as the datasheet states it should be. So use with care. (feedback welcome)
218- See discussion #27 .
243+ See discussion #27 HX711 .
219244
220245
221246### Read mode
@@ -344,6 +369,10 @@ of the accuracy of the load cell.
344369It should reset the HX711 to defaults but this is not always seen.
345370See discussion issue #27 GitHub. Needs more testing.
346371
372+ Note: Having the RATE set to 10 or 80 SPS changes the time to start up.
373+ At 10 SPS it takes 400 milliseconds, at 80 SPS it takes 50 milliseconds.
374+ (See datasheet, Output settling time on page 3)
375+
347376
348377### Rate
349378
@@ -480,29 +509,33 @@ See https://github.com/RobTillaart/HX711/issues/40
480509
481510#### Must
482511
483- - update documentation HX711
484- - keep in sync with HX711_MP, HX710AB
512+ - update documentation
513+ - keep in sync with HX711_MP, HX710AB library.
485514
486515#### Should
487516
488- - test B channel explicitly.
489- - test reset and reboot behaviours.
517+ - test
518+ - different load cells.
519+ - B channel explicitly.
520+ - test reset and reboot behaviours.
521+ - test and verify the proper working of the rate functions.
490522- investigate read()
491523 - investigate the need of yield after interrupts
492524 - investigate blocking loop at begin => less yield() calls ?
493- - test and verify the proper working of the rate functions.
525+ - add performance figures
494526
495527#### Could
496528
529+ - add error handling?
497530- optimize fastProcessor code (possible better performance)
498531 - injecting 2 micro delays is not always needed.
499532 - int flag instead of bool.
500- - test different load cells
501533- make enum of the MODE's
502534- add examples
503535 - example the adding scale
504536 - void weight_clr(), void weight_add(), float weight_get() - adding scale
505537 - example for using rate functions.
538+ - investigate temperature compensation.
506539- decide pricing keep/not => move to .cpp
507540
508541#### Wont
0 commit comments