Measure load

Hello everyone,

Can I find load using a load cell in ARDUINO MEGA 2560, but I don't have a load cell amplifier.

How can I find load then?

Are you using this kind of load cell:loadCell.png in your project?

If not, post a link to the sensing element or bridge that you are using.

loadCell.png

idkarduinoo:
Can I find load using a load cell in ARDUINO MEGA 2560, but I don't have a load cell amplifier.

There is no load cell in an Arduino Mega and I suspect you know that so your question does not make sense.

The Arduino Mega does contain an amplifier for its ADC though there is no standard Arduino function to use it so you will need to study the Atmega 2560 datasheet.

...R

GolamMostafa:
Are you using this kind of load cell:loadCell.png in your project?

If not, post a link to the sensing element or bridge that you are using.

YES!!

You need one of these:

HX711 Load Cell Amplifier

The red boards tend to work better than the green ones, due to better shielding....

Regards,
Ray L.

idkarduinoo:
YES!!

Then follow this tutorial:
1. Mount/fasten the load-cell on the bench as per Fig-1.
loadcellPic.png
Figure-1:

2. Collect HX711 Load-cell amplifier (Fig-2).
hx711only.png
Figure-2:

3. Connect Load-cell, Amplifier and MEAG as per Fig-3. Take off the word UNO and place MEGA instead. You may connect the shielding wire of load-cell with GND-pin of amplifier/MEGA
loadcellCalib.png
Figure-3:

Once. you have finished all the above tasks, then ask for next step (Step-4).

loadcellPic.png

hx711only.png

loadcellHx711.png

GolamMostafa:
Then follow this tutorial:
1. Mount/fasten the load-cell on the bench as per Fig-1.
loadcellPic.png
Figure-1:

2. Collect HX711 Load-cell amplifier (Fig-2).
hx711only.png
Figure-2:

3. Connect Load-cell, Amplifier and MEAG as per Fig-3. Take off the word UNO and place MEGA instead. You may connect the shielding wire of load-cell with GND-pin of amplifier/MEGA
loadcellCalib.png
Figure-3:

Once. you have finished all the above tasks, then ask for next step (Step-4).

I don't have amplifier, so I have ordered it. Please tell me the next step

idkarduinoo:
I don't have amplifier, so I have ordered it. Please tell me the next step

You can't do/go the next step until you have made the setup. The next step is to check/calibrate the response of the Input Device (load-cell, amplifier) and measure the unknown weight.
1. Upload the following sketch.

/* This program takes 10 samples from LC + HX711B at
   2-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, HEX);
      y = x;
      x = 0;
      delay(2000);
    }
    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);
  //float W = (float)0.90*(sum-901002)/946560 + 0.75;//0.005331 * sum - 1146.176;
  //W = (float)W / 1000.00; 
  //Serial.println(W, 2);
  delay(1000);
}

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

2. Place 1 kg weight on the load cell. Record the counts from the Serial Monitor as C1.

3. Place 2 kg weight on the load cell. Record the counts from the Serial Monitor as C2.

4. Now, you have these response points:
A(1, C1) //known point
B(2, C2) //known point
C(W, C) //unknown point to be known from the above two

Now, find equation for the unknown weight (W) in terms of C.

5. Now, insert the equation of Step-3 at the appropriate place of the sketch of Step-1 and show the weight in the form of: xx.xxx on the Serial Monitor Monitor.

6. Place, 1.500 kg weight on the load-cell and record the weight. Check that the error is within the specification of the load-cell as specified by the manufacturer.

7. Now, you can play around using HX711.h Library instead of Sketches of Step-1 and Step-4.

HX711-master.zip (17.4 KB)