Shop OBEX P1 Docs P2 Docs Learn Events
help with barometer calibration mathematics on the stamp — Parallax Forums

help with barometer calibration mathematics on the stamp

CogburnCogburn Posts: 62
edited 2005-01-30 00:39 in BASIC Stamp
I connected a·donated barometric pressure sensor to an ADC0831 and to a Basic Stamp 2 IC as a part of a weather station.· I am getting voltage readings into a· variable called mVolts displaying·with the stampdaq program that are around 2700 at 1 atmosphere and·I can add pressure to make it jump to nearly 4000·and·apply small vacuum and get less than 1000.·I think the way the program is written these readings represent millivolts times 10.· I want to calibrate this·sensor to read in inches of mercury.

If·I was using Qbasic I would simply use a ratio and proportion to calibrate to a good barometer something like this.

inHg = (mVolts/2700)*29.92· 'assuming that 2700 is equal to 1 atm

I am pretty sure that this will not work with the stamp due to its affinity for interger math.· I am wondering if anyone has a idea how to set up the math or special operators that might perform the calibration.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Showing up to school doesn't·mean you are a student any more than crawling up in an oven means that·you are a biscuit.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-01-29 15:54
    Hello,

    We have a math co-processor that will work perfect for this project, here is a link for more information:· http://www.parallax.com/detail.asp?product_id=604-00030a·.· There are examples and a schematic available to help you through the process.· I believe that you can find more information at www.emesystems.com·regarding this project.·

    Dave


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com



    Post Edited (Dave Andreae (Parallax)) : 1/29/2005 4:06:39 PM GMT
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-01-29 19:47
    inHg = (mVolts/2700)*29.92·= mVolts * 1.10815

    in Stampese:

    inHg = mV ** 7088 + mV

    The operation ** 7088 is equivalent to multiply * 7088 followed by an implicit divide by 65536, and 7088/65536 = 0.10815.

    For calibration of the barometer, the formula may also have an offset inHg = slope * mV + offset. You can get a better idea of that when you compare the readings with an accurate barometer over a period of time, or with a manometer.

    The math coprocessor is probably overkill for this, unless you have other numbers to serously crunch. That FPU Dave referred to is the brainchild of Cam Thompson, at this URL: www.micromegacorp.com/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-29 21:09
    Cogburn,

    are you trying to determine trends in pressure or altitude?
    You'll need to know what your areas' local pressure is and then calculate back for Cistern/Sealevel pressure and then determine altitude.

    I think I remember that 0.1mbar is equal to 3feet (1metre).· and isn't 29.92inHg sea level?· the number is familiar!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • CogburnCogburn Posts: 62
    edited 2005-01-30 00:12
    Thanks guys,

    I am interested in the barometric pressure at my location and the ups and downs that might occur with approaching systems.· I suppose that accuracy is not extremely critical however I was hoping for reasonbly accurate readings.· I am wanting to log data to a spreadsheet throught the stampdaq macro.· I was having trouble with the required "math talk" that would allow me to change the millivolt readings into inches of mercury approximations.· I will not be taking the sensor on trips or to different altitudes so I will be satisfied with a simple conversion equation that will approximate inches of mercury.· I will try the formula Tracy suggested and I think that will do nicely for what I have in mind.· thanks again guys for your help and suggestions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Showing up to school doesn't·mean you are a student any more than crawling up in an oven means that·you are a biscuit.
  • steve_bsteve_b Posts: 1,563
    edited 2005-01-30 00:39
    You can certainly record accurate readings.· That's sensor/sampling dependant of course.

    But after it's all said and done, what you'll want to do to know true altitude is know what your air pressure is at your location.

    Check with weather.com or whoever you might get your forecasts from.

    If you are eventually going to log your data in to an excel spreadsheet...then just include an offset for your formula.· This would be based on local air pressure.· Of course, this is only relevant for Mean Sea Level.·
    If you know your sites height above sea level....then just record pressure at the launch site and this is the pressure for that level on that day....the air pressure still changes at the same for rate of ascent.· It's a relative measurement (which isn't the same as measuring your cousins melon!).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://members.rogers.com/steve.brady
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Sign In or Register to comment.