How do I add a limit to my load cell

[color=#333333]
[pre] I am using this code to get a reading from an S type Load cell from an Arduino UNO. The amplifier that I am using is HX711. Using this program the serial monitor prints values constantly. I need the serial monitor to report values on between 1 and 2 lbs and ignore the rest

*/
#include "HX711.h"

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define LOADCELL_DOUT_PIN 3
#define LOADCELL_SCK_PIN 2

HX711 scale;

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

scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

Serial.println("Readings:");
}

void loop() {
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
Serial.println();
}[/color][/pre]

Well, that could’ve gone better.

Try:

I am using this code to get a reading from an S type Load cell from an Arduino UNO. The amplifier that I am using is HX711. Using this program the serial monitor prints values constantly. I need the serial monitor to report values on between 1 and 2 lbs and ignore the rest

#include "HX711.h"

#define calibration_factor -7050.0 //This value is obtained using the SparkFun_HX711_Calibration sketch

#define LOADCELL_DOUT_PIN 3
#define LOADCELL_SCK_PIN 2

HX711 scale;

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

 scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
 scale.set_scale(calibration_factor); //This value is obtained by using the SparkFun_HX711_Calibration sketch
 scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0

 Serial.println("Readings:");
}

void loop() {
 Serial.print("Reading: ");
 Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
 Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
 Serial.println();
}

In a metric world, why would you want to use pounds?

What have you tried to filter your results?

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