Measuring output from a load cell
RichardF
Posts: 168
What is the best way to interface the Basic Stamp 2 to a load cell and read changes in output voltage (millivolt range)? The particular load cell I want to use will have 12 volts excitation and a 2 mv/v or 24 mv output. I guess we can generalize this question and ask what is the best way to interface the ouput of a Wheatstone bridge to the Stamp? An A/D converter comes to mind but not sure if that will work in the millivolt range.
Thanks,
Richard
Thanks,
Richard
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Many types of instrumentation amplifiers are·available from digikey.com or jameco.com·
·
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=LT1101CN8-ND
After this, it can be fed to an ADC and read by the BS2.
As mentioned, many newer load cells have the instrumentation amplifier built in and are designed for 0 to 5V (or 0.5 to 4.5V) output.
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting Software
Southern Illinois University Carbondale, Electronic Systems Technologies
-Phil
Code for AD7730
ADdata· var· WORD ·'variable to hold 16 bit result.
DATAin· con ·2 ·'AD data input pin.
DATAout ·con ·3· 'AD data output pin.
SCKL ·con· 4· 'clock to AD.
RDY· con· 5· 'RDY input .
INPUT 5
INITIAL:
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$FFFF\16,$FFFF\16] 'write 32 ones will reset the AD7730 to the default state
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02] 'write to communication register setting next operation as write to mode register.
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$B0B0\16]'write to mode register initiating internal full scale calibration
pause 500
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02]
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$B0B0\16]'write to mode register initiating system zero scale calibration
pause 500
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$3080\16] 'write to mode register starting continuous conversion for 10mV input range,unipolar,16 bit data word and 5V reference.
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$21] 'write to communication register setting next operation as continuous read from data register.
LOW 2 ' set DIN line low to insure part is not reset while in continuous read mode.
ReadData:
waitRDY:
IF RDY = 1 THEN waitRDY 'wait for RDY to go low to indicate output update.
SHIFTIN DATAout, SCLK, MSBPOST, [noparse][[/noparse]ADdata\16] 'read conversion result from data register.
DEBUG DEC ADdata, CR 'display data in decimal.
PAUSE 500 'wait 0.5 second between reading.
GOTO ReadData
Mohamed, if you can lead me to the source for an AD7730, or equivalent, I would appreciate it. Thanks for the code.
Richard
Richard
The following search engine is usually your best bet for sourcing chips:
http://www.findchips.com/
Based on the results of that search engine, it appears that Jameco does have the AD7730.
Regards,
Bruce Bates
Your correct, JAMECO does carry the AD7730 for $21. That's a bargain, especially with already having the code that Mohamed gave us.
Thanks
Richard
·I am using the BS2px. Does any of the code need to be changed?
(2) Connect·POL(pin4)·and CS(pin19) to GND·.
················ SYNC(pin5),RESET(pin6) and STANDBY(pin18) to +5V
··
(3) Connection between AD7730 & BS2:
AD7730················BS2
(DIN) pin22
pin7 (2)
(DOUT) pin21
pin8 (3)
(SCLK)·pin1
pin9·(4)
(RDY) pin20
pin10 (5)
·
http://tntech.facebook.com/album.php?aid=2038081&l=11ba0&id=52701181
About the code:
After : SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$FFFF\16,$FFFF\16]
Add this :
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$03]'write to communication register setting next operation as write to Filter Register.
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$7040,$10]'output rate for 50Hz line frequency in CHOP mode and DC excitation
Correct this:
·SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$B0B0\16]'write to mode register initiating system zero scale calibration.
·SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$D080\16]
Before :SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$3080\16]
Add :
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02]
******************************************
You may write the initial code like this:
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$FFFF\16,$FFFF\16]
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$03,$7040\$10]
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02,$B0B0\16]
pause 500
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02,$D080\16]
pause 500
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02,$3080\16]
SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$21]
LOW 2
·
Post Edited (MSDTech) : 3/24/2008 9:50:01 PM GMT
These are 16 and 18 bit converters with built in PGA (programmable gain amplifier) with differential gain of x8 which effectively increases the differential resolution to 19 or 21 bits.
--Tiny SO23 package, 6 pins, that can be placed right at the measurement point. (adapter pcb necessary for prototyping)
--Sngle channel sigma-delta, slow (8 SPS) but programmable tradeoff between speed and resolution.
--I2C interface can string several on one buss,
--relatively cheap at around $3 ea.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
it is better first check check that·communication between BS2 and AD7730 is right.
View the code at:
http://forums.parallax.com/showthread.php?p=717653
Make sure that all pins get a difined input. When the pin RDYinv sends all the time a 1 (not ready) there is quite sure a input error. Connect the pins as follows (Mohamed's code).:
AD7730->BS2
sclk->Pin4
MCLKin/out->cristall 4.9152MHz
POL-> 0(low)
SYNCinv->1(high)
RESETinv->1
AGND->GND
AVdd->5V
Ain(+/-)->load cell
REF(+/-)->load cell
STANDBYinv->1
CSinv->0
RDYin->pin5 (change in the program rdy to IN5)
Dout/in->PIN3/2
DVdd->5V
DGND->GND
Good luck Thomas
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards, Ryan O'Hara
Check out our $25 SMT Stencils!!!
www.ohararp.com/Stencils.html
I've used the ADS1100 in several projects, but not the MCP3421. They are similar, but I needed the ratiometric reference scheme of the ADS1100. Attached is demo code that configures the ADS1100 with a PGA gain of x8 so that the lsb is about 11 microvolts over a differential span of 0.375 volts.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 5/11/2009 9:32:24 AM GMT