Ever since I got my Borons 6 months ago, I’ve been having trouble getting good stable readings from my HX711 weigh sensors. With my Electrons, the readings were always rock-solid. This is a typical example of measurements using the HX711ADC library where I’m averaging 20 readings (constant weight, but no offset applied).
When I reduce the number of times the data are averaged to 1 (i.e. no averaging), the output is considerably more stable, but the outliers are greatly exacerbated (constant weight, offset applied). Clearly the risk of a bad data point increases with the number of reads.
I have investigated many possible causes, incl.:
- RF interference. I’ve experimented with placing the antenna at increasing distances from the Boron, incl fitting external antennas up to 3m away. No difference.
- Tried different Borons (six) – no difference
- Tried different HX711 ADC’s (eight) – no difference
- Tried different strain gauges (six) – no difference
- Tried different libraries (both Particle community libraries as well as a library I uploaded myself. Used standard example code too – no difference
- Tried slowing down the rate at which bits are clocked in. This is apparently a problem with MCUs which have fast clock speeds (see here). However, as I understand it, the Boron’s clock speed is slower than the Electron (64MHz vs 120MHz resp)? In any case, adding extra 1ms delays between clocking in bits did not stop the outliers.
- Tried swapping pins on the Borons (from D3 and D4 to A2 and A3) - no difference
- Tried filtering out bad data points with an IF statement. That helped considerably but new bad values still occur, and besides, this doesn’t get to the root of the problem.
At this stage, I’m out of ideas as to what could be causing the outliers and what the fix might be. Has anyone else been having problems with Boron and HX711 outliers? Any help greatly appreciated!