Greetings to all,
I have been trying to experiment with HX711 Load Cell with the following code, but the collected data prove to be inaccurate an imprecise. I have double-checked the wires, and the connections seem to match. I assume the code is correct, but I have posted it in case.
I doubt that the sensor is not oriented in the right manner. I have placed the sensor on the 3d-printed platform, "pasted" them together with an instant adhesive. Perhaps that's causing the fluctuation..? Please refer to the attached photos.
One weird thing, the weight I place on the other side of the sensor is not reflected in the monitor. However, when I touch the end with a finger, the data change inexplicably.
What should I check first? I will try to confirm if the connections are appropriately made, but I am really unsure if it's causing the problem.
I can't thank you more for taking your time to read my problem.
#include "HX711.h"
#define DOUT 3
#define CLK 2
HX711 scale;
float calibration_factor = -375; //-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(DOUT, CLK);
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;
}
}