Questions on Load Cell Amplifier HX711 Breakout Arduino codes

Hello, I have some questions in regard to the same codes of this board.

Load Cell Amplifier HX711 Breakout Hookup Guide - SparkFun Learn

Under Arduino Example, there is a code for calibration. It states that “This example assumes pounds (lbs). If you prefer kilograms, change the Serial.print(” lbs"); line to kg. The calibration factor will be significantly different but it will be linearly related to lbs (1 lbs = 0.453592 kg)"

Is it correct to change the code to the following?

  Serial.print("Reading: ");
  Serial.print(scale.get_units()* 0.453592, 1);
  Serial.print(" kg"); //Change this to kg and re-adjust the calibration factor if you follow SI units like a sane person
  Serial.print(" calibration_factor: ");
  Serial.print(calibration_factor);
  Serial.println();

No - you don’t need to manually set any conversion (2nd line)…just change the units label (like you did on the 3rd line) and calibrate

Then when you calibrate using kg weights it’ll already be scaled for kg. You would only need to do the above change if you were using lb weight to calibrate for kg readout…which would be very strange lol

2 Likes

Just to reconfirm, do you mean change the second line back to

Serial.print(scale.get_units(), 1);

Then, using a separate scale, get something that weights 1kg. Next, put a S-shaped Beam Load Cell on the desk with that 1kg weight on top. Adjust using the a and z keys until the displayed weight is 1kg. Record that calibration factor?

Finally, in the second code SparkFun_HX711_Example.ino, in the loop(), only change the unit from lbs to kg?

Yes all around

Thank you.

1 Like