Notifications
Clear all

BME280 & Altitude ?

4 Posts
3 Users
1 Reactions
1,505 Views
UKSteve
(@uksteve)
Member
Joined: 3 years ago
Posts: 12
Topic starter  

Hi folks,

I've recently started to use the BME280 sensor for measuring temperature, humidity, pressure and finally altitude.

Built with an 1602 LCD and MicroSD card logger to record sensor data.

From what i can gather i have to set the pressure to 'calibrate' it to give correct readings ?

As i'm reading i need to give it the correct hPA pressure at the time i start it up ?

There code has a line to do this, the 997 hPA was entered today...

#define SEALEVELPRESSURE_HPA (997.25)  // 1013.25

As it's just a home project i've grabbed todays hPA pressure from a weather site...

https://www.windy.com/-Show---add-more-layers/overlays?pressure,53.239,6.460,6,m:fcSaf6Q

It's an Adafruit product, this is the link to it's details...

https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout

I'm just curious about how you go about setting up everything to give correct readings for the actual altitude, i know (or think i get it) that this sensor works out height (altitude) based on air pressure.

I've done a little bit of reading up, chasing links to various sources and i think i'm just about ready for the worlds biggest head ache right now (kidding)... wow... back to that fun subject... maths !

This is just my first attempt at building something so i'm just looking for a simple fun explanation, i'm not trying to get the sensor to the moon or anything.

Hopefully someone else has used this sensor and can give me the 'simple' version of the setup.

Thanks in advance folks.


   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2587
 

@uksteve

I'm not really certain what you're asking for, but I think it's a fast way to get sea level barometric pressure for your  sensor. I think airports usually specify their pressure readings corrected to sea level, so you can possibly check in with your closest one to get a reasonable starting point.

Anything seems possible when you don't know what you're talking about.


   
UKSteve reacted
ReplyQuote
(@davee)
Member
Joined: 4 years ago
Posts: 1882
 

Hi @uksteve,

  I haven't got such a sensor, but trying to use my limited imagination, I suspect what you have done is essentially as far as you can take it with the 'standard' software code.

That is

  • find out what the atmospheric pressure at your location from a source like windy.com
  • insert that value into the conversion code
  • the sensor will measure the actual pressure at your location,
  • the software will estimate your 'altitude' above sea level by comparing the sensor reading with the pressure at sea level from windy.com

An obvious point is that this procedure assumes the sensor output has negligible error, which may be an over optimistic assumption for some applications.

A 'smarter' software system might consider including a calibration correction for your particular sensor. Such a correction could enable it to make a better estimate of height from the air pressure, but it will still need to be 'told' what the sea level air pressure is for each new measurement.

In principle, I guess you could add a GPS and an Internet link, so the GPS found the current (Lat and Long) location of the sensor, interrogated windy.com or similar to look up the sea level air pressure, then used the barometric sensor to determine the altitude. But somehow I doubt you will find the need..? (The GPS also gives an estimate of height, but the typical errors [say 20 metres or more on a 'bad day'] are usually worse than the barometric estimates.)

Hope this helps. Dave

 


   
ReplyQuote
UKSteve
(@uksteve)
Member
Joined: 3 years ago
Posts: 12
Topic starter  

Thanks for the replies,

I've been playing around with it a little, it just seems to have good days and bad days, probably between 30 - 50 feet drift from what i can tell. Just a small thing i was working on so not a big problem. I'll set this up recording data and take it on a 'road trip' for the week, i can then check the data it records with known locations i will be at and compare notes.

My Tip... i had an old Samsung S5 phone sitting around... *#0*# and into the sensor menu, air pressure hPa could be used from that.

Anyway guys thanks for taking the time to reply,

best regards.

 


   
ReplyQuote