I think I have it all wired correctly and it is brand new... My only question is how do I know if the actual amplifier is shot? All it will ever read is "0g" and I've tried multiple codes.... I soldered the pins in the board and I'm a newbie to soldering so I was wondering if maybe I did too much and messed the board up.
ordered this from Sainsmart.... any help is greatly appreciated!
sorry... thought i was copying and pasting different pictures instead of the same one over and over. :o
I'm pretty sure your soldering is the problem. Those big balls of solder are connecting things that shouldn't be connected.
i cut away some of the bad soldering and that seemed to fix it.... now i'm trying to calibrate it and I'm getting some crazy #s. I've watched youtube videos and my serial monitor doesn't look like theirs. Not sure what to even put in the "analog readout" section since the #s are so crazy..
Post text, not images of text
I will... I just thought this would show the serial monitor as well as the code.
[code/]
#include <Hx711.h>
// Arduino as load cell amplifier
// by Christian Liljedahl
// christian.liljedahl.dk
// 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 = 500 kg. B = 1000 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 = 500; // g
int analogvalA = 2.4; // analog reading taken with load A on the load cell
float loadB = 1000; // g
int analogvalB = 600; // 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 = 200; // We want a reading every 200 ms;
void setup() {
Serial.begin(9600);
}
void loop() {
int analogValue = analogRead(0);
// running average - We smooth the readings a little bit
analogValueAverage = 0.99*analogValueAverage + 0.01*analogValue;
// 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();
}
}
float analogToLoad(float analogval){
// using a custom map-function, because the standard arduino map function only uses int
float load = mapfloat(analogval, analogvalA, analogvalB, loadA, loadB);
return load;
}
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}






