Bmp280 Sensor gives wrong readings
See original GitHub issueWhile testing the Bmp280 sensor, I found that mine was giving very wrong readings (~940hPa when it should be in the order of ~1010hPa). There’s definitelly no storm outside now, and it’s cold but sunny.
Investigating further, I found a small bug in the calibration calculation for temperatures:
Line 181 of Bmxx80Base.cs should be changed to:
double var1 = ((((double)adcTemperature / 16384.0) - ((double)_calibrationData.DigT1) / 1024.0)) * (double)_calibrationData.DigT2;
There are missing parentheses in that formula.
I’ll come up with a patch for this (including an unit test), however, since my sensor still gives the wrong values (also with the python reference implementation), it’s hard for me to know that’s really all.
See also #1022
CC @djaus2
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
BMP280 Sensor Wrong Data Readings
To my surprise the Temperature reading was showing -142.6C constantly and the pressure was bouncing around 700hPa. I then tried using the code ......
Read more >BMP280 gives wrong pressure and temperature data
The data from the BMP280 sensor is incorrect, displaying negative pressures and quite warm temperatures (186 degrees Celsius!). When I run the example...
Read more >BMP280 Pressure Sensor Incorrect Pressure Value - General
I have found the BMP280 library, have wired in the sensor and am getting readings, however the pressure reading is wrong.
Read more >BMP280 reading wrong values (random jumps)
The PIR sensors are known to be sensitive to EMI and interference from nearby electronic devices can cause false triggers. It is possible...
Read more >Delay on BMP280 due to wrong calibration pressure?
I have recently fould a software error in my TVC model rockets' software stemming from outdated pressure values from the bmp280 sensor.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok will do in next 24hrs
David Jones MVP
From: Patrick Grawehr notifications@github.com Sent: Wednesday, April 1, 2020 4:28:56 PM To: dotnet/iot iot@noreply.github.com Cc: David Jones (MVP) davidjones@sportronics.com.au; Mention mention@noreply.github.com Subject: Re: [dotnet/iot] Bmp280 Sensor gives wrong readings (#1027)
Since my sensor is apparently broken (or is incorrectly calibrated) I would be glad if @djaus2https://github.com/djaus2 could verify the fix. I have ordered a new one, but I’m not sure when this arives.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/dotnet/iot/issues/1027#issuecomment-607040796, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7U2EPBTAZEMPBFTVSWZQLRKLGJRANCNFSM4LUADORA.
Actually, I’m a bit confused, because I think I didn’t really change anything (the parentheses on that line are extra-confusing). But I’ve done it together with an unit test and an improved calcuation formula (using doubles instead of fixed-point math). I can finish that PR pretty quickly, but I don’t want to have to many PRs open at a time.