I am having trouble with my load cell project. I did the wiring when I run my code, I get values in a range of numbers. The problem is when I apply load on the sensor I can not see any change on the display screen. The code that I am using is below.
// Load cells are linear. So once you have established two data pairs, you can interpolate the rest.
// Step 1: Upload this sketch to your arduino board
// You need two loads of well know weight. In this example A = 10 kg. B = 30 kg
// Put on load A
// read the analog value showing (this is analogvalA)
// put on load B
// read the analog value B
// Enter you own analog values here
float loadA = 0.10; // kg
double analogvalA = 0.25; // analog reading taken with load A on the load cell
float loadB = 0.030; // kg
double analogvalB = 0.10; // analog reading taken with load B on the load cell
// Upload the sketch again, and confirm, that the kilo-reading from the serial output now is correct, using your known loads
float analogValueAverage = 0;
// How often do we do readings?
long time = 0; //
int timeBetweenReadings = 500; // We want a reading every 200 ms;
void setup() {
Serial.begin(9600);
}
void loop() {
double analogValue = analogRead(0);
// running average - We smooth the readings a little bit
analogValueAverage = 0.99analogValueAverage + 0.01analogValue;
// Is it time to print?
if(millis() > time + timeBetweenReadings){
float load = analogToLoad(analogValueAverage);
Serial.print("analogValue: ");Serial.println(analogValueAverage);
Serial.print(" load: ");Serial.println(load,5);
time = millis();
}
}