Load Cell Scale

I got an AD7730 IC (load cell analog to digital converter) and connected to an Arduino microcontroller and a load cell. The AD7730 chip is only on a
solderless breadboard right now, but I'm getting pretty good results. The load cell I'm using is rated for 30Kg's and I'm able to read 1/10th of a gram with some noise & drift. So far my microcontroller code just configures the AD7730 chip, reads raw values and converts them to units by responding to computer keys for zero and calibration.
I'm wanting to get this thing all together in a handheld enclosure with rechargeable batteries, a LCD display and buttons to allow setup, configuration, and calibration. A connector will allow me to change load cells so I can use this with a reloading scale or a 10 ton crane scale, with all the configuration and calibration saved for each load cell I want to use it for, saving data for a dozen load cells shouldn't be a problem.
Just thought I'd share this in case anyone wants to mess with Arduino scales and the AD7730 chip, I can paste my Arduino code that will help get you started. I couldn't find any functional code with my searches so I started with a program that wasn't working and got it going with major modifications.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

That would be interesting. I use DATAQ software on my laptop for that, but then, I wouldn't want to build my laptop into a permanent enclosure!
I use load cells for all sorts of stuff in small automation, and for measuring thrust of small rocket motors.
I use a load cell amplifier of my own design built around an INA-125 amplifier.
LLoyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
"Lloyd E. Sponenburgh" wrote in message

A nice part about the DIY project is that I can program it for automatic weighing or about anything else I want. Coarse feeds, fine feeds, pre-act to shut off dosing before set point is reached, auto adjust pre-act if it weighs too heavy or too light, and so on. Or as simple as go / no-go.
I have a couple of INA-125 amps in my Digi-Key cart right now. The AD7730 is kind of neat, the amp, filters, calibration, offset, are built into the chip but I think I would like to just get the raw data into the microcontroller and process the data in the microcontroller. One of the nice things about the AD7730 chip is that I can digitally adjust it for unipolar or bipolar ranges of 10mV, 20mV, 40,mV or 80mV, zero offsets, filter settings, etc. That would be handy if I save configurations and calibrations for different load cells in the eeprom. That way I could select the load cell I wanted to work with and it would configure the chip and load the last saved calibration data.
The Arduino has build in 10-bit A/D converters, with the INA-125 I plan to try to see what kind of weightings I can get out of them by taking multiple readings. I have heard you can add 16 readings, divide by 4 and get 12 bit A/D results. Anyway it's kind of fun to play with, last time I looked Radio Shack had some of the Arduino's for around $30 or so, they seem a huge leap ahead of the Basic Stamps I was playing with.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Roger, Contact me off-list.
Lloyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
"Lloyd E. Sponenburgh" wrote in message
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Just take away the numeric junk from the lloydsp and stick an @ before the mindspring thing.
LLoyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

You would have to look very carefully at the A/D converter's specs and probably test yours to see if statistical averaging would improve its resolution; I suspect it's barely good enough for 10 bits, in sleep mode with good reference bypassing and attention to ground current paths.
The simple check is to apply a ramped input from a higher resolution DAC and record the bit transition voltages, then see if the A/D output consistently changes at a constant fraction of one bit resolution. You can check manually with a 4-1/2 digit DVM and a 10-turn pot. Look closely at the major bit transitions at 1/2 (1/4, 1/8) of full scale, where the DAC resistor ladder changes from 0111111111 to 1000000000. http://www.atmel.com/Images/doc2549.pdf
They only claim +/- 2 bit accuracy, see section 26. Fig 26-13 and 26-14 show the potentially variable step size of the internal DAC. Averaging reduces random noise but won't correct gain, offset and nonlinearity errors.
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

There are a few decent and inexpensive stand-alone A/D converters that tout +- 1/2 bit at 10 bits.
LLoyd
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
"Jim Wilkins" wrote in message wrote in message

Sounds like good ideas for checking out A/D. I'm not very hopeful on getting good resolution from the onboard 10-bit A/D converter, beside the INA125 instrumentation amps in my Digi-Key shopping cart, I have some 24 bit A/D converters for around $3 each. If all works out I'll have high resolution converters for load cells, strain gages, pressure transmitters, or whatever else. I'm wanting the amp to have adjustable gain and offset pots so I can adjust for whatever I want to use it for at that moment.
Another idea I have is to write the program to calibrate at various weights and interpolate between the calibration points. For example if I calibrate at 10, 20, 30, and 40 lbs, I can use the calibration from zero to 10, 10 to 20... for the weights in that range, hopefully correcting for some non-linearity issues. I don't expect to use 1kg load cells for 0.1 grain reloading weightings but I would like to see how well a 100g load cell does with my reloading scale calibration weights. My idea for automatic powder measurement would be to set a powder measure to dispense maybe 95% of the charge and use a motorized trickle feeder for the exact weight.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
RogerN wrote:

The AD7730 is an amazing chip. I used them for a downhole tool years ago, to measure temperature and pressure. A little pricy but worth all of it if you're just doing a few devices.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
"Jim Stewart" wrote in message

