Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmp085 module returns incorrect values (bmp180 sensor) #1471

Closed
CosmicMac opened this issue Aug 24, 2016 · 3 comments
Closed

bmp085 module returns incorrect values (bmp180 sensor) #1471

CosmicMac opened this issue Aug 24, 2016 · 3 comments
Labels

Comments

@CosmicMac
Copy link

Expected behavior

Right values returned by bmp180 lua module:

Lua module temperature: 25.2
Lua module pressure: 1009.9

Actual behavior

Wrong values returned by bmp085 native module:

Native module temperature: 143.9
Native module pressure: 1344.5

Test code

local SDA_PIN = 4 -- BMP180 SDA pin on GPIO2
local SCL_PIN = 3 -- BMP180 SCL pin on GPIO0
local OSS = 3 -- BMP180 oversampling setting (0: ultra low power, 1: standard, 2: high resolution, 3: ultra high resolution)


-- Test with bmp180 lua module (https://github.com/javieryanez/nodemcu-modules/tree/master/bmp180)
local bmp180 = require("bmp180")
bmp180.init(SDA_PIN, SCL_PIN)
bmp180.read(OSS)
local t1 = string.format("%.1f", bmp180.getTemperature() / 10)
local p1 = string.format("%.1f", bmp180.getPressure() / 100)
bmp180 = nil
package.loaded["bmp180"] = nil

print("Lua module temperature:", t1)
print("Lua module pressure:", p1)


-- Test with bmp085 native module

bmp085.init(SDA_PIN, SCL_PIN)
local t2 = string.format("%.1f", bmp085.temperature() / 10)
local p2 = string.format("%.1f", bmp085.pressure(OSS) / 100)

print("Native module temperature:", t2)
print("Native module pressure:", p2)

NodeMCU version

NodeMCU custom build by frightanic.com
branch: master
commit: 95e85c7
SSL: false
modules: adc,bmp085,cjson,dht,file,gpio,i2c,net,node,tmr,uart,wifi
build built on: 2016-08-23 18:24
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)

Hardware

ESP8266 board based on ESP-12f

@jmattsson
Copy link
Member

Could you please have a look at this, @kbeckmann ?

@igrcic
Copy link

igrcic commented Jul 1, 2017

Hi,

i can confirm this on my Wemos Mini device.

I am receiving the wrong value for the temperature reading, pressure seems to be closer to the real value.

@stale
Copy link

stale bot commented Jul 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 1, 2019
@stale stale bot closed this as completed Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants