Read mv from HX711

Hi, anyone can help me?, I need to read mv from a load cell (-4mv - 4mv).
So, i bought a ADC HX711, but, all the examples that i found are to get weight results, but i need mv.
Also, i bought an opamp LM325 to increase the signal, but the arduino dont get exact values.
Help me :frowning:

but, all the examples that i found are to get weight results, but i need mv.

In those examples there will be a bit where you do an analogRead. That is the number that you convert into a voltage reading by multiplying it by 5/1024

Also, i bought an opamp LM325 to increase the signal, but the arduino dont get exact values

Exact? What does this mean.

How have you wired this up? Pleas post a schematic, note this means a schematic, not a Fritzing physical layout.

@OP

The HX711 Module contains a x64 Amplifier for Ch-A and a 24-bit Serial ADC. The input (differential mode) DC voltage that the module supports is 0 mV - 12 mV. The ADC of the modules saturates for an input voltage of about 14 mV. Therefore, care should be exercised so that the input voltage remains within safe region -- 0 mV to 10 mV. In fact, the HX711 Module is specially designed for Load Cell which provides about 0 mV - 10 mV signal for a Load of 0 kg - 30 kg. (It could also be used with other Load Cells of different capacities, but I have no idea about that.)

These are the steps to be followed to use HX711 Module as a DVM to measure input voltage of the range:
0 mV - 12 mV.

1. Connect UNO, HX711, and I2CLCD (optional) as per following diagram.
hx711.png

2. Inject known voltage (say, V1 = 5 mV) across A+/A- terminals of the Module. Upload the following program and record the count (say C1) from the Serial Monitor.

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();
      Serial.println(x, HEX);
      y = x;
      x = 0;
      delay(1000);
    }
    dataArray[j] = y;
  }

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

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

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

3. Inject known voltage (say, V2 = 10 mV) across A+/A- terminals of the Module. Reset the UNO for re-execution of the up;oaded program of Step-2. Record the count (say C2) from the Serial Monitor.

4. From known points A(V1, C1) and B(V2, C2) of Step-2 and 3, derive the equation (y = mx + c) for the unknown voltage (V) in terms of counts (C) -- V = mC + k. (C will be delivered by the ADC of HX711 Module.)

(V2 - V1)/(C2 - C1) = (V - V1)/(C - C1)
==> V = mC + k   // ma and k are known values

For my points: A(0.75 mV, 0xDBF8A), B(1.65 mV, 0x1C92C0), and Q(V, C); I have the following equation:

(1.65 - 0.75)/(0x1C310A - 0xDBF8A) = (V - 0.75)/(C - 0xDBF8A)
==> float V;
V = (float)0.90*(C - 901002)/946560 + 0.75   mV
Serial.print(V, 2);
Serial.println(" mV");

hx711.png

Also, i bought an opamp LM325 to increase the signal,

The LM325 is not an op amp, it is a dual voltage regulator.

1 Like