As I get more familiar with this chip I hope I can get it to work well for me. It seems to work pretty good now but I'm using internal calibrations for zero and full scale when I power the chip up, this doesn't seem to give the same readings twice so I have to recalibrate my scale every time I use it. I'm planning to try it with power up defaults and see if it works without running through the calibration routines every time it's reset. My future plan is to use an LCD display and some buttons so the AD7730 can be configured using a menu and the buttons. The chip does keep the parts down, I have the AD7730, a few capacitors, and the clock crystal on the breadboard.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
RogerN wrote:

We always did a recalibrate after a reset. Never found a way around it. Another gotcha is changing channels. Be aware that after changing channels, you have to do several (the number escapes me now) conversions to flush the delta-sigma pipeline before you get an accurate reading on the new channel.
Keep us updated on your progress.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Friday, March 16, 2012 12:30:19 AM UTC, RogerN wrote:

to

e

y

ith

use

les

ed

Hi Roger,
Realise this is an old post now, but if you have any code to hand would be much appreciated.
I have simple weigh scale setup going, and didn't have enough resolution wi th other chips. Working with the AD7730 now, and despite having finally got SPI working it seems to be really finicky. I often seem to end up in a loo p of 1 to 4 bytes repeatedly sent back for whatever register I'm trying to read from... And it only seem correctly write to registers on startup about 70% of the time. The others it just returns spurious bytes.
Anything you've learned might be helpful
Thanks
David
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote in message

I never got real good results but by continually trying after failure it worked good enough but with slow updates. I have a few different versions of the code I was working on, not sure of the version that worked the best but I can send/post what I have. I used a LCD display that has some buttons, I wrote a menu that lets you calibrate, zero, and tare from the keys. It needs completed but didn't work after I moved the circuit from a breadboard to a PC board and I haven't tried to fix it yet.
I first wrote a version that used the Arduino's text screen. I also have a custom map() function that works correctly with 24 and 32 bit numbers.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Anything you have might be useful. I'm at the point of considering another chip. Interface wise, I'm doing communication with the uC over a serial con nection and fully automating it, so the LCD, buttons etc might be superfluo us.
A few specific problems I seem to have come across are below. Just wonderin g if they might be the same things that you had to overcome.
1) POL pin set low, SPI_MODE0 does not work. Only POL pin high and SPI_MODE 3.
2) To get consistent reads of a register I have to introduce delays that, f rom my reading of the datasheet timing table, should not be needed. I also need to toggle the CS pin in between a read command and actually reading fr om the register, which doesn't seem to be specified (example code):
void adc_read( int address, int bytes ){ digitalWrite( CS, LOW ); delay( 1 ); SPI.transfer( READ_ONCE | register ); // Write to the com register, spe cifiying the register to read digitalWrite( CS, HIGH ); // Toggle the CS pin. Does not seem to work w ithout this. Either outputs garbage, or skips a single bit. delay( 1 ); digitalWrite( CS, LOW ); delay( 1 ); for( int i = 0; i<bytes; i++){ Serial.print( SPI.transfer( 0x00 ), BIN ); } digitalWrite( CS, HIGH ); delay(1); // Pause to stop next read or write occurring to early }
3) On internal zero or full scale calibration, if I only wait on the RDY pi n ( as in the pseudo code examples of the datasheet ) the AD7730 does not a lways assert RDY LOW ( probably does not manage to calibrate ), and you can 't move on
4) Once successfully into continuous reading mode, an interrupt attached to RDY pin will fire (and read the data register ) extremely frequently for a couple of seconds, and then the RDY pin stops being asserted (the AD7730 s tops continuous update of the register? ).
5) I can't seem to work out whether continuous conversion in the Mode regis ter, and Read continuous to the communications register are intrinsically l inked, or whether you should be able to set continuous conversion, and perf orm single readings (which would make sense).
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
2) To get consistent reads of a register I have to introduce delays that, from my reading of the datasheet timing table, should not be needed. I also need to toggle the CS pin in between a read command and actually reading from the register, which doesn't seem to be specified (example code):
Frequently I've found that the datasheet doesn't quite agree with the timing requirements revealed by an oscilloscope. The datasheet parameters begin as proposed goals to guide the designer, and may not all be tested in production, or verified during development if the engineer doesn't task the lab tech (me) to specifically measure them. Some are "guaranteed by design".
I've found some whoppers, really, but have signed non-disclosure agreements.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
replying to david, Matt wrote:

Hi, I am having the same problem that you described in point 3 and the calibration of the AD7730 never finishes as the uC waits for the RDY pin to go LOW. Has anyone found a solution to this problem?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
replying to RogerN , kasunsf wrote:

Hi! i was trying to build a scale using AD7730. I set the POL pin HIGH and SPI MODE0. I was able to write to the registers successfully. I read-back the written register values as well. But when it comes to continuous reading of data register, RDY pin goes LOW only once. Can you please help me to solve this issue?
Kasun
--


Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
"kasunsf" wrote in message

<snip>

Sorry I don't remember it that well, but I remember that if I didn't get a response after a length of time, it would automatically time out and try again.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.