Pages: [1]   Go Down
Author Topic: Reading Load Cell Output  (Read 2157 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm just putting together my first arduino device.  I chose to make a load cell data acquisition system where the output is sent to an SD card and LCD screen.  The basic idea is that I want to measure pull on a rope during water skiing sessions which I can later post-process and sync to high-speed video, while I also want to have some immediate feedback while on the water.  Anyhoo, I seem to be having some trouble with the analogue readings for the load cell and I needed some advice tracking down the issue.

First, I'm using a TI ina120p amplifier to boost the signal.  I'm using a 3.3V excitation input and analog reference voltage and the sensitivity of the load cell is 2.997 mV of signal for every V of excitation (this is at full load of 1000 lbf).  So In order to fill out the range of the 10-bit ADC I'm boosting it with a gain of approximately 340.  The gain on the amplifier is set by resistors according the the equation 4+60,000/R.  I only had starter pack resistors lying around so I configured some 100 ohm and 1 kohm resistors in a series and parallel circuit which (after errors) gave me about 178.6 ohms with which to set the amplifier to about 340 gain.

Now I'm reading the output of the ADC and am getting a pretty consistent value of 17 (out of 1023) with zero load applied to the load cell.  The load cells zero balance is 0.18%FS.  This means it should output 0.0018*(2.997e-3 V/V)*(3.3 V) *340=0.0060527412 V with zero load applied.  Given the 3.3V reference range this translates to (0.0060527412 V) / (3.3 V)*1024 = 1.87818394 which is either a value of 1 or 2 depending on how the arduino treats that value.  So it looks like I'm way out of spec.

So I'm trying to track this down.  So far I've gone over every trace and wire in the circuit; everything is where I want it to be and there are no stray solder bridges, etc.  I also don't think I've made any errors in the design given that it's so simple, but I've double checked that as well and nothing really popped out.  I'm thinking that the load cell itself may be out of spec, but I have no way of really testing the zero balance.  I've isolated the load cell, but I can only safely supply up to around 15V excitation.   Though I'm using a 9V battery for simplicity which only gives me an output of about 27 mV at full range.  At 2% zero balance (which is what I think the approximate error to be), this is only 0.5 mV which my multimeter doesn't seem to handle very well (it's a cheapo chinese POS, but it works well enough for things around the house).  I don't really want to get new hardware, but I'm unsure of how I should test this load cell with what I have available.

My only idea is to try measuring current instead by using a 1 or 0.1 ohm resistor.  My multimeter seems to think it has 0.01 mA precision but only 0.1 mV precision.  While it obviously doesn't have 0.1 mV of precision, I'm hoping it might have a little better with current given the extra significant digit and I can further boost it to maybe 10 A/V using Ohm's law and a 0.1 ohm resistor.  Would that approach work or would it be just as likely to be a waste of time?  What else might I try to test the load cell?  I just want to isolate the problem.  Any and all help is greatly appreciated!  :-)
Logged

Offline Offline
Faraday Member
**
Karma: 62
Posts: 3080
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you use a load cell to measure tension in a rope ?  It seems simple enough in concept but I have never actually seen a load cell used to do that.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you really mean INA120P? That chip has been obsolete for a while. If you really are using that chip:

1. Are you supplying it with the +15V and -15V power supplies that it needs?

2. Are you using the A, B or C grade chip? This affects the input offset voltage of the amplifier, which in turn defines the range of output values you may get when the input voltage is zero. To get a reading of 17 with near-zero input voltage, the amplifier input offset voltage would have to be ((17 * 3.3)/1024)/340 = 0.16mV. This is within the tolerance limit (200 + 2000/G uV) for the A-grade version.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dc42,
Sorry for the confusion, I had a typo.  It's actually a texas instruments ina125p chip.  I'm not sure about the grading on the chip, as far as I know there is only one bin.  Though there is a ina125pa model which seems to be lower shelf.

michinyon,
As for the load in a rope, simply put the load cell in line to replace part of the rope.  It can be done different ways as well, but this is probably the simplest and most straightforward.  I'm just interested in the absolute force traveling through the rope itself.  I'm also worried a little bit about shock vibration, but I anticipate being well within the safe loading limit of the load cell.  If there's any noise or resultant vibrations I can always filter the data later.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The input offset voltage of the INA125 is +/- 250uV max for the standard grade, and +/- 500uV max for the A-grade. So your zero-load reading of 160uV is within tolerance. However, if you are running it from a single +5V supply, there is another consideration. The INA125 does not have rail-to-rail output. The datasheet quotes the minimum output voltage as 0.3V worst case, 0.15V typical. You are getting (17 * 3.3)/1024 = 0.05V, so you are actually doing rather well. To do better, you need to provide the INA125P with a negative supply voltage on the V- pin. If you have a spare PWM pin, you can generate this quite easily, like this:

The bottom rail is ground, and Vi is the PWM pin. Put a 100 ohm resistor in series with C1 to limit the peak output current from the pin. You can get about -3V output from this at low currents using ordinary diodes such as 1N4148, or about -4V using Schottky diodes such as BAT85. Set the PWM to 50% using analogWrite(128).
« Last Edit: January 27, 2014, 10:30:38 am by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dc42,

Thank you for the detailed response.  I assumed up until now that amplifiers were magical voltage multipliers with no limitations.  Or at least no limitations that I would encounter.  :-)

Well, live and learn I guess.  I think your assessment of the situation appears to be spot on.  Both the input offset and minimum output voltage (or a combination of both) could very well explain what I'm seeing.  I still can't test the load cell with my current setup, but it's probably less likely that a brand-new load cell is out of calibration.

I don't have any diodes with which to build the circuit you outlined previously.   I'm also afraid I don't quite understand what C[1] is in the diagram.  I'm guessing I wire the ina125p V- pin to the - terminal of V[0] in the diagram?  Sorry, I'm not EE and it's been maybe 10 years since my last required EE class, hehe.

Another option might be a different instrumentation amplifier.  I'm looking through the spec sheets now.  :-)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

dc42,

Maybe I should elaborate on my previous comment.  I've been looking at this more and realized I was a bit sparse.  I understand that C1 and C2 are capacitors, but I don't know how to define what type (capacity, etc.) of capacitor.  Is there a reference I could use online?  I guess in general I just don't know how to make use of the circuit you defined to reduce the minimum voltage on the amplifier.  Sorry for my ignorance.  Also, wouldn't a -3 V just give me a larger effective input voltage?  I'm not quite understanding how that would help lower the output voltage at the zero load state.

I've also been thinking, would a better approach than an amplifier be to use a lower reference voltage with a higher precision ADC?  For example a 24-bit ADC could easily give me all the precision I need.  At least within the spec precision of the load cell itself without any amplification.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For the capacitors C1 and C2, I suggest anywhere between 22uF and 100uF. The negative side of C1 should be connected to the diodes, and the negative side of C2 to the ground rail. Yes, Vo is the negative feed to the V- pin of the INA125. By supplying a negative voltage to the INA125, the minimum output voltage decreases to (that voltage) + 0.15V typical. So it gets rid of the minimum-output-voltage problem.

If you want to use an external ADC then I suggest the ADS1231. It is 24-bits and specifically designed for bridge sensors. It has a built-in EMI filter and an amplifier with a gain of 128. Its input offset error is only 10uV typical. It comes in a SOIC-16 package, so if you want to use it on breadboard etc. you'll need to mount it on a DIP adapter.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I'm going to try and supply the negative voltage first.  It's easier at this point and when doing some reading I found that the high resolution ADCs can be really noisy with weak signals.  So I probably couldn't get the full 24-bit resolution anyway.  ~18-bit true resolution seems to be the consensus online.  If the negative voltage trick doesn't help I'll consider a different IA.  Any suggestions for the IA?  I like that the INA125P is so integrated, but there's got to be a higher precision alternative.  Thanks for all the advice so far!
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use the negative voltage suggestion, then you should also connect a resistor of between about 4K and 10K between the INA125 output and the Arduino anaog input, instead of connecting them directly. This is so that if the amplifier output goes negative, the current into the pin protection diode will be limited to a safe value.

It's possible to use capacitors of much lower value if you increase the PWM frequency on that pin, for example 0.1uF would be enough if you increased the PWM fequency to 31kHz.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have another question.  Is there a reason to use a 100 ohm resistor in series for the voltage doubler?  With a 5V input that's about 50 mA, which could be above the 40mA max spec for the pin.  I was thinking replace it with a 125 ohm resistor or so.

I think it would just decrease the current going into the capacitors and take a bit longer to reach nominal voltage, but I'm unsure if that would have other unintended effects.  With the capacitance range you recommended, I doubt that I would ever notice the increase in time for it to reach operational state, even if I used one of the larger capacitors to ensure stability.  The only potential hiccup I see is if the draw from the V- terminal is greater than 40mA.  However, given the apparent 21k ohm resistance in the amplifier I'm thinking this may be unlikely at 3.3V or even 10V.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The output pin has an internal resistance of about 20 ohms, and the capacitor charges and discharges through the diodes, so there is always at least one diode voltage drop in the circuit too. So using 100 ohms, the peak current (which only occurs briefly when you start the PWM) in amps is about (5 - 0.7)/120.  But you can use a value a little higher than 100 ohms if you like. Too high a resistance will decrease the output voltage under load.

The datasheet for the INA125 says it takes about 300uA from the V- pin.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I finally got the nerve to go back into the hardware and try this fix.  I'd already mocked this up on a prototype board, so I had to move some stuff around (painfully, hehe).  It works!  Here is a comparison of before and after:



So it seems like it fixed the non-linearity down low, though there is still a bit of an offset which will be much easier to correct in software.  That must be the input voltage offset referred to in the spec sheet.  My concern now is that it might exhibit the same non-linearity in the upper range near the maximum output voltage of the i-amp.  I'm driving the ina125p with a 3.3V source (well 3.3V to -3V now) and I'm comparing my output signal against a 3.3V AREF.  The maximum loss of voltage up top should be around -0.8V as stated in the spec sheet.  This translates into 2.5V which would be around a 750lb load given the current gain setting on the i-amp.  750lb is plenty for my purpose, but if it exhibits non-linearity up high like it did down low then it might cause problems.  Unfortunately I have no method of measuring something this heavy, so I'm going to have to wait until the summer to test it.  :-)

Any idea if I would see a non-linear approach of the output voltage to 2.5V (or whatever it is in my sample) or would it be like hitting a brick wall?  Would I be able to test it by increasing the gain and applying a smaller load to the load cell or would this fundamentally change the response of the i-amp?  I'm hoping for the brick wall!  And thanks for all the help so far, this forum has been a life saver.

This project is nearing completion and I plan to post once I finish.  I'm almost done on the software side, but I'm trying to implement a simple on-the-fly peak finding algorithm and starting to knock up against the limits of the atmega328.  Wish me luck!
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at the bottom right hand figure on page 5 of the datasheet at http://www.ti.com/lit/ds/symlink/ina125.pdf. The dashed outline gives the linear operating region with a single +5V supply (as you had originally) and the solid outline gives the linear region with +/-5V supplies (which you almost have now).  The non-linearity you had before was because you were operating outside the bottom left corner of the dashed outline. At high loads, you need to make sure you are within the top right corner, which should be no problem.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Excellent, then if I'm reading that chart correctly even at my 750lb output voltage (assuming a linear scaling from 5V to 3.3V) I should still be within the linear range of the amplifier.

I will have the opportunity to test this soon.  I need to go in and pull out the resistors setting the gain to replace them with something of higher quality with less temperature dependence (RC55LF-D-178R-B-B).  While I'm there I might as well test a 33ohm resistor circuit, that will give me 5x my current gain and allow me to verify the high end output voltage with a much lighter load.
Logged

Pages: [1]   Go Up
Jump to: