Airtripper's 3D Printer and Arduino Blog » Sensors http://airtripper.com 3D Printer usage and modifications plus Arduino powered electronic projects and 3D Printing designs. Fri, 09 May 2014 01:20:57 +0000 en-US hourly 1 http://wordpress.org/?v=3.8.3 Arduino Load Cell Circuit & Sketch for Calibration Testhttp://airtripper.com/1626/arduino-load-cell-circuit-sketch-for-calibration-test/?utm_source=rss&utm_medium=rss&utm_campaign=arduino-load-cell-circuit-sketch-for-calibration-test http://airtripper.com/1626/arduino-load-cell-circuit-sketch-for-calibration-test/#comments Sat, 05 Oct 2013 03:55:08 +0000 http://airtripper.com/?p=1626 Arduino Circuit & Filament Force Sensor

Arduino Circuit & Filament Force Sensor

Here’s the electronics and firmware side of things to support the Airtripper Extruder Filament Force Sensor, which includes the Arduino load cell circuit and the Arduino Sketch. Follow the guides in this edition to obtain the parts, to calibrate the Arduino load cell circuit, and then to calibrate the load cell for accurate weight measuring.

Overview

Continuing with the Airtripper Extruder Filament Force Sensor project, this post will introduce you to the basic INA125 instrumental amplifier circuit that requires no soldering. With only a few parts to assemble, for those who often tinker with the 3d printer hardware and know how to update the printer firmware, this project should be a breeze to complete. Experienced electronic hobbyist would probably get by with just the pictures as a quick start guide, while those attempting electronics for the first time will hopefully be able to appreciate the extra help provided in the text. In regards to the Arduino Sketch or Firmware, the software should work with any Arduino load cell project

Since the Arduino load cell circuit is aimed for 3d printer installation, a 12 volt supply will be used to power the circuit. This means that the Arduino UNO will require a 12 volt supply connected to its power jack; either from the 3d printer power supply or AC / DC adaptor. While Arduino UNO USB cable is used in this project, once the calibration is complete, the USB cable could be replace with a wireless module such as Bluetooth to catch data untethered.

The Arduino sketch, which I called the firmware earlier, has two modes of operation. One mode for calibration and one mode for sending data to another application. So that the post doesn’t get too big, only the calibration mode will be covered here. The other mode will be covered in the next instalment of the force sensor project where the Processing Application will be introduced.

Parts Guide

I recommend getting the Texas Instruments INA125 Instrumental Amplifier from a trusted source like Farnell, Digikey, RS Components or similar; you don’t want the risk of landing a counterfeit; if that’s possible with this chip. I know the INA125 chip is expensive but it does an important job with good features,  and it’s great that we can get this in a DIP package.

The capacitor is what I had to hand and it’s a 220uf 16v, since the circuit is tested with it, the specification will be added to the bill of materials . As long as the capacitor voltage rating is 16v or over then any similar uf value will do. If you are buying electronics for the first, I should get a spare or two when ordering. Also note the polarity of the Capacitor before inserting it in to the breadboard.

The Cermet Trimmer Pot is used to set the gain on the INA125 Instrumental Amplifier and found 100R was just enough to calibrate the amplifier circuit. While the 100R trimmer pot worked on my circuit, I would suggest getting a 200R trimmer pot also. Using a trimmer pot with of a value much greater than 100R for the gain could effect the stability of the analogue readings. When ordering take note of the arrangement of the legs, ideally you want the legs to be in line rather than staggered for inserting into the breadboard.

The hook up wire is 0.6mm single core wire which is cut to length for a neat breadboard layout. You can use either a jump wire kit or a multi coloured wire pack and both can be found on Ebay. The breadboard can also be found on Ebay and the project uses the 400 pin version.

If you’re on a tight budget like me you can pick-up an Arduino UNO clone off Ebay or you can support the Arduino foundation and get a genuine UNO from a trusted supplier. The project should work with any compatible Arduino board should you own a type already.

This project is based around the 5kg load cell and a guide to how you can get one is found here: load cell guide.

