EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: JPortici on February 24, 2017, 09:28:58 am

Title: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: JPortici on February 24, 2017, 09:28:58 am
Hi,
in an upcoming project we would like to monitor the elevation* of the device to adjust some value automatically, instead of having a trimmer that do it manually.
A pressure sensor seems to be the ideal choice (low complexity, if i understood it right with self contained sensors i just apply power and read the data from I2C when needed) but i am not sure on how to choose the sensor.

The elevation range would be sea level to say 3000m above sea, i found this BMP280 from bosch that could fet (or couldn't? i don't know)
(DS: http://www.mouser.com/ds/2/783/BST-BMP280-DS001-12-844746.pdf (http://www.mouser.com/ds/2/783/BST-BMP280-DS001-12-844746.pdf))

a hint in any direction would be appreciated, just don't know where to start looking.

*i said elevation, what i really want to know is local atmospheric pressure but having also an estimate of at what height i am right now could be useful
Title: Re: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: nfmax on February 24, 2017, 10:44:51 am
Those Bosch sensors (and their predecessors) are pretty good, and as you say fairly simple to use. You have to read the calibration factors out of the device and process the sensor readings yourself to get actual pressure (and temperature), but it's just (floating-point) arithmetic.

Remember the atmospheric pressure at sea level can vary quite widely - about ±4%. If you are reading ambient pressure and then correcting for reported sea level pressure to get height above sea level, you have to apply a standard atmosphere model to the sea level pressure. At low altitudes, both the US and ICAO standard atmospheres use the same model, so you can get the pressure formula from either. When I did this, I looked it up in the CRC Handbook of Chemistry & Physics - there is a Wikipedia page https://en.wikipedia.org/wiki/Barometric_formula (https://en.wikipedia.org/wiki/Barometric_formula) but I'm not sure of its reliability
Title: Re: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: mac.6 on February 27, 2017, 04:33:06 pm
BMP180/280 code is available on github from Bosch, too much verbose code (1400 line header file, doh!) but quite easy to use.
Title: Re: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: DaJMasta on February 27, 2017, 05:59:24 pm
I believe sparkfun also has a library for at least the BMP180 (they make a breakout board) to make it trivial to use on an arduino platform.


They are not the most accurate of available sensors, but they're decently priced and do give you pretty detailed measurements.  I think most any available sensors will have no problems at 3000m, but you can check by checking atmospheric pressure at 3000m above sea level and looking at the pressure spec on the sensor, and there are probably even calculators that make it so you don't even need a formula.
Title: Re: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: JPortici on February 27, 2017, 06:08:05 pm
who cares about arduino, i actually read the datasheets! :)

but seriously, i ordered the bmp280 breakout board from adafruit (the 180 is actually end of life, no good for production)
it should arrive tomorrow. i think i'll have time to play with by the end of the week
Title: Re: Needing a kick start on pressure sensors (for elevation/atmospheric pressure)
Post by: DaJMasta on February 27, 2017, 08:18:58 pm
Reading the datasheets is great, not having to write your own low level communication code just to read a value is great too.

There's definitely a place for all the libraries and interfacing you get with arduino and the associated stuff... maybe that's not in a finished product, but it's quite handy in building up a quick prototype or trying a new sensor out.


If you've got a 280 on the way then there's probably no need, but I believe you can get really, really cheap Chinese 180 (or even 280) modules on ebay.