Wiring multiple HX711


I am at the very beginning of multiple load cells project, and I have found this library to work with it, but I don't really understand how to wire multiple HX711, there is an instruction for this but still, I don't really get it:

"Connect all HX711 units to share a single clock line, and plug each data line from the HX711 to a different pin on the Arduino"

Could someone please help me with this, and maybe draw a scheme?

Thanks a lot

Have a look at the example

// Pins to the load cell amp
#define CLK A0 // clock pin to the load cell amp
#define DOUT1 A1 // data pin to the first lca
#define DOUT2 A2 // data pin to the second lca
#define DOUT3 A3 // data pin to the third lca

and at the data sheet of the HX711. I found one with Google (and there is a link on the Github page). On the first page you can see a block diagram. There are two pins DOUT and PD_SCK and a bracket saying To/From MCU.

As the text says connect all clock to single line. In the source code above that is A0. Connect this to PD_SCK of all of your HX711.

Arduino pin A0 -> first HX711 pin PDSCK
Arduino pin A0 -> second HX711 pin PDSCK
Arduino pin A0 -> third HX711 pin PDSCK

Then connect the DOUT pins separately

Arduino pin A1 -> first HX711 pin DOUT
Arduino pin A2 -> second HX711 pin DOUT
Arduino pin A3 -> third HX711 pin DOUT

Because all three HX711 have the same clock signal they will all do the same thing at the same time. The Arduino will read and write to each of them using the data pins (DOUT).

Hope this helps. :slight_smile:

It's a synchronous serial interface.

Assume you're trying to read data from the device. You're ready to read the next bit of data but the device doesn't know that yet. So you send a pulse on the "clock" line to let it know to set the output to high or low so you can read it. Some specific time after setting the clock, you read the data line and save away that value as one bit of a byte.

The clock doesn't have to be consistent. You could send 8 pulses in a microsecond or maybe wait several milliseconds between pulse 2 and 3. The device doesn't care. It just waits for those pulses.

Asynchronous serial is what we're more used to. The basic Serial connection on every Arduino is asynchronous. There's no separate clock wire. The receiver must detect the initial "start bit" on the data wire and start counting off time to make 8 samples. Those 8 samples become the 8 bits of a byte. If the receiver has something important to do between bit 2 and 3, then it is lost. It can never recover what that data was supposed to be because it wasn't listening to bit 3.

This is why regular Serial always has a baud rate. It always has a speed that must be identical for sender and receiver.

I looked at that HX711 library last year. It is great to use if you don't have a lot of spare pins available. It is also faster, since you can download all your sensors at the same time. I did not use it for my project with 4 strain gauges because I had enough pins and enough speed. (80Hz is pretty slow. If you can't read 4 of these chips in 12.5ms then you have bigger problems.)