Open 10git opened 4 years ago
I have had the same issue and worked out how to do it: You have to check if the sensor is ready to spit out the data and as soon as it is, you can read the data. Of course your sampling rate is limited by how fast the Arduino runs through one "loop", but using the minimal code below I got very close to 40 samples a second. If you wanted to take it further you could figure out how to have the Arduino trigger an interrupt on the falling clock signal of the HX710 and then read the data... Hope that helps
#include "HX711.h"
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
void setup() {
Serial.begin(57600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_gain(64);
}
void loop() {
if (scale.is_ready()) {
Serial.println(scale.read());
}
}
The check you mention is already done in the read() method. Unfortunately, as expected, when running the minimal code, the values are still increasing over the time. Even for the interrupt version of your code I still have the same odd behaviour.
#include "HX711.h"
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
void setup() {
Serial.begin(57600);
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_gain(64);
attachInterrupt(digitalPinToInterrupt(LOADCELL_DOUT_PIN), get_it, LOW);
}
void loop() { }
void get_it() {
Serial.println(scale.read());
}
Im too having a similar kind of an issue, Please share if you find the solution and ill share if i find one.
i want to convert this values into pressure units, can anyone explain how to do it
i want to convert this values into pressure units, can anyone explain how to do it
Zero out, apply full scale pressure, note output. Output divided by full scale pressure is calibration coefficient.
I'm using the HX710b pressure sensor hooked on Arduino Uno R3. Arduino is powered by the USB cable.
When running the HX711_full_example I get increasing values at each reading:
I set different gain values, as you suggested in the issue https://github.com/bogde/HX711/issues/180, but I still have the same bad behaviour.
Strange thing: the device gives me readings even when I disconnect its GND from the Arduino's GND:
Some more measures show that: