scale, load cells, multi hx711 amplifiers, arduino uno

hello!
I was looking for something similar but I didn't found anything. I'm doing my scales using two and four load cells. With one hx711 everything is quite ok, maybe results are not perfect but still ok.
The problem is when I try to connect two or more HX711 to my arduino UNO- I've tried with analog pins, shared analog pin, data pins... and I think the biggest problem is to fit code to more amplifiers.
I put code for two load cells and two HX711 and scheme in here.
Code is download from Github and little modified for take two measurements and give me mean one.

I'm new in this world so please forgive me :smiley: I'm just looking for some help

I put code for two load cells and two HX711 and scheme in here.

Your diagram looks OK as far as I can see. You forgot the code. Please post that inside code tags.

I'm sorry, I was sure that I posted it :cold_sweat:

#include "HX711-multi.h"
#include "HX711.h"
#define DOUT1 2 
#define CLK1  7
#define DOUT2  3
#define CLK2  4



HX711 scale1;
HX711 scale2;

float calibration_factor1 = -3000; //-7050 worked for my 440lb max scale setup
float calibration_factor2 = -3050; //-7050 worked for my 440lb max scale setup
float suma;
int p;

void setup() {

  Serial.begin(9600);

  Serial.println("HX711 calibration sketch");
  Serial.println("Remove all weight from scale");
  Serial.println("After readings begin, place known weight on scale");
  Serial.println("Press + or a to increase calibration factor");
  Serial.println("Press - or z to decrease calibration factor");

  scale1.begin(DOUT1, CLK1);
  scale1.set_scale();
  scale1.tare(); //Reset the scale to 0

  scale2.begin(DOUT2, CLK2);
  scale2.set_scale();
  scale2.tare(); //Reset the scale to 0

  long zero_factor1 = scale1.read_average(); //Get a baseline reading
  long zero_factor2 = scale2.read_average(); //Get a baseline reading

  Serial.print("Zero factor: "); //This can be used to remove the need to tare the scale. Useful in permanent scale projects.
  Serial.println(zero_factor1);
  Serial.println(zero_factor2);

  //pinMode(2, INPUT);
  //attachInterrupt(2, srednia, FALLING );
}

void loop() {

interrupts();

  scale1.set_scale(calibration_factor1); //Adjust to this calibration factor
  scale2.set_scale(calibration_factor2); //Adjust to this calibration factor


  Serial.print("Reading1: ");
  Serial.print(scale1.get_units(), 2);
  Serial.print(" kg");
  Serial.print(" Reading2: ");
  Serial.print(scale2.get_units(), 2);
  Serial.print(" kg"); 
  Serial.print(" calibration_factor1: ");
  Serial.print(calibration_factor1);
  Serial.print(" calibration_factor2: ");
  Serial.print(calibration_factor2);
   Serial.print( "reading: ");
    Serial.println( suma/2);
  Serial.println();

  if (Serial.available())
  {
    char temp = Serial.read();
    if (temp == '+')
        calibration_factor1 += 100;
    else if (temp == '-')
        calibration_factor1 -= 100;
    if (temp == 'a')
        calibration_factor2 += 100;
    else if (temp == 'z')
        calibration_factor2 -= 100;
  }

noInterrupts();


  for(p=0; p<2; p++)
  {
    suma = scale1.get_units() + scale2.get_units();
   
   
    
  
  }
}

Ok, I see some strange things in your code, but I don't know if they could be causing a problem.

If your read your original post again, you will see that you did not truly explain what the problem is. You did not describe what happens when the script runs, why that is wrong, and what you expected to happen.

Thank you for your attention! and sorry I see this mess now :frowning: When I was writting first post this code was giving me only one measurement so does't work at all, that was the biggest problem but now (I don't know it's because I add "hx711-mulit.h" library or I just move something) my questions:

  1. My values depends a lot on point where I put weight. I have glass-square like in the bathroom scale and in the middle if I move my weight a little, my measurement changes about 5kgs (weight is 20kg) Is this possible to set something in code to fix that?
  2. When weight is 20kg my value in one point is quite accurate and varies between 19.8-20.4 k and for now it's ok but How can I get more accurate measurements to weigh light things (max 1kg?) How to reduce fluctuation?

I think you will need a sensor at each corner of the square, and add together the total from all four.