Hello everyone!
I'm working on a project, where its needed to recieve measurments from multiple (3) load cells attached to the Arduino (Arduino 33 IoT BLE). Beside that, I'm using HX711 amplifiers for those load cells.
The problem is - I don't know how to correctrly separate those measurments, so that Arduino can understand what loadcell is having what output.
I used regular example from the HX711 library, but even there I don't see options to do so. Is it possible without to have separated measurments without usage of combinator board/multiple arduino's?
#include "HX711.h"
// HX711 circuit wiring
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);
}
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);
}
A glimmer of hope! Forgive my lack of knowledge as I begin my journey into the Arduino world. As a newbie, I’ve been really intrigued with all of the neat stuff I can possibly do with this new, albeit limited, knowledge. I’ve automated my greenhouse and have now moved on to building a system to keep track of the weight of four different beer kegs. I’ve tried a number of sketches, both included in the ide and imported ones.
Here is what I see with your sketch reading 3 of the 4 cells:
Since there is such a difference on the readings, I’m thinking I may have defective load cells. (I also don’t know what the readings mean. But one step at a time.)
Hi....can you tell me how i do this whith the joystick, so the pc can see it as gamepad?
And if the load cells are diferent, 2 from 20 kg and 1 for 100kg, how can i do it?
Thanks in advance
Hi ec2021,
Do you think that it could be possible to define an array of objects like scale[3] to be used instead of naming each scale separately? The aim is to use a structure like:
for (i = 0; i <= 2; i++) {
scale[i].begin(dataPin[i], clockPin[i]);
}
It didn't work because I made a mistake downstream in the code. After receiving your answer I found the mistake. I shall choose your solution because it looks better than mine. The array for data and clock pins was defined as well:
I am only using 2 hx710b's but I've found you don't have to have a seperate sck pin for each hx7xx. You can happily reuse the same pin for all your hx7xx clock inputs somewhat as you do for I²C clock lines. Just seperate the data lines and all should be good. Yes, the other hx7xx's will respond to the clock line but the library will ignore all data lines not in your specific constructor for the sensor you want to read.
Larry
Hello @VincentBlackwall , can you please suggest exact application with ESP32 and the weight values should be displayed on the webpage can you help in these one
Thank you In Advance