When using the BMP 280 type sensor for measuring air pressure in HA, is the Bosch compensation built into the final value?
The values I’m seeing from two modules (within 1 mbar of each other) are a long way off the local values published for atmospheric pressure in this area, from multiple sources.
Around 20mbar low in a nominal range of 950 to 1050mbar.
There is a compensation calculation published in the Bosch data sheet, but is this used?
The BMP280 / BMP388 modules are sensors used within ESPHome with an ESP32.
These particular sensors provide temperature and pressure value readings, useable within HA. (There are some variations which give other data, eg Humidiy).
I had two BMP280s running on a single ESP32 for some time, and never really used the pressure values. The temperature values I compared with other devices and seem ok. The pressure values appear to have a significant offset. As noted above. I’ve only recently taken an interest in using the pressure.
So, checking the manufactures data sheet, it includes data on how compensation should be applied using the individual sensor offsets.
There is an array of 11 ‘compensation trim parameters’, given within the Bmp register map for pressure relating to the individual BMP sensor. (Another array of 10 values for temperature).
I can’t believe it’s up to a user to fetch these parameters and use them in a lambda?
I’ve looked in an associated file I’ve found in the ESPHome docs, where they seemed to be declared, but I’ve no idea if they are actually being used in a calculation to provide compensation.
I’ve just switched out one BMP280 for a BMP388 and the T&P values from each read similar.
(Are within limits).
But the pressure values seem too far out to be correct.
That’s similar to what I’ve found above. But where is the calculation that uses those values and applies it to the raw sensor reading?
I couldn’t understand that bit.
(Altitude here is around 100m AMSL. Which as far as I can make out, has less than 1% effect on a reading).
(Would a man with three watches be less sure of the time, than a man only having two?)
Well you can create a template sensor on the ESP if that’s where you are reading it. Mine is a weather station so I had to create a template sensor in HA.
The hPa values you show in your calculation are similar to what I have here at the moment, as raw and expected value. It looks like it could just be that calculation I’m missing then. That’s definitely more than 1%.
Thanks for that.
I’ll try including it.
I wonder why that wasn’t included as a configurable option in the HA BMP xxx component?
EDIT:-
I’ve just added it into the project and it’s definately the fix.