Any files required for the project, such as the Arduino load cell circuit firmware sketch, can be found at the end of this post.

The Arduino Load Cell Breadboard Circuit

INA125 Instrumental Amplifier Breadboard Circuit

Arduino Load Cell Circuit With Texas Instruments INA125 Instrumental Amplifier – Updated 23/11/13

The circuit is simple enough to create on a breadboard as shown in the picture above. The most difficult part will be connecting the load cell if a pin connector crimping kit is not available. Wires on loads cells are very fine and some care will need to be taken to strip the ends ready for connection.

To connect the load cell to the breadboard the wires can be extended with 0.6mm solid single core wire; the same as that used to create the breadboard circuit. Very small terminal block cable connectors could be used, as well as uninsulated bootlace ferrules, to join the load cell wires. Folding back the stripped ends of the load cell wires and twisting them round the wires insulator should provided enough thickness for connectors to grip on.

Arduino INA125 Instrumental Amplifier Schematic

Arduino Load Cell INA125 Instrumental Amplifier Schematic – Updated 23/11/13

The INA125 Instrumental Amplifier is powered from the 12v supply, the load cell supply is powered by the INA125s’ built-in 5v regulator. AREF voltage will also be 5v and the analogue voltage range is from Ground to 5V. Other voltage configurations are possible with the INA125 and you may want to refer to the Data Sheet; link at the end of the post.

The bill of materials below are what I’ve used for my Arduino load cell circuit and I’ve been satisfied with its operation so far.

  1. Texas Instruments INA125P Instrumental Amplifier
  2. 100r Wr3296w 10% 3/8 Cermet Trimmer Pot (TSR-3296W-101R)
  3. Jamicon 220uf 16v Capacitor
  4. 0.6mm Solid Single Core Wire of different colours
  5. 400 Point Contact Breadboard
  6. Arduino UNO
  7. 5kg Load Cell – Load Cell Guide
  8. USB Cable for Arduino
  9. 12v AC/DC Mains Adaptor
  10. Arduino IDE

Once the circuit is complete, get the Arduino sketch file from the link at the end of the post. Uploaded the sketch to the Arduino UNO and test the Arduino load cell circuit. Using the Arduino IDE Serial Monitor and using a hacked scale to test the load cell, put some weight on the load cell and note what happens to the analogue reads.

If the analogue readings go up when weight is added to the load cell, then all is fine and move on to the next step.  If the analogue readings don’t appear to change or going down instead of up, then the load cell may be installed upside down or the blue/green and white load cell wires need to be swapped round.

INA125 Instrumental Amplifier Circuit Calibration

Arduino Load Cell INA125 Instrumental Amplifier Gain Set-up

Arduino Load Cell INA125 Instrumental Amplifier Gain Set-up

Rather than mess about with formulas detailed in the INA125 Amplifier data sheet, I went with my own method of calibrating the Arduino load cell circuit. This involve using a trimmer pot to adjust the gain on the INA125 chip to get the voltage range we want for our Arduino analogue pin to read.

Making changes after calibration, like changing wire lengths, altering the circuit and changing the power supply, could upset the gain On the INA125 and cause all other calibrations to be out.

The load cell I’m using is rated for a 5kg load and I want to adjust the gain on the INA125 so that 5v equals 5kg. So basically, I put 5kg on the hacked scale containing the load cell and noted the analogue readings taken from the Arduino load cell circuit using the Arduino IDE Serial Monitor. If the load cell is going to be preloaded with 400 grammes of weight in its intended application, you may want to add this weight to the weight being calibrated. Otherwise you will loose 400 grammes off the target weight range.

The Arduino 10bit A/D converter will give a maximum reading of 1023 and we want to adjust the trimmer pot on the Arduino load cell circuit until 1022/1023 is reached. Ignore the scale load reading at this point as it is yet to be calibrated. Once the gain is set, we can proceed to the next step to calibrate the weight scale of the load cell.

The Filament Force Sensor Firmware

For the Arduino load cell circuit to work it needs firmware in the form of an Arduino IDE sketch. The portion of code below is copied from the sketch which contains variables you need to know to set up the firmware successfully. While the code is well commented, some variables will be covered in more detail in this section and the next section.

// Set the software mode and set the analog pin
int calibrate = 1; // 0 = Output to Processing Application, 1 = Calibration mode
int analogPin = 0;  // Arduino analog pin to read

// LOAD CELL CALIBRATION
// Low end of the test load values
static long loadLow = 0; // measured low end load in grammes from good scales
static int analogLow = 80; // analog reading from load cell for low end test load

// High end of the test load values
static long loadHigh = 5103; // measured high end load in grammes from good scales
static int analogHigh = 1008; // analog reading from load cell for high end test load

// This is used when you change the load cell platform to something else that weighs
// different and the load is no longer on zero. Add an offset to set to zero.
int loadAdjustment = 0;  // Adjust non loaded load cell to 0

The firmware operates in a mode chosen by the user by setting the calibrate variable to either 0 or 1. Changing modes changes what data is output to the serial interface and what speed the serial interface operates at. Setting the firmware to calibration mode sets the serial baudrate to 9600 and outputs more information to the Arduino IDE serial monitor at 1 second intervals. This mode is ideal for calibrating the Arduino load cell circuit.

Setting calibrate to 0 will set the serial baudrate to 115200 and output just the weight in grammes 100 times a second. Changing the variable plotDelay, not shown in the code snippet, will alter how many times a second data is sent over serial.

The Arduino analogue PIN A0 is used by default and this can be change by assigning a new PIN number to the analogPin variable. Analogue PINs 0 to 5 are available on the Arduino UNO.

Arduino Load Cell Weight Scale Calibration

Calibrating the load cell scale will allow the Arduino code to map grammes to the analogue range that the Arduino load cell circuit can achieve. The calibration, for this application, will achieve a measuring range from zero to 5kg and Zero will be the load cell resting point with no load on the calibration platform. Images are provided as a quick reference to the calibration procedure.

Load Cell Low End Weight Scale Calibration Part One

Load Cell Low End Weight Scale Calibration

With the Arduino IDE serial monitor running, note the analogue readings being received from the Arduino load cell circuit. Test the load cell by adding weight to the platform to confirm that the circuit is functioning properly and a good range of readings is possible; you should be getting an analogue range from around 60 to 1022. If the tests look ok then proceed with the calibration, else check the circuit and try the INA125 Instrumental Amplifier gain calibration again.

The first step is to test the low end of the weight scale and you can do this without adding load to the load cell. So the variable loadLow in Arduino sketch code can be assigned 0 as for zero grammes. Then copy the smoothed analogue value to the analogLow variable and move on to the next step.

Load Cell High End Weight Scale Calibration

Load Cell High End Weight Scale Calibration

For calibrating the high end of the weight scale some load needs to be put on the load cell scale. The amount of weight to put on the load cell scale should be the amount close to the maximum weight the load cell is rated for. The load being used for calibration should not be so heavy that the analogue readings become stuck at 1023. Adjust the weight so that the analogue readings are a little below 1023.

Measure the weight of a test load as accurately as possible on a good scale, assign the measured weight to the variable loadHigh. Put the test load just weighed on to the load cell platform and copy the analogue reading to the analogHigh variable. Save the Arduino sketch and upload to the Arduino.

The load cell scale should now be calibrated and you can now run weight tests using the Arduino IDE serial monitor for the weight readings.

Arduino Load Cell Circuit Transplant

Arduino Load Cell Circuit Transplant

Once the load cell is calibrated it can be transplanted to its intended application. It should be noted that any change in the load cell wire lengths or a change of power supply could effect the gain on the INA125 Instrumental Amplifier  and spoil the calibrations.

Setting up the Arduino load cell circuit in another application could change the load cell pre-load weight where zero weight will no longer be set properly. By running the Arduino serial monitor connected to the load cell circuit, you can reset the scale to zero by copying the Scale load (grammes)  measure to the variable loadAdjustment.

What Now

The Airtripper Extruder Filament Force Sensor graphing is now done in the Processing Development Environment. This allows me and other users  to extend the code and add custom features.

