Hello everyone! I am a newbie in electronic and arduino stuffs but I am trying to build a scale to measure and register weight through the time. I used four 50kg 4 wired load cell (specifications in this link) each one connected to a HX711. Initially, one of the HX711 did not work using channel A (the measuring don't vary even I put different weights and I double checked the wires many times, I thought it would be the HX711 problem, but changing to channel B, I got reasonable values).
I connected the load cell to HX711 as recommended by this post .
Red E+
Black E-
White A- (or B-)
Green A+ (or B+)
From the HX711, GND and VCC were connected to GND and 5V from the Arduino UNO. SCK and DT were connected to digital pin from 9 to 2.
I used this code to get the HX711/load cell readings
#include "HX711.h"
const int LC1_DOUT_PIN = 8;
const int LC1_SCK_PIN = 9;
const int LC2_DOUT_PIN = 6;
const int LC2_SCK_PIN = 7;
const int LC3_DOUT_PIN = 4;
const int LC3_SCK_PIN = 5;
const int LC4_DOUT_PIN = 2;
const int LC4_SCK_PIN = 3;
float calibration = 1;
float offset = 1;
HX711 balanca1;
HX711 balanca2;
HX711 balanca3;
HX711 balanca4;
unsigned long ult_tempo = 0;
unsigned long tempo = 0;
void setup() {
Serial.begin(38400);
Serial.println("Teste HX711");
Serial.println("Iniciando a balanca");
balanca1.begin(LC1_DOUT_PIN, LC1_SCK_PIN, 128);
balanca1.set_scale (calibration);
balanca1.set_offset (offset);
balanca2.begin(LC2_DOUT_PIN, LC2_SCK_PIN, 128);
balanca2.set_scale (calibration);
balanca2.set_offset (offset);
balanca3.begin(LC3_DOUT_PIN, LC3_SCK_PIN, 128);
balanca3.set_scale (calibration);
balanca3.set_offset (offset);
balanca4.begin(LC4_DOUT_PIN, LC4_SCK_PIN, 32);
balanca4.set_scale (calibration);
balanca4.set_offset (offset);
}
void loop() {
tempo = millis();
if(tempo - ult_tempo >= 2000){
Serial.print("balanca1: ");
Serial.println(balanca1.get_units(10));
Serial.print(balanca2.get_units(10));
Serial.print(" balanca3: ");
Serial.print(balanca3.get_units(10));
Serial.print(" balanca4: ");
Serial.println(balanca4.get_units(10));
ult_tempo = tempo;
}
}
As indicated in some materials, I added and removed some known weights to do a calibration curve. Those materials (and a friend of mine that know some metrology basis) suggested to use the average of the electrical signal (in mV) from the load cells to construct the calibration curve.
The signal has increased when I put some weight and decreased when I removed them. In total, there were 5 loading and unloading cycles.Although, the signals that were read from HX711 had different magnitude, even three of them has amplified by 128x (cell 1, 2 and 3) and one by 32x (cell 4), as shown in the attached figure.
So I divided the signal from load cell 1 to 3 by 128 and load cell 4 for 32, taked their average and constructed the curve using the weight that I placed to the platform above the load cells.
Aparently it has a good fixing but I am not sure if the measured/amplified signals from HX711 are the mV multiplied to 128, 64 (for channel A) and 32 (channel B) or I need to do some other calculations to have the mV values from each load cell? And having those different magnitude from the same type of load cell is reasonable?
Many thanks for your attention.