2

I have four HX711s load cell amplifiers and each one reads one load cell. I was using the 10 Hz mode, however, this was making my application very slow, as I needed to take five readings and take the average.

When I put the 15 RATE in 1 there is a lot of noise, despite having sped up the reading of the weights; sometimes the variation is up to 3 digits at the end.

See the code for reading the modules where I already show the weights in kg:

n = 6;
for (int x=0; x<n; x++) {
 v1[x] = CELL1.read();
 v2[x] = CELL2.read();
 v3[x] = CELL3.read();
 v4[x] = CELL4.read();
}
v1m = 0;
v2m = 0;
v3m = 0;
v4m = 0;
for (int x=1; x<n; x++) { // sum of array
 v1m = v1m+v1[x];
 v2m = v2m+v2[x];
 v3m = v3m+v3[x];
 v4mv= v4m+v4[x];
}
// mean array
v1m = v1m/(n-1);
v2m = v2m/(n-1);
v3m = v3m/(n-1);
v4m = v4m/(n-1);
p1 = p;
p = ((v1m-v10)/(M[1]) + (v2m-v20)/(M[2]) + (v3m-v30)/(M[3]) + (v4m-v40)/(M[4]))/2.5; // show the weight in kg
p = p*o.7+p1*0.3; // convert to kg
// ... i print the p (weight in kg) now...
ocrdu
1,7953 gold badges12 silver badges24 bronze badges
asked Mar 30, 2020 at 16:43
1
  • Please show your complete code, wiring and which deviations you actually get in comparison between 10 and 80SPS setting Commented Apr 3, 2020 at 20:27

1 Answer 1

1

I had a very similar problem with 4 load cells. I ran 10,000+ readings at 80Hz, copied the serial monitor into MS Word to find my string (text) value labels and replace them with nothing. This lets me keep the numbers. If you copy that into Excel and make a scatter plot graph you can see where your highs and lows are and their magnitudes. I was able to simply write an IF condition to reject those outliers. Interestingly the outliers are very large (positive or negative) and they weren't just random values. They were also occurring at a specific frequency that may have more to do with my application rather than being an element to your solution.

answered Aug 17, 2023 at 11:31
1
  • 1
    Your answer could be made more complete by including the part of your code that does the filtering for outliers, or by describing it in more detail. Did you use some kind of median filter or something different? Commented Aug 17, 2023 at 13:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.