Use HX711 with 6 wight cells

Hy
I need to use the hx711 with more than 4 cells. Because I needed 300kg and the cells measure 50kg.
On the hx711 is always pin B- and B+ free.
Can I use 2 cells on it.
Here is a diagram with 4 sensor.

Here is the cell:

E+ and E- are supposed to power your load cell, the voltage difference between A+ and A- being amplified and measured.
B+ and B- is the same as A+ and A- but the gain is fixed 32 instead of selectable 128 or 64 for channel A.
The easiest solution is to buy a 300kg load cell. Besides, how do you make sure your 300kg load is equally shared, not overloading one cell ?

Another solution is to use a single 50kg load cell and Mechanical Advantage :

1 Like

thats to much for me. what du you mean exactly.

I saw the same problem, but after some short search i fund a lot of solutions with this 50kg cell. They mount the 4 pieces between two wood plates.
The object on the woodplate will not be moved.
It's for my water-softener.
adbeefc6-0156-4c5e-b87e-5baed179e77f
The machine will not be moved.
I only fill salt in the machine and want to now, when the salt is empty and i need to refill it.
I think 200kg should be enough, but i'm not sure. s i asked how i can use 6 cells.

so it's not possible to use 6 cells?
can i use it with the B+ and B- and set the gain in the programm code?

Yes you can, accuracy will be diminished but that's all. You can then have up to 2 cells per HX711. You'll need 3 HX711 for 6 cells so, buying a single 300kg cell (~$40) might be a good option.
Or even four 75kg cells (one for each side or each corner of a square support) from here or anywhere else.
But 6 cells shouldn't be easy to balance in my opinion.

I sometime see kits with 4 load cells with one single HX711 Module but I don't know how they connect them...
The only explanation they give is "Use four sensors to form a full-bridge measurement, measuring range for the sum of four sensors: 50kg x 4 = 200kg" with no schematic...

If you don't want to spend too much (50kg cells are very cheap), try 4 of them with 2 HX711.

OK, searching the web, they simply connect all the bridges in parallel, all E+ together, all E- together, etc. Should work...
EDIT : should work but not true, see post #10 below

Exactly what i mean. See my first post. But how i can set SIX parallel? Thats my question.

Paying attention to the schematic here showed me that they don't "parallel" the 4 cells but connect them in a very clever way. I can't see how you could reproduce that with 6 cell so what you can do is connect 4 of them the way you showed on the picture up top and connect the 2 remaining cells the way the video shows for 2 cells :

but using B+ and B- instead of A+ and A-. Just make sure the digital values sent by HY711 vary in the right direction (both increase while adding weight). If not, inverse A+ and A- and/or B+ and B- accordingly

and then i need to connect the first hx711 (4 cells) and the second hx711(2 cells) with my esp8266?

The last "design" only used one HY711, 4 cell on A channel, 2 cell on B channel. But you can use 2 HY711, both on A channel. Precision-wise, "one HY711 only" should do...

Anyway, if 2 HY711, both are connected to the esp8266 and I don't think they can share pins => 2 pins required of each HY711

1 Like

sorry for my asking. i can't find the solution with the B pins. on the picutre in post #10 there are also Pin A-/A+ is used. Where did you find a version with A and B?

