 # Strain Gauge + HX711

Hi,

I'm currently working on a project in which I'd like to measure the strain of a rubber part.
I wanted to use a strain gauge + a HX711 amplifier + a Arduino Mega controller, to be able to measure these values.

However, I read many articles and projects but I didn't understand how I convert the raw data that I obtain on my PC to strain values.

Do you know what's the formula to convert the values obtain on my Arduino Monitor?

Thanks for your help Hugo

You give me the following data, and I will give you the formula.

1. Connect SCK-pin of HX711 Module with A0-pin of MEGA; connect DT-pin of HX711 with A1-pin of MEGA.

``````/* This program takes 10 samples from LC + HX711B at
1-sec interval and then computes the average.*/

unsigned long x = 0, y = 0;
unsigned long dataArray;
int j = 0;
void setup()
{
Serial.begin(9600);
pinMode(A1, INPUT); //data line  //Yellow cable
pinMode(A0, OUTPUT);  //SCK line  //Orange cable
}

void loop()
{

for (int j = 0; j < 10; j++)
{
while (digitalRead(A1) != LOW) //wait until Data Line goes LOW
;
{
for (int i = 0; i < 24; i++)  //read 24-bit data from HX711
{
clk();      //generate CLK pulse to get MSB-it at A1-pin
x = x << 1;
}
clk();  //25th pulse
Serial.println(x, HEX);
y = x;
x = 0;
delay(1000);
}
dataArray[j] = y;
}

Serial.println("===averaging process=========");
unsigned long sum = 0;

for (j = 0; j < 10; j++)
{
sum += dataArray[j];
}
Serial.print("Average Count = ");
sum = sum / 10;
Serial.println(sum, HEX);
}

void clk()
{
digitalWrite(A0, HIGH);
digitalWrite(A0, LOW);
}
``````

3. Put known weight (say, 1kg) on your strain gauge/load cell and record the value of Average Count as Count-A.

4. Put known weight (say, 2kg) on your strain gauge/load cell and record the value of Average Count as Count-B.

5. Please, post the values of: Count-A and Count-B. You can also find the equation (y = mx+c) for the unknown weight/strain from these two known points.

Hi,

The only problem is that I’ve just ordered my amplifier, so I’m not able to test your program right now… However, if I understood, I should obtain numerical values, coded on n bits and it should increase linearly with my strain?
This is where I had questions, since I thought I had to convert numerical values to a Voltage difference, then convert it to a Resistance difference and eventually, obtain my strain value.

Cheers It is assumed that the strain gauge is real and linear; the ADC (HX711) is also real and linear.

Real refers to the fact that every sensor/system has inherent gain and offset. An ideal system has unity gain and no offset.

Linear refers to the fact that a sensor/system produces output (response) that is proportional to the input (excitation).

You just solve the equation of the form y = mx + c for the unknown weight (wtX, countX) from these two konwn points: A(wtA, countA) and B(wtB, countB).

(countB - counA)/(wtB - wtA) = (countX - countB)/(wtX - wtB)

==> wtX = m*countX + c // m and c are constants for your system; countX = average count = sum/10 for wtX.

Great news! Thanks for the explanation!

I'll try this when I get my amplifier!

Have a nice day By the way, do you have any idea of which strain gauge should I choose to measure strains around 1.0 e-6 ?
Is it possible with a standard one?

Hello!

I’m coming back to you to know how should I connect my strain gauge to my HX711 cell and Arduino.
If anyone could help me with the electronic circuit, it would be awesome I'm coming back to you to know how should I connect my strain gauge to my HX711 cell and Arduino.
If anyone could help me with the electronic circuit, it would be awesome Hi!

It would be this one : https://fr.rs-online.com/web/p/jauges-de-contraintes/8656226/

Thanks! OK! Connect your strain gauge as per following diagram; where, the strain gauge will take the place of R3. Upload the program that I have already posted and report the results (the counts). there is no harm to make a safe try.  Hello!

Finally, I read that I could also use this component :

Do you really think this load cell component could measure strain on the surface of an aluminium sample?

Thanks Hi,

I'm trying to measure strain values in tension of an aluminum sample. I thought of sticking a strain gauge on my sample, to measure the strain on the surface of it.

We told me that I may do that with this component :Load Cell - 5kg, Straight Bar (TAL220B) | Load Cell | Sensors | EXP Tech

Do you really think I could do that with this component, or is it only for weight measurement?

Thanks! Do you really think this load cell component could measure strain on the surface of an aluminium sample?

No hard to give a try?

Sure I could but I'd rather know if it works before I buy it.. Sure I could but I'd rather know if it works before I buy it.. Get it; test it; tell us your experience. Experiments cost time, money, happiness, and many more; but, the return is abstract to describe which the dictionary falls of adjective.

Do you really think this load cell component could measure strain on the surface of an aluminium sample?

No. But depending on the details (which you have not shared), it could be used to measure the force applied to the sample, and from the force you could estimate the strain in the sample (in the linear region of stress vs strain).

Also, your original post said you want to measure the strain in a rubber part. Now it is aluminum. Aluminum or rubber: which is it?

And, to get better help, post a photo or drawing showing the part(s) and where you want to measure the strain.

Hi to everyone ! I’m trying to get strains from a Strain Gauge, a Whatstone’s bridge, a HX711 and an Arduino Uno. I saw in different places that I can get the strain from the voltage but I don’t know how. Could someone help me in order to get strain in a tension test with my circuit ? Also, if someone could show me the code for Arduino Uno will help me a lot. Thanks !

Aren't the DT and SCK digital channels? Why are we connecting them to the A0 and A1?

Did it work?