Shop OBEX P1 Docs P2 Docs Learn Events
BMP180 barometric sensor — Parallax Forums

BMP180 barometric sensor

Hi all.
I`m about to convert my weather station from BS2 to Propeller version. In this new version I`d love to hook up a BMP180 barometric sensor module that`s laying around here afther an impulse shopping at e-bay. Does anyone out there have an functional Spin-code to read this sensor, that you eventually could share??
I`ve been through OBEX and the Forum, but couldn`t find anything. Just asking..

Comments

  • Cluso99Cluso99 Posts: 18,069
    If you cannot find a specific driver, maybe start with the Basic_I2C driver.
    Also look at any other specific driver with the intention to modify it to suit.
  • The BMP180 is a successor to the BMP085, and a quick comparison between the datasheets shows very little change, just an additional sample mode. My i2c archive in the Obex has a BMP085 demo that I bet would work for the 180.

  • Try this to start with:


    BMP180 Barometric Pressure Sensor
    This code reads the BMP180 barometric pressure sensor by Bosch. Currently support for the Parallax Propeller in SPIN to supplement existing code for the Arduino provided by SparkFun Electronics. Testing was done with the BMP180 breakout board (link below) and a Propeller ASC+. Different resolutions are selected on sensor initialization as documented in the code.


    https://github.com/jrleeman/BMP180

  • Hi LA6WNA - Let me know if you have issues with the driver linked above. It's been awhile, but it's working fine in the sensor pack I used it with.
  • Hi again folks.
    Thanks alot for provided ideas. I`ve tried the code from github tonight, provided by Bob, and it worked well at once. No issues with this. I also use the breakout board, where the pull-up`s already are mounted. Think I`ll go for this code and modify it a little to suit my setup. I`ve never worked with barometric sensors before, so I also have one more question: Do I have to calibrate the Pascal readout value for the altitude of my weather station? I mean, if this sensor is calibrated at sea level and I`m going to have it mounted abt 200m above the sea level, would there be an offset? Any of you have experience with this?
  • Well, it depends on what you want to do. Are you trying to measure altitude or the more commonly reported mean sea level pressure (MSLP)? The reading from the sensor is in absolute pressure, since stations are all at different altitudes we commonly correct to MSLP. There is a pretty good summary of the needed equations on the spark fun page about the sensor.
  • Thanks, leeman. That link you posted explained alot for me. I`m going to mesure MSLP. Guess the best thing to do is to measure pressure at sea level and then at the location for my weather station at the same day, and then calibrate the readout with the real measured offset. Did not find any exactly formula that can do this by just put in the level difference in meters, but I`m sure it exists.
  • LA6WNA wrote: »
    Guess the best thing to do is to measure pressure at sea level and then at the location for my weather station at the same day, and then calibrate the readout with the real measured offset.

    Depending on how crazy you want to get with accuracy there are a variety of formula. You just need to pull your elevation from Google Earth or a GPS unit. It's also good to compare with a local station to make sure the implementation is correct. In the Arduino code for the BME180 it's implemented as:
    double SFE_BMP180::sealevel(double P, double A)
    // Given a pressure P (mb) taken at a specific altitude (meters),
    // return the equivalent pressure (mb) at sea level.
    // This produces pressure readings that can be used for weather measurements.
    {
    	return(P/pow(1-(A/44330.0),5.255));
    }
    

    You can also go little more in-depth as shown here or in how we calculate altimeter settings.
  • If you have an airport nearby at a similar altitude the aviation METAR reports that are available give the current pressure. Here's mine currently:
    METAR text:	KPBI 101153Z 34007KT 10SM FEW040 SCT060 BKN250 11/04 A3019 RMK AO2 SLP223 T01110039 10133 20106 53027 $
    Conditions at:	KPBI (WEST PALM BEACH , FL, US) observed 1153 UTC 10 February 2016
    Temperature:	11.1°C (52°F)
    Dewpoint:	3.9°C (39°F) [RH = 61%]
    Pressure (altimeter):	30.19 inches Hg (1022.4 mb)
    [Sea-level pressure: 1022.3 mb]
    Winds:	from the NNW (340 degrees) at 8 MPH (7 knots; 3.6 m/s)
    Visibility:	10 or more miles (16+ km)
    Ceiling:	25000 feet AGL
    Clouds:	few clouds at 4000 feet AGL
    scattered clouds at 6000 feet AGL
    broken clouds at 25000 feet AGL
    Weather:	
    SOME DATA ABOVE MAY BE INACCURATE!!!
    "$" is an indication the sensor requires maintenance
    
    All you have to do is google using the terms "metar" and the abbreviation of a nearby airport, for me it was "KPBI".
Sign In or Register to comment.