No "ready made" version with A and B so I used A for the 4 cell assembly (as in your post #1) and B for a 2 cell assembly, identical to the one on post #10 but connected to E+ and E- (V+ and Gnd) and B+ and B- (for the voltage sense).

okay, now i understand. i will try it

For 4 cells, I'm partial to

and

The 2+4 (or 4+4) idea sounds reasonable, but one would have to take care because the gains are different on the two channels.

i did it with 4 cells, for my first steps.

i think, i should be use babysteps for my first programms...........
later i will do it with 6 cells, for my other project.

I'm happy.
It works :wink:

it's not exactly same as my body-scale. The DIY-Scale showas 82,5kg and the other one shows 82,3kg. I think that's okay. :slight_smile:
i don't know how exactly the orginal boddy scale works........

But there is a problem with the programm code and i need some help again (sorry :frowning: )

I build the scale, to see, how heavily is my water softener machine.
When i refill salt in the box, the softener weights around 150kg.
When the salt is (nearly) empty, the softener weights around 80kg.

I will put the softener on my DIY-Scale and if the weight is under 100kg i want to get a notification.
All of this works, BUT:
It DOESN'T work, if i restart my arduino.

I tested it with 1kg sugar.

  1. i start my arduino
  2. the scale calibrate "tare"
  3. i put the sugar on it
  4. Works perfect!!

BUT if the sugar is ON the scale, when i start the arduino, it not work.
for example:

  1. Put the sugar on the scale
  2. start the arduino
  3. scale calibrate "tare" (i think here is the problem)
  4. The weight isn't correct......

I can't use the scale.....
Imagine:
The softener is full (150kg) and the arduino restart(because power failure), i CAN'T put the softener away to calibrate. It is too heavy.......

my code:

#include <Arduino.h>
#include "HX711.h"
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include "certs.h"
#include <ESP8266HTTPClient.h>

#ifndef STASSID
#define STASSID "xxxxx"
#define STAPSK "xxxxx"
#endif

// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 12;
const int LOADCELL_SCK_PIN = 13;

//variable für gewicht
float gewicht;

HX711 scale;

//######################## WLAN ##################################
//Your Domain name with URL path or IP address with path
String serverName = "xxxx.xxx/terminal/includes/helpers/waage.php";

//WIFI 
const char* ssid = STASSID;
const char* password = STAPSK;

//WIFI
X509List cert(cert_DigiCert_Global_Root_CA);

//HTTP REQUEST
HTTPClient http; 
WiFiClient client;

void setup() {
  Serial.begin(115200);

  //WIFI
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());


  //Waage
  Serial.println("Initializing the scale");

  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);

  Serial.println("Before setting up the scale:");
  Serial.print("read: \t\t");
  Serial.println(scale.read());      // print a raw reading from the ADC

  Serial.print("read average: \t\t");
  Serial.println(scale.read_average(20));   // print the average of 20 readings from the ADC

  Serial.print("get value: \t\t");
  Serial.println(scale.get_value(5));   // print the average of 5 readings from the ADC minus the tare weight (not set yet)

  Serial.print("get units: \t\t");
  Serial.println(scale.get_units(5), 1);  // print the average of 5 readings from the ADC minus tare weight (not set) divided
            // by the SCALE parameter (not set yet)
            
//kalibrationsgewicht = katzenfutter mit 1355g, gemessen wurde -31090 #################calibration factor = (reading)/(known weight)
//calibration factor = (-31090)/(1355) 
//calibration factor = -22.9446            
  scale.set_scale(-22.9446);
 
known weights; see the README for details
  scale.tare();               // reset the scale to 0

  Serial.println("After setting up the scale:");

  Serial.print("read: \t\t");
  Serial.println(scale.read());                 // print a raw reading from the ADC

  Serial.print("read average: \t\t");
  Serial.println(scale.read_average(20));       // print the average of 20 readings from the ADC

  Serial.print("get value: \t\t");
  Serial.println(scale.get_value(5));   // print the average of 5 readings from the ADC minus the tare weight, set with tare()

  Serial.print("get units: \t\t");
  Serial.println(scale.get_units(5), 1);        // print the average of 5 readings from the ADC minus tare weight, divided
            // by the SCALE parameter set with set_scale

  Serial.println("Readings:");
}

void loop() {
  //Waage
  //serielle ausgabe deaktiviert
  //Serial.print("one reading:\t");
  //Serial.print(scale.get_units(), 1);
  //Serial.print("\t| average:\t");
 gewicht = scale.get_units(10);
 Serial.println(gewicht);
  //Serial.println(scale.get_units(10), 5);


 //Send an HTTP POST request 
    //Check WiFi connection status
    if(WiFi.status()== WL_CONNECTED){
      HTTPClient http;

      String serverurl = serverName + "?gewicht=" + gewicht;
      
      // Your Domain name with URL path or IP address with path
      http.begin(client, serverurl);
       
      // Send HTTP GET request
      int httpResponseCode = http.GET();
      
      if (httpResponseCode>0) {
        Serial.print("HTTP Response code: ");
        Serial.println(httpResponseCode);
        String payload = http.getString();
        Serial.println(payload);
      }
      else {
        Serial.print("Error code: ");
        Serial.println(httpResponseCode);
      }
      // Free resources
      http.end();
    }
    else {
      Serial.println("WiFi Disconnected");
    }


  scale.power_down();             // put the ADC in sleep mode
  delay(10000);
  scale.power_up();
}

i tried to disable the tare line, but it didn't work. I thought i can disable the tare function and subratct always the same value. But i think it's not the same

The HX711 library has two functions for getting and setting the zero/tare offset:

But if you leave the scale loaded long term, the measurements would be expected to drift and creep much more than in the normal unload-zero-load-measure weighing use-case.

okay, you means i should change
scale.tare()
with
void set_offset(tare weight);

how can i know the tare weight?
only start the arduino and show the output from

serial.println(set_offset(scale.get_offset());

???

I'd try something like this after

 //...
  scale.tare();               // reset the scale to 0
  Serial.print("Offset:");
  Serial.println(scale.get_offset());

...then if you wanted to bypass the tare operation, you'd use this instead:

     //scale.tare();               // reset the scale to 0
     scale.set_offset(xxxx.xxx) // hard-code previously recorded offset