Hello, guys!
So I need to use a wight sensor on my project, but it simply doesn't work. Acording to internet tutorials, I need to calibrate the sensor and here is the steps:
- Compilate the calib program to arduino with no weight
- the monitor serial will show some numbers
- Put a known weight on the sensor
- the serial monitor will show different numbers from step 2.
- To calculate the scale, you need to divide the avarage of the numbers of step 4 by the known weight you put on the step 3.
the things went wrong in the step 4, the monitor doesn't show different numbers from step 2. It keeps sending random numbers ( the numbers aren't even close to each other).
I can't set a scale because of this.
Can you guys help me please?
Here is the code I'm using to calibrate (the coments are in portuguese, i'm sorry):
#include <HX711.h>
// DEFINIÇÕES DE PINOS
#define pinDT A2
#define pinSCK A0
#define pinBotao 4
// INSTANCIANDO OBJETOS
HX711 scale;
// DECLARAÇÃO DE VARIÁVEIS
float medida = 0;
void setup() {
Serial.begin(57600);
scale.begin(pinDT, pinSCK); // CONFIGURANDO OS PINOS DA BALANÇA
scale.set_scale(); // LIMPANDO O VALOR DA ESCALA
delay(2000);
scale.tare(); // ZERANDO A BALANÇA PARA DESCONSIDERAR A MASSA DA ESTRUTURA
Serial.println("Balança Zerada");
}
void loop() {
medida = scale.get_units(5); // SALVANDO NA VARIAVEL O VALOR DA MÉDIA DE 5 MEDIDAS
Serial.println(medida, 3); // ENVIANDO PARA MONITOR SERIAL A MEDIDA COM 3 CASAS DECIMAIS
scale.power_down(); // DESLIGANDO O SENSOR
delay(1000); // AGUARDA 5 SEGUNDOS
scale.power_up(); // LIGANDO O SENSOR
}