BMP280 barometric sensor adjustment / correction

Moderator: leecollings

Post Reply
agourgeon
Posts: 4
Joined: Thursday 27 August 2015 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2563
Location: France
Contact:

BMP280 barometric sensor adjustment / correction

Post by agourgeon »

Hi all,

I just added a BMP280 barometric sensor to my Raspberry Pi2 (I2C wiring).
I added it to the Material section using BMP085/180 type, and it appeared in the list of devices as a barometric sensor. So far so good.
But the values given by the sensor are totally wrong (around 800 000 hPa and 75°C :o )
So I'm wondering if it is right to use BMP085/180 type to setup this sensor, and if there is a solution to obtain the right values from my sensor (creation of a template for this device?).

Thank you very much.

Yours
User avatar
gizmocuz
Posts: 2495
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by gizmocuz »

It should work.

But there are also example scripts on the internet to check the values from the command line, i would try this first to see if the readings are correct.
75c is a bit high ;)
Quality outlives Quantity!
agourgeon
Posts: 4
Joined: Thursday 27 August 2015 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2563
Location: France
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by agourgeon »

Hi,

Than you Gizmocuz for this good idea.
So here is the result of the comand line test :

Code: Select all

pi@raspberrypi ~/BMP280Code/Adafruit_Python_BMP/examples $ sudo python simpletest.py
Temp = 82.70 *C
Pressure = -4388769.00 Pa
Traceback (most recent call last):
  File "simpletest.py", line 50, in <module>
    print 'Altitude = {0:0.2f} m'.format(sensor.read_altitude())
  File "/usr/local/lib/python2.7/dist-packages/Adafruit_BMP-1.5.0-py2.7.egg/Adafruit_BMP/BMP085.py", line 191, in read_altitude
    altitude = 44330.0 * (1.0 - pow(pressure / sealevel_pa, (1.0/5.255)))
ValueError: negative number cannot be raised to a fractional power
I used a BMP085 script. Don't know if it's the same as BMP280. I will try to find one for BMP280.
The BMP280 is now alimented by the 3.3V pin, but I first plugged it on the 5V pin... Hope this didn't damage the sensor...

Any idea?
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by Toulon7559 »

Perhaps an unexpected, erroneous scaling-aspect related to BMP280? [Although the BMP280-datasheet does not tell such difference]
Some conversion-functions for Celsius>Fahrenheit and for mm>Pa and inches>Pa are contained in the scripts at http://www.domoticz.com/forum/viewtopic ... =839#p4512
If you assume the temperature to be in Fahrenheit, then your 75 degrees convert to (75-32)*5/9=24 degrees Celsius and your 83 degrees convert to 28 degrees Celsius, which at this moment are a bit high, but not unusual values for indoor measurement.
But multiplication with a factor of approx. 0,029 or 0,39 (and division by 1000) to your pressure-readings of 800,000 and 4,388,769 (or the other way around) does not result in values somewhere within the 'usual' pressure range of 800 to 1500 mbar/hPa: apparently for the pressure-values something else is applicable ......
As a reference, do you you have a reasonably accurate, parallel reading for temperature and pressure giving values in Celsius and hPa/mbar?
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
agourgeon
Posts: 4
Joined: Thursday 27 August 2015 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2563
Location: France
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by agourgeon »

Thanks for helping me.
To answer your questions, the temperature could be in degrees Fahrenheit instead of Celsius. The sensor is not so far from the Raspberry in my living room which can explain the 28°C. (Temperature in the living room is 25°C). So this can be a good explanation.
Concerning the pressure, I don't have any reference. Only the WeatherPro app on my phone saying 1 018 hPa (-4 388 954.00 Pa in the console now, and 801 065.6 hPa in Domoticz).
Does anyone have a BMP280 running on a Raspberry with Domoticz?
agourgeon
Posts: 4
Joined: Thursday 27 August 2015 15:17
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2563
Location: France
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by agourgeon »

Hi all,
I solved the problem by installing a BMP180 sensor...
It works well now.
Thank you for having tried to find solutions!
jeuf37
Posts: 1
Joined: Friday 12 February 2016 22:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: France
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by jeuf37 »

Dear colleagues,

I use the BMP180, it works well but I have a -12 hPa difference with the weather station of the Air Base close to my home. I think it is because they give the pressure at sea level and not Domoticz! (12 hpa corresponds to 100 m which is my altitude where I stay)

Do anybody know how/where could I put my altitude in Domoticz so that I'll have the corrected values !

Thanks a lot !
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: BMP280 barometric sensor adjustment / correction

Post by stlaha2007 »

jeuf37 wrote:Dear colleagues,

I use the BMP180, it works well but I have a -12 hPa difference with the weather station of the Air Base close to my home. I think it is because they give the pressure at sea level and not Domoticz! (12 hpa corresponds to 100 m which is my altitude where I stay)

Do anybody know how/where could I put my altitude in Domoticz so that I'll have the corrected values !

Thanks a lot !
Hi jeuf37,

On the temp / weather tab there is your device with an edit button. Insert there the correctionvalue like 12 or -12 to adjust up or down a little bit.

Currently implementing the BME280, remotely for Domoticz, with humidity besides temp and pressure. Ran into way off readings...

Also for mine is a specialy grafted BMP280 python script which reads and sample script give the 'right' values in degrees Celcius and pressure.

Looking for a way to use the driver with bash/perl or maybe python to push the 'correct values' into Domoticz.

I'll keep you posted. Perhaps Gizmocuz has a quick&dirty methode to do so?

Grtz,
Stephan
Toulon7559
Posts: 858
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: mixed
Location: Hengelo(Ov)/NL
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by Toulon7559 »

The general json-line you require for upload to Domoticz is described at http://www.domoticz.com/wiki/Domoticz_A ... Fbarometer
If you look for a piece of Python-script with an upload-function towards Domoticz, the example at http://www.domoticz.com/forum/viewtopic ... 808#p72227 may be useful: take the idea and adapt/tune for your configuration with humidity & temperature & barometer.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: BMP280 barometric sensor adjustment / correction

Post by stlaha2007 »

Toulon7559 wrote:The general json-line you require for upload to Domoticz is described at http://www.domoticz.com/wiki/Domoticz_A ... Fbarometer
If you look for a piece of Python-script with an upload-function towards Domoticz, the example at http://www.domoticz.com/forum/viewtopic ... 808#p72227 may be useful: take the idea and adapt/tune for your configuration with humidity & temperature & barometer.
Thanks,
Already used the wiki and modified the sample pythonscript from adafruit.

Only challenge is getting the predictions normal/rain and wet/dry instaed of the No Info/Normal which im pushing now.

Grtz,
Stephan
jessicamulein
Posts: 1
Joined: Monday 23 December 2019 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: BMP280 barometric sensor adjustment / correction

Post by jessicamulein »

It's funny you ran into those values. I have a BMP180 and ran into the very same. It's part of a BerryGPS IMU V3 so I can't just switch out the chip. Bummer =(

➜ BMP180_driver git:(master) ✗ ./barometer
Entering Calibration

ac1:0x0
ac2:0x3300
ac3:0xc0
ac4:0x54
ac5:0x0
ac6:0x0
b1:0x6002
b2:0x1
mb:0xffffff85
mc:0x1360
md:0x300

bmp180 calibration values:
ac1: 0
ac2: 13056
ac3: 192
ac4: 84
ac5: 0
ac6: 0
b1: 24578
b2: 1
mb: -123
mc: 4960
md: 768
}

t = 89, p = 716, tc = 827, pc = 80093274, com_rslt=0
t = 89, p = 716, tc = 827, pc = 80093274, com_rslt=0

There's got to be something more to this.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest