Scale behavior with arduino

Hi everyone,

I'm using a fish scale in my project but i'm having some doubts about output data behavior

I improvised a way to use the scale with a minimum external interference, as show in this photo.

With the scale is the signal amplifier hx711, I calibrate the scale with the following library:

And using the following code:

#include "HX711.h"

// HX711.DOUT	- pin #A1
// HX711.PD_SCK	- pin #A0

HX711 scale(A1, A0);		// parameter "gain" is ommited; the default value 128 is used by the library

void setup() {
  Serial.begin(38400);
  Serial.println("HX711 Demo");

  scale.set_scale(146.f);                      // this value is obtained by calibrating the scale with known weights; see the README for details
  scale.tare();				        // reset the scale to 0

  Serial.println("Readings:");
}

void loop() {
  //Serial.print("one reading:\t");
  //Serial.println(scale.get_units(), 1);
  //Serial.print("\t| average:\t");
  Serial.println(scale.get_units(10), 1);

  scale.power_down();			        // put the ADC in sleep mode
  delay(10);
  scale.power_up();
}

The following measures (in vertical axis) have the unit grams, and with two weights we would have a total 2kg, but after a lot of measurements (in horizontal axis) the scale show me data like this:

What I wanna to know is if this is normal and if not, how I fix this output data?

Thank you very much in advance

It appears that you have about 0.4% noise in your reading(8 g swing in a 2000 g reading.) Plus it looks (from the small sample) that it is periodic. Is the weight swaying slightly?

If you increase the 10mS stabilization time after a power up, do you get the same results ?

ChrisTenone:
It appears that you have about 0.4% noise in your reading(8 g swing in a 2000 g reading.) Plus it looks (from the small sample) that it is periodic. Is the weight swaying slightly?

not the weights were completely stopped

6v6gt:
If you increase the 10mS stabilization time after a power up, do you get the same results ?

I increased the delay for 100ms and the graphic turned to this:

The limits now are 2005.1 and 1999,8 but the noise continue.

OK. And when you put scale.power_up(); at the end of setup() and remove both the scale.power_up(); and scale.power_down(); statements in the main loop() ?

Using the formula in reply #4 in this post you can estimate the expected performance of your system.

Monitoracao:
I increased the delay for 100ms and the graphic turned to this:

The limits now are 2005.1 and 1999,8 but the noise continue.

The noise looks much less. What would happen if you again increase stabilization time by 10 (ie 1 sec.) The graph shows only +/- 1 gram after about 800ms.

ChrisTenone:
The noise looks much less. What would happen if you again increase stabilization time by 10 (ie 1 sec.) The graph shows only +/- 1 gram after about 800ms.

The fastest the HX711 can sample is 80 sps, so the units of the horizontal axis can't be ms.

DaveEvans:
Using the formula in reply #4 in this post you can estimate the expected performance of your system.

I'm using a generic fish scale, I don't have the mV/V sensitivity for this scale

6v6gt:
OK. And when you put scale.power_up(); at the end of setup() and remove both the scale.power_up(); and scale.power_down(); statements in the main loop() ?

ChrisTenone:
The noise looks much less. What would happen if you again increase stabilization time by 10 (ie 1 sec.) The graph shows only +/- 1 gram after about 800ms.

DaveEvans:
The fastest the HX711 can sample is 80 sps, so the units of the horizontal axis can't be ms.

I'm using now this code

#include "HX711.h"

// HX711.DOUT	- pin #A1
// HX711.PD_SCK	- pin #A0

HX711 scale(A1, A0);		// parameter "gain" is ommited; the default value 128 is used by the library

void setup() {
  Serial.begin(38400);

  scale.set_scale(146.f);                      // this value is obtained by calibrating the scale with known weights; see the README for details
  scale.tare();				        // reset the scale to 0
  delay(100);
  scale.power_up();
  Serial.println("Leituras:");
}

void loop() {
  Serial.println(scale.get_units(10), 1);
}

And I change the horizontal axis to samples instead of seconds, now the graphic is like this:

and DaveEvans how i control the speed of samples?

Monitoracao:
I'm using a generic fish scale, I don't have the mV/V sensitivity for this scale

You can get a pretty good idea with a voltmeter.

Monitoracao:
DaveEvans how i control the speed of samples?

The rate pin controls the maximum rate. Look at the datasheet. You can't go faster than that, but of course your sketch can take samples as slow as you want...one sample every hour or 6 months or ten years....