A guide for the Processing Application is being worked on and should be published shortly

The Files

The Arduino load cell Circuit firmware sketch file : https://github.com/Airtripper/load-cell-test

Related Articles

3D Printer Extruder Filament Drive Gear Review & Benchmark

Electronic Kitchen Scales Teardown Versus Load Cells

Airtripper Extruder Filament Force Sensor – Introduction

[bodyadsrich1l]

I hope you found the Arduino Load Cell Circuit & Sketch for Calibration interesting and helpful.

]]>
http://airtripper.com/1626/arduino-load-cell-circuit-sketch-for-calibration-test/feed/ 16
Electronic Kitchen Scales Teardown Versus Load Cellshttp://airtripper.com/1397/electronic-kitchen-scales-teardown-versus-load-cells/?utm_source=rss&utm_medium=rss&utm_campaign=electronic-kitchen-scales-teardown-versus-load-cells http://airtripper.com/1397/electronic-kitchen-scales-teardown-versus-load-cells/#comments Thu, 27 Jun 2013 22:53:57 +0000 http://airtripper.com/?p=1397 Kitchen Scales Load Cell Ready For Calibration

Load Cell Ready For Calibration

To support the Airtripper Extuder Filament Force Sensor and other projects involving load cells, this article will cover some ideas in acquiring load cells and getting them ready for calibration. The article will cover the pros and cons of buying a bare load cell or buying electronic digital scales for the load cell inside. To finish off the article there are three electronic kitchen scale teardowns to reveal the load cells inside, and you will see how the scale enclosure & platform can be re-assembled for calibration purposes.  A separate article will follow to cover load cell calibration.

You might think the best way to get a load cell unit is to buy it from Ebay. The obvious reason for this is that you know the dimensions of the load cell in advance and the price is, in most cases, cheaper than buying electronic digital kitchen scales for the load cell inside. However, buying the scales for the load cell inside has advantages because you get a ready made weighing platform for calibration and you’re able to test the load cell in advance with the scales manufacturer electronics.

If using load cells for the first time, it is important to note that you might not get the same resolution, accuracy or stability that you get with electronic digital scales. Microcontrollers such as the Arduinos are limited to a 10bit analog to digital converter and the higher the load cell rating the less resolution per 1kg you will get. The microcontrollers can’t read from the load cells directly so an instrumental amplifier is required.  There will be more about this in the calibration article to follow.

Bare Load Cells Or Electronic Kitchen Scales

DIY Load Cell Weighing Platform & Stand

DIY Load Cell Weighing Platform & Stand

Unfortunately, just buying a bare load cell could make it difficult to calibrate without a suitable weighing platform and stand. Buying electronic scales for the load cell inside could provide a suitable weighing platform & stand for the load cell calibration. A weighing platform & stand could be custom designed and printed on a 3d printer or, with a few DIY tools, a platform could be made out of wood. However, depending on the type of load cell & application, the platform design will have to be strong enough to support the maximum calibration weight being tested. A calibration test load can be as much as 5kg or more and the weighing platform needs to be strong enough to support it.

Buying a bare Load Cell

5kg Load Cells Bought from Ebay

5kg Load Cell Bought from Ebay

Bare load cells can be purchased from Ebay in a variety of load ratings and are usually described with full specifications. In order to make use of the load cells you may require a suitable weighing platform and stand for calibration depending on the application.

PROS

  • You know the load cell dimensions in advance.
  • The load cell can be cheaper than buying electronic kitchen scales.
  • You can plan your designs with known dimensions while waiting for the delivery of the load cell. Also, other supporting fixtures can be ordered.
  • A custom made calibration weighing platform can be adapted to fit different sizes of load cells.

CONS

  • The weighing platform and stand will have to be custom made for calibration purposes.
  • A custom made weighing platform and stand could add to the cost of the load cell.
  • Ordering the load cell on its own means the rated load range can’t be tested in advance. Buying electronic scales will allow you to test the load cell inside in advance of removal.

Buying Electronic Scales For The Load Cell Inside

Electronic Kitchen Scales With Weighing Platform Removed From Load Cell

