Load Cell and AD620 as amplifier .

I want to make a simple weighting system using arduino (5Kg Max).

I am using this kitchen scale (http://goo.gl/edFeIM) and AD620(http://goo.gl/lwvdt7) as load cell amplifier.

After connecting all the wires , my arduino analog port gives 134 as value . It just fluctuates between 133-134.

Here is the connection ,

AD620 port 1 & 8 connected using 100ohms .

AD620 2 and 3 is connected to load cell green(signal -) and white(signal +) wires .

Ad620 5 and 4 is grounded.

AD620 6 is connected to arduino analog 0.

Here is diagram of ckt


Here is a demo of the connection

Here is the code i am using

// Arduino as load cell amplifier
// by Christian Liljedahl
// christian.liljedahl.dk

// Load cells are linear. So once you have established two data pairs, you can interpolate the rest.

// Step 1: Upload this sketch to your arduino board

// You need two loads of well know weight. In this example A = 10 kg. B = 30 kg
// Put on load A
// read the analog value showing (this is analogvalA)
// put on load B
// read the analog value B

// Enter you own analog values here
float loadA = 0.125; // kg
int analogvalA = 200; // analog reading taken with load A on the load cell

float loadB = 0.218; // kg
int analogvalB = 600; // analog reading taken with load B on the load cell

// Upload the sketch again, and confirm, that the kilo-reading from the serial output now is correct, using your known loads

float analogValueAverage = 0;

// How often do we do readings?
long time = 0; //
int timeBetweenReadings = 200; // We want a reading every 200 ms;

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

void loop() {
  int analogValue = analogRead(0);

  // running average - We smooth the readings a little bit
  analogValueAverage = 0.99*analogValueAverage + 0.01*analogValue;

  // Is it time to print?
  if(millis() > time + timeBetweenReadings){
    float load = analogToLoad(analogValueAverage);

    Serial.print("analogValue: ");Serial.println(analogValueAverage);
    Serial.print("             load: ");Serial.println(load,5);
    time = millis();
  }
}

float analogToLoad(float analogval){

  // using a custom map-function, because the standard arduino map function only uses int
  float load = mapfloat(analogval, analogvalA, analogvalB, loadA, loadB);
  return load;
}

float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

Here are necessary images

. Thanks in advance.

1 Like

Hi,
Check how many wires should be coming off pin2 of the IC.
I see one in your picture, but the overlay diagram shows a connection from pin2 to positive rail.
What is pin7 supposed to be connected to?
Which is the correct connections, pin 7 is a supply pin.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Draw the circuit you have in the picture on protoboard.
Then post it for us.
Do you have a DMM to help check voltages around your circuit?.

Where did you get the circuit from, the IC is designed for +5 and -5 supply but the datasheet does show a single 5V circuit.

Tom... :slight_smile:

I see a 3-wire load cell.
AFAIK two more resistors are needed to complete the wien bridge.
Leo..

TomGeorge:
Hi,
Check how many wires should be coming off pin2 of the IC.
I see one in your picture, but the overlay diagram shows a connection from pin2 to positive rail.
What is pin7 supposed to be connected to?
Which is the correct connections, pin 7 is a supply pin.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Draw the circuit you have in the picture on protoboard.
Then post it for us.
Do you have a DMM to help check voltages around your circuit?.

Where did you get the circuit from, the IC is designed for +5 and -5 supply but the datasheet does show a single 5V circuit.

Tom... :slight_smile:

From pin 2, 1 wire to load cell signal - . Pin 7 is to Arduino 5V .
Here is diagram of my ckt.

Wawa:
I see a 3-wire load cell.
AFAIK two more resistors are needed to complete the wien bridge.
Leo..

its a 4 wire load cell. Can u tell me how i need to connect the resistors and of which value ?

TomGeorge:
Hi,
Check how many wires should be coming off pin2 of the IC.
I see one in your picture, but the overlay diagram shows a connection from pin2 to positive rail.
What is pin7 supposed to be connected to?
Which is the correct connections, pin 7 is a supply pin.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Draw the circuit you have in the picture on protoboard.
Then post it for us.
Do you have a DMM to help check voltages around your circuit?.

Where did you get the circuit from, the IC is designed for +5 and -5 supply but the datasheet does show a single 5V circuit.

Tom... :slight_smile:

It took me a minute to work out too, Tom. On the breadboard, the red wire from pin7 passes underneath the IC and continues to the +ve rail, and the green wire only connects to pin2.

@rdbhaxor, since it's a 4-wire load cell, you probably don't need additional resistors. (See attached diagram, "4 wire load cell")
I might be wrong, but I think it's already a full-bridge.
I'm not too familiar with load cell circuits, but should the op-amp's ref pin be connected to gnd, or to half the supply voltage? Can you post a link to the source of the circuit you copied?
(I just found a circuit, (also attached, "ADC620 Load Cell Circuit"), that indicates that the ref pin should be connected to half the supply voltage and not to ground.)

@Wawa, I think you meant "Wheatstone" bridge in stead of "Wien" bridge.

AD620 Load Cell Circuit.gif

4-wire load cell.jpg

OldSteve:
I'm not too familiar with load cell circuits, but should the op-amp's ref pin be connected to gnd, or to half the supply voltage?

Mid-voltage if you want to measure force going both directions.
Ground for one-way force, e.g. scales.
Mind the polarity of the Wheatstone :slight_smile: bridge.
If it's wrong, weight will want to go negative.

Output of the AD620 on a single 5volt supply will only swing 2.5-3volt, so only ~500 digital values.
5kg will have 10gram granularity if you have a perfectly stable 5volt rail.
Leo..

OldSteve:
It took me a minute to work out too, Tom. On the breadboard, the red wire from pin7 passes underneath the IC and continues to the +ve rail, and the green wire only connects to pin2.

@rdbhaxor, since it's a 4-wire load cell, you probably don't need additional resistors. (See attached diagram, "4 wire load cell")
I might be wrong, but I think it's already a full-bridge.
I'm not too familiar with load cell circuits, but should the op-amp's ref pin be connected to gnd, or to half the supply voltage? Can you post a link to the source of the circuit you copied?
(I just found a circuit, (also attached, "ADC620 Load Cell Circuit"), that indicates that the ref pin should be connected to half the supply voltage and not to ground.)

@Wawa, I think you meant "Wheatstone" bridge in stead of "Wien" bridge.

I am new to load cell as well. How should i connect the ref ping to half supply volt ? i am just using arduino as source. Should connect it to arduino 3.3 v ?

Wawa:
Mid-voltage if you want to measure force going both directions.
Ground for one-way force, e.g. scales.
Mind the polarity of the Wheatstone :slight_smile: bridge.
If it's wrong, weight will want to go negative.

Output of the AD620 on a single 5volt supply will only swing 2.5-3volt, so only ~500 digital values.
5kg will have 10gram granularity if you have a perfectly stable 5volt rail.
Leo..

Ty for the info. Can u tell me if i have any problem on the ckt ?

After setting the ref ping to 3.3V and the resistance between pin 1& 8 to 100Ohm i am getting good change in analog values.

For no load i am getting 670-671 as analog value
For 218gm i am getting 693-695 as analog value
For 125g i am getting 684-685 as analog value.

Now how to calculate weight from it ?

HX711 breakout boards are commonly used for load cells.
The boards I know have a 4.3volt Vref, derived from the 5volt rail, to supply the load cell.
And an onboard 24bit A/D converter.
Leo..

rdbhaxor:
After setting the ref ping to 3.3V and the resistance between pin 1& 8 to 100Ohm i am getting good change in analog values.

For no load i am getting 670-671 as analog value
For 218gm i am getting 693-695 as analog value
For 125g i am getting 684-685 as analog value.

Now how to calculate weight from it ?

That's not enough span.
You will have bad resolution.
You should aim for ~250 to ~750.

Subtracting the "zero" reading, and multiplying the remainder, gets the weight you want.
Leo..

Wawa:
That's not enough span.
You will have bad resolution.
You should aim for ~250 to ~750.

Subtracting the "zero" reading, and multiplying the remainder, gets the weight you want.
Leo..

First of all thankyou for the help .

My No load Analog value is 671

So i am using this to determine load -

Load = ((x-671)0.204844.7011)

And its working fine But there is error about 5-6 gms . The more load i add the less the error.

I determined the factor 44.7011 from using accurate weights and comparing it with the mv from analog reading.

I sometimes bend the load cell (carefully) untill the "zero" reading is the lowest A/D possible.
Because the datasheet states that the output of the A/D is ~1.1volt minimum, min value will be ~225.
Maybe aim for 250.

Then use a gain resistor so the maximum weight (5kg) is an A/D value of about 750.
Because the datasheet states 3.8volt max (A/D = 778).

Maybe you can mod this sketch I wrote for a pressure sensor.
Leo..

int rawValue; // A/D readings
int offset = 102; // ~0.5volt zero pressure adjust
int fullScale = 920; // ~4.5volt max pressure (span) adjust
float pressure; // final pressure in psi

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

void loop() {
  rawValue = analogRead(A0);
  pressure = (rawValue - offset) * 150 / (fullScale - offset); // pressure conversion
  Serial.print("The pressure is  ");
  Serial.print(pressure, 1); // one decimal place
  Serial.println("  psi");
  delay(500);
}

Wawa:
Mid-voltage if you want to measure force going both directions.
Ground for one-way force, e.g. scales.
Mind the polarity of the Wheatstone :slight_smile: bridge.
If it's wrong, weight will want to go negative.

Output of the AD620 on a single 5volt supply will only swing 2.5-3volt, so only ~500 digital values.
5kg will have 10gram granularity if you have a perfectly stable 5volt rail.
Leo..

Right, it sounds like you know the subject better than I do. I bought some (1/2 bridge) load cells last week, but haven't got around to playing with them yet. I know I'll use two wired together to complete the bridge, but that's as far as I've got.

You can also use a single load cell on one input of the IC.
And two equal value resistors for the other input.
That also completes a Wheatstone bridge (with half the sensitivity).

If you use two single load cells, make sure one goes up in voltage, and the other one goes down (with weight).
So mount on opposite sides OR swap positive and negative wires of ONE cell.
Leo..

Wawa:
You can also use a single load cell on one input of the IC.
And two equal value resistors for the other input.
That also completes a Wheatstone bridge (with half the sensitivity).

If you use two single load cells, make sure one goes up in voltage, and the other one goes down (with weight).
So mount on opposite sides OR swap positive and negative wires of ONE cell.
Leo..

Thanks for the tip. I have a schematic here somewhere, but haven't had a chance to look closely yet.
(I've been busy playing with my little robot car. :D)

Wawa:
I sometimes bend the load cell (carefully) untill the "zero" reading is the lowest A/D possible.
Because the datasheet states that the output of the A/D is ~1.1volt minimum, min value will be ~225.
Maybe aim for 250.

Then use a gain resistor so the maximum weight (5kg) is an A/D value of about 750.
Because the datasheet states 3.8volt max (A/D = 778).

Maybe you can mod this sketch I wrote for a pressure sensor.
Leo..

int rawValue; // A/D readings

int offset = 102; // ~0.5volt zero pressure adjust
int fullScale = 920; // ~4.5volt max pressure (span) adjust
float pressure; // final pressure in psi

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

void loop() {
  rawValue = analogRead(A0);
  pressure = (rawValue - offset) * 150 / (fullScale - offset); // pressure conversion
  Serial.print("The pressure is  ");
  Serial.print(pressure, 1); // one decimal place
  Serial.println("  psi");
  delay(500);
}

I will look into it.