QWIIC scale & 5kg straight bar load cell, readings don't change

Hi, I have a 5kg straight bar load cell connected to a QWIIC scale. Communicating with the scale device over I2C seems to work fine, but I just get a stream of reading between about 300 and 700 regardless of how much I push or pull. Since it’s a 5kg cell, I should be able to easily apply enough force with my hands to generate changes in the readings, but I can’t.

I’ve attached some photos. One shows how the load cell is set up, bolted between two pieces of plywood. I didn’t show the end of the bar, but it’s positioned with the arrow pointing down. The intention is to suspend the load from the eyelet on the bottom of the lower (smaller) piece of plywood. The other just shows the QWIIC scale, connected to the particle.io Photon I’m using to control the system. Ignore the motor driver, resistors and extraneous wires; those are part of the rest of the system, but not currently connected or being tested.

Here’s the scale initialization code, called from setup()

void initScale() {
    initWire();
    if (!scale.begin()) {
        reportError("Scale not responding");
    } else {
        Serial.println("Scale initialized");
    }
}

And here’s the code that reads the scale, called from loop(), 200 ms between polls:

    if (scale.available()) {
        Serial.println(String("Weight: ") + scale.getReading());
    }

And ideas? Maybe the load cell I have is defective?

Your code isn’t actually reading anything from the sensor, it’s only trying to print a value that hasn’t been defined. Try the sketches in the library, those should work.

The sketches do exactly the same thing, and my code was taken from them. Using example 1 (from https://github.com/sparkfun/SparkFun_Qw … adings.ino) gives exactly the same results that I’ve been seeing: The values don’t change as I apply force.

Why do you say that getReading() returns a “value that hasn’t been defined”?

Any other ideas?

To check for a defective load cell, measure the signal voltage on the green and white wires. It should be a few millivolts unloaded and in the tens of millivolts at maximum capacity and proportional in between.