HX711 Load Cell Amplifier Issue

Hi everyone,

I am trying to measure mass using a HX711 load cell amplifier connected to a Arduino UNO, however, after attempting to run the program, I get infinity kg output.

I have checked the wires connecting the load cell for correct resistances, and I checked that the amplifier receives power. Is there anything else I might be missing?

Below is the code I am attempting to execute. I followed the Load Cell Amplifier HX711 Breakout Hookup Guide from Sparkfun to do the connections and for the assistance with the code.

#include "HX711.h"

#define calibration_factor 0

#define LOADCELL_DOUT_PIN  3
#define LOADCELL_SCK_PIN  2

HX711 scale;

void setup() {
  Serial.begin(9600);
  Serial.println("HX711 SCALE");

  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
  scale.set_scale(calibration_factor);
  scale.tare();
}

void loop() {
  Serial.print(scale.get_units(), 1);
  Serial.print(" kg");
  Serial.println();
}

Why don't you try he Sparkfun basic example and see if it works?

I am using their basic example, as far as I know?

You would find the basic example here.

The library readme shows set_scale() used as

loadcell.set_scale(LOADCELL_DIVIDER);

My guess is that you're seeing infinities because you are passing zero to set_scale(). Your reading is then being divided by zero somewhere in the library code.

1 Like

The sparkfun basic example is located at the link provided by @toddnz.
Use it WITHOUT any modifications

Hi, yes you are totally correct. I removed it and it seems to be giving out actual values now. Thanks!

hi, may i know are you trying the sparkfun basic example coding? because my value is keep on 0. at first i get the value. but then, it keep on to be 0

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.