Shop OBEX P1 Docs P2 Docs Learn Events
load cell and motor voltage readings using basic stamp — Parallax Forums

load cell and motor voltage readings using basic stamp

team.steam.s Posts: 13
edited 2008-04-14 21:28 in BASIC Stamp
Hi again,
The main aim of my project is to take voltage readings from a motor and load cell simultaneously and save the data on a USB stick which I can later access·using excel to plot a graph of voltage from load cell against voltage from motor. The stamp should also really control the start and stop of the motor. Again I am extremely new to programming i.e this is the first program I've ever written, and have no idea where to start and whether·I can actually do it or not. Can someone please help me out with writing the program and tell me where to start.
I've got the datalogger and the BS2 module along with the basic 2 carrier board.
Thanx

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-02-23 15:32
    What voltages are the load cell and motor using? How are you controling the motor? How much precision do you need/want? How fast do you need to sample? These are things you need to address before you even get into programming. Build the hardware and then write the program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • team.steam.s Posts: 13
    edited 2008-03-04 12:17
    The load cell is using 9V and the motor 18V. The motor is started by a simple microswitch, but i wanted it started by an imput from the load cell (i.e. when the load cell has a force applied to it, the motor starts up). The precision wanted is about +/- 1% and the sample rate is 50 samples per second.
    Can this be reasonable achieved?
  • MSDTechMSDTech Posts: 342
    edited 2008-03-04 13:13
    What is the output voltage of the load cell for the force range that you are working with? Most of the load cells I have delt with produce output in the range of 5mv/V.
  • team.steam.s Posts: 13
    edited 2008-03-04 18:42
    erm... its output resistance is 5K ohms and its Span is 360mV at 10VDC
    Can't find a specific value for its output voltage.
  • team.steam.s Posts: 13
    edited 2008-03-04 21:15
    Here's the spec sheet, its on page 3 (shown as page 62). The model is FSG15N1A.

    Its the "FSG and FSL Series force sensors" under "Catalog Information" at
    http://sensing.honeywell.com/index.cfm?ci_id=140264&defId=117625
  • MSDTechMSDTech Posts: 342
    edited 2008-03-04 23:22
    The next question is what load do you want to trigger the motor and when do you shut the motor off?

    The load cell you have is designed to measure the force and give an analog output that is proportional to the force applied. Will any force start the motor, or will it be 10grams, 100grams or what. This will determine the accuracy of the circuit needed to convert the voltage output into a signal that can be read by the basic stamp.

    You might look at the LTC1298 analog to digital converter. This has a resolution of 1.22 mv and is described at:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/appkit/ltc1298.pdf
    This will give you a digital signal that tells you the amount of force being applied to the force cell (the sample code is in the link). With an appropriate voltage divider, this same type of device can measure the voltage across the motor.

    Also, can you post some kind of sketch to show the relation of the load cell to the motor?

    Post Edited (MSDTech) : 3/4/2008 11:36:57 PM GMT
  • team.steam.s Posts: 13
    edited 2008-03-05 13:27
    Many thanks everyone!

    Ideally, I wanted the motor to start as soon as the load cell sent an output, but it seems to be producing so much static noise, it would probably be a good idea to have it initiate the motor at 10 grams load.

    The load cell sits beneath the motor so that as the motor retracts into the body of a case, it compresses a spring which presses up against the load cell. Sorry for the pretty pathetic diagram!



    ········· Force applied to top of motor
    ······· · /
    ······· /

    ···· _ll_
    ·····l···l·· <-- motor
    ···· l·· l
    ····l-o-l·· <-- load cell
    · l··· /·· l
    · l·· ·\·· l
    · l·· ·/·· l·· <-- casing
    · l·· ·\· ·l
    · l·· ·/ <
    spring
    · l
    l
    ////////////

    Post Edited (team.s) : 3/5/2008 1:32:46 PM GMT
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2008-03-05 14:21
    These load cells are simply the bridge portion of a full circuit. From that output it needs to drive an Instrumentation Amplifier op-amp configuration to give it a gain of about 1000 while rejecting noise. From there you can read it an ADC. There are load cells with the electronics integrated into it, but they cost a fair amount more. If you want help finding an integrated load cell or a good instrumentation amp, let me know, but both can be pricey.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    SelmaWare Solutions - StampPlot GUI for controllers, XBee and Propeller Application Boards

    Southern Illinois University Carbondale, Electronic Systems Technologies

    American Technical Educator's Assoc. Conference·- April, Biloxi, MS. -- PROPELLER WORKSHOP!
  • team.steam.s Posts: 13
    edited 2008-03-05 15:03
    Could you show me where to find an integrated load cell please? Am I right in assuming that you can therefore take the output from one of the integrated cells and have it fed directly to the chip, then send the value to the USB stick?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2008-03-05 16:26
    I'm having problems finding an integrated load cell that's under 10lbs force. I'd recommend using an amplifier to reject your noise and boost the signal:
    http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=AD623ANZ-ND
    On page 14 of the data sheet http://www.analog.com/UploadedFiles/Data_Sheets/516895375AD623_c.pdf it shows a sample bridge circuit used with it.

    This will still give you an analog voltage out, so you will need to use the ADC discussed above or the ADC0831 (see the Process Control text for examples).

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    SelmaWare Solutions - StampPlot GUI for controllers, XBee and Propeller Application Boards

    Southern Illinois University Carbondale, Electronic Systems Technologies

    American Technical Educator's Assoc. Conference·- April, Biloxi, MS. -- PROPELLER WORKSHOP!
  • team.steam.s Posts: 13
    edited 2008-03-06 12:02
    Thanks everyone for your help.

    I've done a little testing, and the load cell output voltage is 0.0114V at no load, and 0.498V at my max load (1Kg). The motor will be running at 18V (i.e. from 2x 9V batteries). Can anybody suggest an op amp suitable for this purpose and a corresponding ADC to out put into the BS2? and a suitable ADC for the motor too. I've apent all morning pouring over data sheets and i'm a little lost and confused.

    The AD623 described above - It seems like the min input voltage is 2.7V - Am I reading this correctly?? It seems quite a high value.

    Thanks,
    Jon.
  • MSDTechMSDTech Posts: 342
    edited 2008-03-06 12:16
    I'm working with an AD7705 to read a load cell for a rain gage. It has a combined amplifier and 16 bit ADC in one package. They're $8.60 from Newark. You will also need a resonator to provide the internal clock for the chip. If you download the data sheet, on page 38 is a sample circuit for a pressure indicator. This, without the thermocouple shown on the diagram is the exact circuit you need to measure the load cell.
  • team.steam.s Posts: 13
    edited 2008-03-06 12:24
    Amazing!! Thank you very much.

    The data sheet for the AD7705 states clocks between 500KHz and 5MHz should be used, so I was wondering if it matters what value? I was going to get a 4MHz resonator, as they seem to be widely available and cheap. Is this suitable? Also, does it matter what resistance it has?

    Post Edited (team.s) : 3/6/2008 1:18:51 PM GMT
  • MSDTechMSDTech Posts: 342
    edited 2008-03-07 03:15
    I'm running mine with a 4Mhz resonator and using the setup routine to divide that by 2. Puts me in an acceptable frequency for the chip.
    Which resistance are you referring to?

    I'm hoping to get the code functional in my weather station this weekend. I'm having some problems re-synching with the AD7705 after reading the other instruments. Looks like its back to reading the datasheet VERY Carefully to find the resync options.

    Post Edited (MSDTech) : 3/7/2008 3:20:10 AM GMT
  • team.steam.s Posts: 13
    edited 2008-03-07 09:45
    Resistance... I had a catalogue in front of me and I saw about 100 4MHz resonators, each with a different resistance value. Its ok now though, i've ordered the parts (an AD7705 anda 4MHz resonator).

    Sorry to be a pain in the neck, but what's the "step routine" and why would the resonance need to be divided by 2?

    Thanks.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-03-07 09:55
    team.s -

    I suspect you may be burning the midnight oil. What you read as "step routine" is actually "setup routine". Check the post to verify that, as I'm burning some of the same smile.gif

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Programming can't be all that difficult, it's nothing but 1's and 0's
  • MSDTechMSDTech Posts: 342
    edited 2008-04-14 21:28
    Team.s

    I got your PM and have been able to sort out the problems. I've attached the code for both controllers and the FPU I use to perform the calculations. The FPU handles the 16 bit output a little easier than the stamp, and since I was running short on program space for the stamp, the ability to store the calculation as a function in the FPU saves a lot of program space.

    You should be able to locate the subroutines that set up the AD7705 and read it in the external module code and the processing in the internal module code and FPU code (its a text file used by the FPU IDE), you can download info on the FPU at http://www.parallax.com/Store/Components/AllIntegratedCircuits/tabid/154/CategoryID/31/List/0/SortField/0/catpageindex/3/Level/a/ProductID/244/Default.aspx

    I've also included a layout diagram for the card holding the AD7705. It's not well labeled (I'm still working on the project notebook). The rectangle on the right is a 10K precision potentiameter I use to set the reference voltage. I'm currently running with a 2v reference. The strain gage uses the standard color code for the wiring with red/black being the exitation voltage and green/white being the output.

    Hope this helps with your project.
Sign In or Register to comment.