I am making a custom load cell for work. I am using an Arduino Nano to read SparkFun’s HX711 Load Cell Amplifier which reads a wheatstone bridge. I have the bridge balanced to plus/minus 5 mV and is attached to the HX711 board using the attached schematic. For testing, I have attached the strain gage to a piece of aluminum which is easily deflected by hand. I have downloaded the recommended library and I’ve been trying to use SparkFun’s Calibration file to obtain the calibration factor. No matter how little or much I deflect the bar, the Arduino always reads zero with an occasional spike (up to 1000 lbs when not touching the bar). Any help troubleshooting this would be greatly appreciated.
Have you verified proper function of the strain gauge alone, using your multimeter?
If not, power it with 5V and check that the voltage across the two outputs varies as expected, when you apply force.
For help with the Arduino setup, please post a complete schematic, with pins and parts clearly labeled, and the code, using code tags.
Thanks for the quick response. After performing some checks, I found that there wasn’t any voltage differential between the RED/BLK pins on the HX711 board. After replacing the wire from the Arduino to the CLK pin, it started working. However, after getting numbers printing out, I noticed that there is some rather significant drift (see attached graph) and the readings are sinusoidal. What could be causing this?
The pins between the HX711 board and Arduino are as follows:
VDD/BCC → 5v
DAT → A3
CLK → A2
GND → Gnd
I am using the SparkFun_HX711_Calibration code with the only modification being to the DAT and CLK pins.
#include “HX711.h” //This library can be obtained here http://librarymanager/All#Avia_HX711
#define LOADCELL_DOUT_PIN A3
#define LOADCELL_SCK_PIN A2
HX711 scale;
float calibration_factor = -7050; //-7050 worked for my 440lb max scale setup
void setup() {
Serial.begin(9600);
Serial.println(“HX711 calibration sketch”);
Serial.println(“Remove all weight from scale”);
Serial.println(“After readings begin, place known weight on scale”);
Serial.println(“Press + or a to increase calibration factor”);
Serial.println(“Press - or z to decrease calibration factor”);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale();
scale.tare(); //Reset the scale to 0
long zero_factor = scale.read_average(); //Get a baseline reading
Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
Serial.println(zero_factor);
}
void loop() {
scale.set_scale(calibration_factor); //Adjust to this calibration factor
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1);
Serial.print(" lbs"); //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();
if(Serial.available())
{
char temp = Serial.read();
if(temp == ‘+’ || temp == ‘a’)
calibration_factor += 10;
else if(temp == ‘-’ || temp == ‘z’)
calibration_factor -= 10;
}
}
The drift could be due to temperature change, possibly self heating of the strain gauge.
I see no sinusoidal signal, but long unshielded wires are antennas and readily pick up electrical noise from the environment.