Shop OBEX P1 Docs P2 Docs Learn Events
Load Cell BS2e Interface — Parallax Forums

Load Cell BS2e Interface

MerfMerf Posts: 10
edited 2008-03-17 15:24 in General Discussion
I need help designing and building a device to weigh a racing sailboat.·I'd like to interface a BS2e to a load cell.··My initial research suggests that I would need to use·an analog to digital converter and perhaps a voltage amplifier.· The boat weighs on the order of 525 lbs and I have an electric chain hoist.· My plan is to use a load cell in tension (connected between the hoist and the boat being weighed) and take the load cell output and have the stamp analyze this and display the boat's weight.

I found a load cell (model·XTS4 available from 800loadcel.com) that is, I understand, a·wheatstone bridge circuit with a recommended·excitation voltage of 10 VDC and an output of 3 mV.· I admit I don't understand what a wheatstone bridge circuit does, and am hoping for some tutorial on that.· If anyone has other sources for less-expensive load cells, please chime in.

· I am not an engineer but can build pretty much any circuit from a schematic.· I am also not particularly adept at writing code, so I am also·looking for ideas from anyone who has already invented the wheel on this one.· I'd like a sample schematic (parts sources would also be helpful), as well as the code for the stamp.

· I plan to use a BS2e and prefer to interface it with a Max 7219 to show the weight on 7-segment LED display.· I want to be able to weigh the boat and also lighter parts as well (on the order of 70 to 80 pounds).· I suppose I will also have to figure out how to calibrate the thing (in this regard, I suppose this will require some basic stamp math calculations).· Thanks for your help·everyone.· MERF

Comments

  • Mike CookMike Cook Posts: 829
    edited 2008-03-05 20:04

    Don't know if this will help, but I built a Model Rocket Motor test stand, a few years ago,·using a load cell. This web site has info and plans:

    http://www.jamesyawn.com/electronicstand/index.html


    And some information on the Instrument Amplifier that was required to interface the load cell to an ADC

    http://www.jamesyawn.com/electronicstand/amp/index.html


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • MerfMerf Posts: 10
    edited 2008-03-05 20:13
    Thanks Mike Cook for your references.· Your ideas are good.· I assume your rocket load cell tests the thrust output.· The voltage amplifier is a good idea too.· I think the key issues will be quantifying voltages from the load cell (using an amplifier), converting them into data that the stamp can use, and applying some math to calibrate the scale into a pounds / kg figure that can be displayed on the 7-segment LED.· Hopefully someone has already skinned this cat and has a specific design plan, schematic and sample code.· MERF
  • Mohamed RefkyMohamed Refky Posts: 47
    edited 2008-03-11 18:48
    AD7730 , Bridge Transducer ADC for Load Cell Applications.

    Search the forums for AD7730 you will find the code.
  • MerfMerf Posts: 10
    edited 2008-03-11 19:52
    yeah.gif·Thank you Mohamed for your idea.· I had seen this one before.· Do you have some pointers on how to program the stamp to·take the values from the AD7730 and (1) save them on the BS2e, (2) a tare function (3)·calibrating the load cell with a known weight, (4) converting the weight data to·either pounds or·kg, and finally, (5) sending the processed·data to the 7 segment led display via the max chip.· Any thoughts or pointers would be·greatly appreciated.· Thank you.· Merfconfused.gif
  • Mohamed RefkyMohamed Refky Posts: 47
    edited 2008-03-15 21:02
    Code for AD7730 FOR BS2
    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]$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

    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]$D080\16]'write to mode register initiating system zero scale calibration
    pause 500
    SHIFTOUT DATAin, SCLK, MSBFIRST, [noparse][[/noparse]$02]
    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
    *********************
    Tare function:
    Initiating system zero scale calibration remove tha pan weight and the display will show zero reading.
    This is performed after power up.
    AD7730 output code is represented as follows:
    Code = (Ain/Input Range)*2^n
    Ain is the the analog input voltage and n = 16 in 16 bit mode
    Weigh equation:
    Weight = {Ain/[noparse][[/noparse]load cell sensitivty (mV/V) x excitation voltage]}*load cell
    ·············capacity (kg)
    Substitute Ain from code equation
    Calibrating the load cell with a known weight:
    Put a known weight on the pan and on pressing a key a routine is running to correct a constant number in the above weight equation until the the display reading match the known weight.
    Use MAX7219 to display data.
  • MerfMerf Posts: 10
    edited 2008-03-17 15:24
    Thank you Mohamed for your code and ideas.· I'll give it a try.· burger.gif Merf
Sign In or Register to comment.