#### giuliapri

Joined Jun 17, 2021
8
Hello,

Let me start by saying that I have no real experience with electronics, so I might be making some obvious wiring mistakes.

I have two 4-wire (full bridge) load cells, and I would like to use them to build a set of scales. Most examples I have seen online use 3-wire load cells, connecting them in a Wheatstone bridge configuration, but from what I understand it should also be possible to use multiple 4-wire sensors connected in parallel.

I am using a HX711 amplifier and an Arduino MKR WAN 1300, as in the attached schematics. When I try to measure any values, though, the readings I get from the sensors are quite unstable, so that calibrating the device is not really possible. The values do go up when I apply a load, they just oscillate a lot. I have tested the two load cells individually, so I know that they work.

I’m trying to understand how to fix the problem (assuming that it can be done), but I am struggling. I’ve read a post (https://forum.allaboutcircuits.com/...into-wheatstone-bridge-configurations.152354/) where, among other things, they suggested connecting each load cell to a separate HX711 amplifier. However, by doing so I would end up having separate readings for each sensor, if I understand correctly. Is that the only solution?

Please let me know if there’s any relevant information I forgot to add.

#### Attachments

• 356.8 KB Views: 41

#### ericgibbs

Joined Jan 29, 2010
13,625
hi g,
Welcome to AAC.
Check this PDF.

Post your code and can I check it on my Arduino HX711 project.

E

#### Attachments

• 80.7 KB Views: 29

#### Irving

Joined Jan 30, 2016
2,075
Looks ok to me. I've been using generic 4-wire 5kg cells from eBay wired exactly the same way and it works fine...

#### giuliapri

Joined Jun 17, 2021
8
hi g,
Welcome to AAC.
Check this PDF.

Post your code and can I check it on my Arduino HX711 project.

E
I had already read the pdf before trying the parallel connection, when I was trying to figure out how to connect the sensors.
Part of the problem is that they gave me these two load cells for this project, but they do not have the specifications anymore. I realise that that makes solving the issue a lot harder. I have ordered two new ones, but I don’t have them yet. My goal right now is mostly to understand if there are errors in the way I wired the circuit.
Here’s the calibration script.

C++:
#include "HX711.h"

const int DOUT_PIN = 3;
const int SCK_PIN = 2;
HX711 scale;

float calibration_factor = 2230; // this calibration factor is adjusted according to my load cell
float units;
float ounces;

void setup() {
Serial.begin(9600);
scale.begin(DOUT_PIN, SCK_PIN);
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");

scale.set_scale(calibration_factor);
scale.tare();  //Reset the scale to 0

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

void loop() {

scale.set_scale(calibration_factor); //Adjust to this calibration factor

delay(1000);
units = scale.get_units(), 10;
if (units < 0)
{
units = 0.00;
}
ounces = units * 0.035274;
Serial.print(units);
Serial.print(" grams");
Serial.print(" calibration_factor: ");
Serial.print(calibration_factor);
Serial.println();

if(Serial.available())
{
if(temp == '+' || temp == 'a')
calibration_factor += 1;
else if(temp == '-' || temp == 'z')
calibration_factor -= 1;
}
}
I did an approximate calibration (as I said, the values oscillate too much) and then I used another script to get the measurements and begin working on the data. I can upload that too, if needed?

#### giuliapri

Joined Jun 17, 2021
8
Looks ok to me. I've been using generic 4-wire 5kg cells from eBay wired exactly the same way and it works fine...
Ok, thanks.
Can I ask if you used a junction box? Or did you just solder the wires?
I don't think it's a connection problem, strictly speaking, as I tried checking the wires with a multimeter, but it might be possible.

#### ericgibbs

Joined Jan 29, 2010
13,625
hi giu,
What are the lengths of the connection of the LC's to the HX711, do you have a photo shot of the project, to post.
Are the two LC's the same specification.?

Will set up a HX711 test project today, try you program and also post the program I use, works with most Arduino.

E
C-like:
// 010521_ AAC  Test EG57
// 5kG L/C Arduino Nano
// Test weight 2kG Calibrated Mass
#include <HX711.h>

HX711 scale;

void setup() {
Serial.begin(38400);
Serial.println("HX711 PJ Demo");

Serial.println("Initializing the scale");
// parameter "gain" is ommited; the default value 128 is used by the library
// HX711.DOUT    - pin #A1
// HX711.PD_SCK    - pin #A0
scale.begin(A1, A0);

// scale.set_gain(1);

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

Serial.print("Get 10 avg value: ");
Serial.println(scale.get_value(10));        // print the average of 10 readings from the ADC minus the tare weight (not set yet)

Serial.print("Get 10 avg units: ");
Serial.println(scale.get_units(10), 1);    // print the average of 10 readings from the ADC minus tare weight (not set) divided
// by the SCALE parameter (not set yet)
// this value is obtained by calibrating the scale with known weights;
scale.set_scale(363.f);
scale.tare();// reset the scale to 0
Serial.println();

Serial.println("Scale now Setup:");

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

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

void loop() {
Serial.print("Wt= ");
Serial.print(scale.get_units(1), 1);
Serial.print("  Avg= ");
Serial.println(scale.get_units(1), 1);

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

#### Irving

Joined Jan 30, 2016
2,075
I soldered them but a good tight junction should be OK. It's important that the wires are well supported and kept together to avoid erroneous readings due to mechanical strain from the wires and differential noise getting into the system.

Secondly, looking at your code, I see a problem. Although you are only reading once per second you are not waiting for the "scale ready" indication from the HX711. Here's some code that checks how fast you can read... note the wait for scale.is_ready()

scale speed test:
#include "HX711.h"

// HX711 circuit wiring

HX711 scale;

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

void loop() {
static long x = millis();
long wait = millis()-x;
x = millis();
Serial.print("HX711 wait time: ");
Serial.println(wait);
}
}

#### giuliapri

Joined Jun 17, 2021
8
I soldered them but a good tight junction should be OK. It's important that the wires are well supported and kept together to avoid erroneous readings due to mechanical strain from the wires and differential noise getting into the system.

Secondly, looking at your code, I see a problem. Although you are only reading once per second you are not waiting for the "scale ready" indication from the HX711. Here's some code that checks how fast you can read... note the wait for scale.is_ready()
Thank you.

I have also just tried adding the
line in my calibration sketch, but it didn't change much.

#### ericgibbs

Joined Jan 29, 2010
13,625
hi,
Can you answer post #6 queries.?
E

#### giuliapri

Joined Jun 17, 2021
8
hi giu,
What are the lengths of the connection of the LC's to the HX711, do you have a photo shot of the project, to post.
Are the two LC's the same specification.?

Will set up a HX711 test project today, try you program and also post the program I use, works with most Arduino.

E
Hi,

The connection is about 30 cm long, I would say.
Thank you for the code. I tried using it, but the "result" is mostly the same, in the sense that it doesn't give me usable/stable values.

#### giuliapri

Joined Jun 17, 2021
8
hi,
Can you answer post #6 queries.?
E
Sorry, my replies are a little slow. The results meaning the values I obtain with my calibration sketch?

Here they are (the red line indicates what happens when I add a weight).

Last edited:

#### ericgibbs

Joined Jan 29, 2010
13,625
hi.
These readings are for a HX711 with 5kG LC, using the program I posted, no Weight on scale.

E

#### ericgibbs

Joined Jan 29, 2010
13,625
hi,
With a 500gm calibrated weight on my program and HX711

E

#### Attachments

• 16.8 KB Views: 11

#### ericgibbs

Joined Jan 29, 2010
13,625
hi,
This is your program, what do expect to see on the printout.??
E

Update:
Just checked your +/- for Cal, thats not the way its done, try my program, post the result.

#### Attachments

• 43.6 KB Views: 8
• 48.3 KB Views: 6
Last edited:

#### giuliapri

Joined Jun 17, 2021
8
This is what happens with your program, with no weight on the scale.

#### ericgibbs

Joined Jan 29, 2010
13,625
hi g,
You have either a faulty Load Cell or a poor connection or HX711
Can you retry with just one Load Cell connected, then try the other LC on its own.

Without any weight on the Load Cells.

Post what you measure,

E
Check my post #14 with your program, looks OK to me.

#### Attachments

• 449.1 KB Views: 15

#### giuliapri

Joined Jun 17, 2021
8
hi g,
You have either a faulty Load Cell or a poor connection or HX711
Can you retry with just one Load Cell connected, then try the other LC on its own.

Without any weight on the Load Cells.

Post what you measure,

E
Check my post #14 with your program, looks OK to me.
I should get the new load cells tomorrow, so I'll just wait and see if that helps. Thank you for all your help!

#### ericgibbs

Joined Jan 29, 2010
13,625
hi,
OK, I would use a baud rate of 34800,let's know how it goes
E

Last edited:

#### Irving

Joined Jan 30, 2016
2,075
I'd be wary of the header you're connecting the load-cell to. The connection resistance on those can be very poor and vary significantly with vibration unless there is a good mechanical interface. Either replace with screw terminals or solder your LC wires to a proper matching pin-header (apologies if you have done so, but from this angle it appears not).

Also, where the wires come off the LC tape them down to the base plate within the first few cm and away from the strain-gauges themselves. Finally its a good idea to twist the flying leads together, about 1 twist per cm, this significantly reduces noise and coil them neatly to reduce the overall physical length; it also helps to keep the leads well away from power supplies, microcontrollers or anything generating electrical noise.

#### kaindub

Joined Oct 28, 2019
88
I had exactly the same problem.
I think I solved it by using a different hx711 sketch.
im sorry I’m not more helpful but once I solved the problem I moved on.
It is not a hardware problem, I can be certain.