Electronic kitchen Scale With Weighing Platform Removed From Load Cell

There are plenty of kitchen scales to choose from on Ebay but you may also get them at a good price from your local discount store. Using the discount store will give you a chance to inspect the scales before purchase to determine the approximate dimensions of the load cell inside, and returning the scales would be much easier after purchase.

PROS

  • Digital kitchen scales could be bought cheaply from car boot sales or discount stores, or Ebay even.
  • The Scales can be tested quickly after purchase or delivery.
  • You have a ready made weighing platform and stand for calibration purpose.
  • The kitchen scales can be used to test the weighing range of the load cell inside before adding custom electronics.
  • The load cell wire assignments can easily be identified from the circuit board labels.

CONS

  • The build quality of the cheapest electronic scales might not be strong enough to weigh loads up to the maximum load rating.
  • The dimensions of the load cell inside the kitchen scales is unknown until after purchase and the enclosure is opened.
  • You may find the load cell dimensions are not suitable for the application intended after opening the electronic kitchen scales enclosure.
  • Buying electronic kitchen scales could cost more than buying just the load cell unit itself.

Digital Kitchen Scales Teardown For Load Cells

WH-B05 Electronic Digital Kitchen Scales

The WH-B05 electronic scale was purchased from Ebay and was available from more than one Supplier. It’s a very compact unit measuring approximately 16.3 x 12.8 x 3.5cm and has a 5kg load capacity. The build quality is good with a strong sturdy weighing platform and the scales can be had for less than a bare load cell unit.

The load cell inside is a very compact 5kg version and the smallest I’ve seen for the load rating. The scales base and weighing platform can be saved for calibrating the load cell with test weights of up to 5kg. For the smaller weight sensing projects these scale could be ideal.

WH-B05 Electronic Digital Scales Teardown

5kg Load Cell From WH-B05 Electronic Digital Scales

5kg Load Cell From WH-B05 Electronic Digital Scales

SF-400 Electronic Digital Kitchen Scales

This is another purchase from Ebay and this one has a load capacity of up to 10kg, the unit measures 24 x 17 x 3.5cm. I found the build quality to be too low for the 10kg load rating and there was some buckling in the weighing platform when tested with a 5kg load.

Getting a better quality scale of the same rating as the SF-400 will be a lot more expensive unless you can pick one up second hand. If you can make your own custom weighing platform & stand then buying a bare 10kg load cell could be a better option instead.

SF-400 Electronic Digital Kitchen Scales Teardown

10kg Load Cell From SF-400

10kg Load Cell From SF-400 Electronic Digital Scales

KENWOOD DS800 Electronic Digital Kitchen Scales

The KENWOOD DS800 is a high quality digital kitchen scale with a more sophisticated and cleaner looking load cell inside. The glass weighing platform and the metal chassis ensures, when weighing, the maximum rated weight is kept steady and stable. These scales are now discontinued but found that they are sold under a new label; James Martin by Wahl ZX774 Digital Scales.

The load cell in these scales was used for the airtripper extruder filament force sensor prototype. The electronic scale is a bit expensive to buy just for the load cell inside but if you see one of these used going cheap, snap it up. The platform and chassis can easily be used to calibrate other load cells; like the bare ones sold on Ebay.

KENWOOD DS800 Electronic Digital Kitchen Scales Teardown

5kg Load Cell From KENWOOD DS800 Electronic Digital Scales

5kg Load Cell From KENWOOD DS800 Electronic Digital Scales

On closing

Load cells are one of my favourite sensors and I’ll be using them in a few projects I’ve got lined up. All the load cells in this article have been calibrated and tested successfully using an Arduino and an instrumental amplifier. I’m currently testing different load cells in preparation for the load cell calibration guide write-up. The OpenScad files for the Airtripper extruder filament force sensor will be edited to allow user configuration to fit variant load cell sizes.

Hope you enjoyed the Electronic Kitchen Scales Teardown Versus Load Cells.

[bodyadsrich1l]

]]>
http://airtripper.com/1397/electronic-kitchen-scales-teardown-versus-load-cells/feed/ 9