Hello! I'm using an Omega 2-lead strain gauge (Pre-Wired Strain Gauges for Easy Installation), reading from a shield with an Hx711 (https://www.amazon.com/DIYmall-Weighing-Conversion-Sensors-Microcontroller/dp/B010FG9RXO/ref=pd_lpo_sbs_147_t_0?_encoding=UTF8&psc=1&refRID=MAZ7MPSVCKXWY7J3DQ3H).
I'm using the code below to read out data from the Hx711. I'd like to measure strain, which I can do if I can see the original voltage outputted by the strain gauge. When I measure my Wheatstone bridge with a multimeter, I read somewhere in the order of a few milivolts. The amplified signal outputs around 3x106. Is there a way I can use the output from the amplifier to extract the voltage in milivolts? Is there a simply way to determine what gain the amplifer has? From what I know the Hx711 can have three gains: 32, 64, 128.
/* 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[10];
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++)
{
digitalWrite(A0, LOW);//SCK is made LL
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
bitWrite(x, 0, digitalRead(A1));
x = x << 1;
}
clk(); //25th pulse
Serial.println(x);
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);
}
void clk()
{
digitalWrite(A0, HIGH);
digitalWrite(A0, LOW);
}
I'm happy to provide more detail if needed.
-Brady