Member #123207

Member Since: March 3, 2010

Country: United States

  • I have seen similar "jitter" in my readings; big jumps for brief periods of time. I'm assuming it's a noise issue with ADC not helped by my un-shielded wiring. I also believe some the erroneous values are made worse by possible overflow/underflow in the averaging routine in the HX711 library. One thing that helped me was to modify the firmware to read (10) raw samples, scale them individually before summing/averaging, discard the lowest and highest individual readings, and then summing and averaging the remaining (8) scaled samples (see rudimentary code below):

    long i, j, min, max; long rawReading[10];

    //----------------------------------------------
    // Take 10 readings w/ scale factor
    j=0;
    for(i=0;i<10;i++)
    {
      rawReading[i] = scale.read(); // Take a single reading from the ADC
      rawReading[i] /= 8870;        // Scaling (hard-coded scale factor)
    }
    
    //----------------------------------------------
    // Find lowest and highest reading
    min=9999;
    max=0;
    for(i=0;i<10;i++)
    {
      if(rawReading[i] > max)
        max = rawReading[i];
      if(rawReading[i] < min)
        min = rawReading[i];
    }
    
    //----------------------------------------------
    // Sum and remove lowest and highest and average readings
    for(i=0;i<10;i++)
      j += rawReading[i];
    j -= min;    
    j -= max;    
    j/=8;   // Final value
    

No public wish lists :(