I am trying to use a UNO R3 board and a HX711 weight sensor module, along with a beam type load sensor, to measure varying forces from propellers in testing RC airplane motors.
I have a LCD Keyboard shield on the UNO board and the code seems to be working.
When the program runs the weight is reported to the LCD and Serial Monitor. I am seeing a weight of 0.0 g now when I power up or reset. The displayed value refreshes about every 4 seconds, and the value displayed will vary occasionally to -0.0 g.
When I place a 10g scale calibration weight on the beam load sensor the displayed value goes to 2.0g on the next refresh and it will occasionally vary down to 1.9 g
The article here indicates I need to calibrate the scale.:
http://www.dfrobot.com/wiki/index.php/Weight_Sensor_Module_V1
It specifically says "For calibrate the sensor for fixing the feedback floating from different sensor, need to set the Scale using the function named "setScale". Default status: void setScale(float scale = 1992.f)"
I am new to Arduino and programming, I have the O'Reilly Arduino Cookbook and have searched that and this forum for help with the setScale function but can't seem to figure out how to use it.
The code I am using now is as follows:
/*
* description:
* Code from dleroi post
* connections:
Hx711.DOUT - pin #A2
Hx711.SCK - pin #A3
HX711 A- - blue wire
HX711 A+ - white wire
load sensor load arrow points up
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#include <Hx711.h>
Hx711 scale(A2, A3);
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
lcd.setCursor(0, 0);
lcd.print(scale.getGram(), 1);
Serial.print(scale.getGram(), 1);
lcd.print(" g");
lcd.print(" ");
Serial.println(" g");
delay(200);
}
Any help with be appreciated, and any suggestions or help as to where I could have found the answer will be helpful too.
Jack
