So we are creating a weighing scale using a 200kg straight bar loadcell with hx711 adc, but no matter what code I use, I don't get any readings, I already tried changing the module and the loadcell, still no readings. what shoud I do? need help please
#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}
void loop() {
if (scale.is_ready()) {
long reading = scale.read();
Serial.print("HX711 reading: ");
Serial.println(reading);
} else {
Serial.println("HX711 not found.");
}
delay(1000);
}
I included some photos in the attachments[sorry I'm new here and I dont know how to post them]
Defining the variable for every turn of loop is maybe ok but looks odd to me. At initialization "reading" is set to zero. Is scale.read() defined to deliver a long? If not, declare "reading" in accordance to the definition of the function.
Hi, totally new here, I was wondering if you solved this problem?
I had a similar ish thing with Arduino Mega2560, Hx711 and 120kg load cell and the same code you posted.
I started with “...not found”
My initial trouble shooting was to swap SCK and DT that resulted in a reading of 0.
Once I found my multi-meter I got back on track and discovered I had not properly soldered the header to GND on the HX711 board.
Well i didn't exactly put 2 230v wires together eh ? hahaha . It's still a voltage and a readout, so
no matter how you connect them, you can't harm the load cell .
Anyhow, this is how i started as a connection, and this is how it's still connected now.
bartdereu:
Well i didn't exactly put 2 230v wires together eh ? hahaha . It's still a small voltage and a readout trough resistors, so no matter how you connect them, i don't think you can harm the load cell .
Anyhow, this is how i started as a connection, and this is how it's still connected now.
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
void setup() {
Serial.begin(9600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
Load cell data pin is defined to be 2 and CLK to pin 3. BUT in the drawing shown Data and CLK are connected the opposite way. I can't tell whether the scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN); have the arguments in the wrong order or if the pin definition is swapped.
These things had been checked indeed, and were correct.
The problem is solved now, it was very very stupid ! one of the solderings on the hx711
was bad , so there was no connection from the pin to the pcb. I re-soldered the whole
thing and it works like a charm now.
If may can be helpful to someone, I've considered this library the best for arduino GitHub - olkal/HX711_ADC: Arduino library for the HX711 24-bit ADC for weight scales cause it can also save calibration on EEPROM (and not only for that)
I've solved my zero read by wiring differently the sensor, red and green cable from sensor were crossed/wrongly colored (do a measure with tester and be sure the load of the resistive bridge is balanced)