You are on page 1of 13

2011 Application Note: AN100

Load cell breakout user manual

Author: Manoj Reviewer: Ram Revision: 1.1 Tenet Technetronics 6/20/2011

Contents
Introduction
Introduction to Loadcell breakout

Hardware Overview
Loadcell breakout features Schematic

Software Overview
Flow Chart Pseudo code Code

Demo Application References and further reading

Introduction
Loadcell breakout allows an Arduino/Comet board to connect to the loadcell. It is based on the INA125P instrumentation amplifier from Texas instruments. This breakout board is intended to make the interface between the Arduino and an instrumentation amplifier easier thereby allowing various measuring devices like a loadcell to be connected. The breakout also provides an easy way to connect a 16x2 LCD as well as a potentiometer to vary the gain value of the on board amplifier. Note: A loadcell is an energy conversion device. The conversion can be to/from electrical, electro-mechanical, electromagnetic, photonic, photovoltaic, or any other form of energy. Here it is used to convert a force into electrical signal. The mechanical arrangement is done with loadcell on which a load is applied and the force applied is converted electrically and the output signal is amplified by an instrumentation amplifier INA125P (Texas instruments) before it can be used. Loadcells are used in several types of measuring instruments includes electronic weighbridge force measurement, portable weigh scales etc.

Hardware Overview

Figure1: The loadcell breakout shield

Loadcell breakout features


Compatible shield for Arduino/comet. Breakout comes with 16x2 LCD. Uses INA125P instrumentation amplifier. Adjustable gain.

Components overview

Components

Brief Product link specification

References

INA125P Single instrumentation Supply: amplifier 2.7V to 36V Dual Supply: 1.35V to 18V Gain adjustable Resistance: potentiometer 10 kilo ohm

http://tenettech.com/ http://www.datasheetcatalog.org/datasheet product.php?id_prod 2/9/0pap54gi53u7p7a57xjpzfs0tcky.pdf uct=1500

http://tenettech.com/ http://en.wikipedia.org/wiki/Potentiometer product.php?id_prod uct=1498

Reset button

Normal push http://tenettech.com/ http://en.wikipedia.org/wiki/Push-button button product.php?id_prod uct=1499 http://tenettech.com/ http://en.wikipedia.org/wiki/Liquid_crysta product.php?id_prod l_display uct=517

Extended LCD 16x2 LCD berg connectors

Table1: components overview

Schematic
Gain of the INA125 is set by connecting a single external resistor, (RG) between pins 8 & 9. 3,5,13 pins of INA125 & 8th pin of ATMEGA328 Ground. th 1, 2 pins of INA125 & 7 pin of ATMEGA328 Vcc. rd th th 23 pin of ATMEGA328 (analog pin) to 11 and 12 pin of INA125. 4th and 15th pin of INA125 is shorted.

Figure 2: loadcell breakout schematic

Note: the loadcell wire color coding

Figure 3: color code of load cell wire

Software overview
Flowchart

Start

Initialization of LCD, reference load A and B

Read the Analog values and average

Map the outputted floating values from reference loads(A & B)

Print the values

End

Pseudo code
Include header files for LCD Global declaration: For two different loads (in example load A & B). For Analog values for loads and average analog value. For time between readings. Function name : setup Return type : void Description : serial communication initialization. LCD initialization. Function name : loop Return type : void Description : read the Analog values. Running average for smoothening. Call for mapping function. Print the values.

code

// Load cells are linear. So once you have established two data pairs, you can interpolate the rest. // You need two loads of well know weight. In this example A = 0 kg. B =64 kg // Put on load A // read the analog value showing (this is analog val A) // put on load B // read the analog value B #include <LiquidCrystal.h> //we need this library for the LCD commands LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins // Enter your own analog values (without load) here float loadA = 0; // kg int analogvalA = 15; // analog reading taken with load A on the load cell float loadB = 64; // kg int analogvalB = 143; // 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; long time = 0; // int timeBetweenReadings = 1000; // We want a reading every 1000 ms; void setup() { pinMode(13, OUTPUT); digitalWrite(13, HIGH); Serial.begin(9600); lcd.begin(16, 2); // tells Arduino the LCD dimensions lcd.clear(); // clear LCD screen lcd.setCursor(0,0);// set the cursor

void loop() { int analogValue = analogRead(0); // running average We smooth the readings a little bit analogValueAverage = 0.99*analogValueAverage + 0.01*analogValue;

// call the arduino MAP function float load = analogToLoad(analogValueAverage);

if(millis() > time + timeBetweenReadings){ lcd.clear(); lcd.print(Weight = ); lcd.print(load,2); 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; }

Demo Application
This demo shows the Comet interacting with INA125p instrumentation amplifier to measure the load applied on the loadcell

Figure 4: loadcell breakout

Loadcell breakout is mounted on the Comet board and LCD is connected to loadcell breakout through the extended berg connectors

Figure 5: breakout with Comet board

Figure 6: breakout with Comet board and LCD

The loadcell sensor with metal gauge on which the load is applied is connected to the breakout board

Figure 7: loadcell sensor with metal guage

The Arduino code for loadcell is written and uploaded to Comet board

Figure 8: Arduino sketch

The output result displays the weight applied on the load cell

Figure 9: results displayed on LCD

10

References and Further Reading


http://www.datasheetcatalog.org/datasheet2/9/0pap54gi53u7p7a57xjpzfs0tcky.pdf http://tenettech.com/search.php?orderby=position&orderway=desc&search_quer y=loadcell&submit_search=Search\ http://en.wikipedia.org/wiki/Load_cell. www.arduino.cc www.tenettech.com/comet

11

You might also like