Hi guys, i’m trying to use a BMP280 to see pressure and altitude, but always appears “Temperature 0ºC”, “Pressure 0 hPa” and “Altitude 44330m”
My code is:
I’m using a SPI set, I soldered the pins on the sensor and also tryed to use a BME280 library.
My board is an NODEMCU ESP8266.
I don’t know what’s wrong, help me please! Thanks a lot!
Don't know the BMP specifically, but it looks like you are not actually communicating with the sensor and the sketch is returning the default values, so double check wiring, relevent ports are enabled, and if you can put a 'scope on it to see if you are getting response or find another way to see any write/response.
I see that you are using the Adafruit library but you haven't stated whether or not you are using a sensor module provided by Adafruit. There are two possible I2C addresses for the sensor. Adafruit uses one of them (which is the default for the library) and most other modules use the other.
There's a reason why the Adafruit examples include a check to see if the 'begin' function is successful. You have chosen not to include this test.
AmphenolSensors:
Don't know the BMP specifically, but it looks like you are not actually communicating with the sensor and the sketch is returning the default values, so double check wiring, relevent ports are enabled, and if you can put a 'scope on it to see if you are getting response or find another way to see any write/response.
Hi, thanks for share your knowledge, i will try that, but i think the BMP280 wiring is correct.
floresta:
I see that you are using the Adafruit library but you haven't stated whether or not you are using a sensor module provided by Adafruit. There are two possible I2C addresses for the sensor. Adafruit uses one of them (which is the default for the library) and most other modules use the other.
There's a reason why the Adafruit examples include a check to see if the 'begin' function is successful. You have chosen not to include this test.
Don
Alright, i think that i understandod, but i'm using a SPI communication, have i to change this? Or just try to change the I2C address?
Well, if you are using SPI then you are using SPI. I don't understand why the topic of I²C has come in. Have you tried running the example sketch from Adafruit?
dyso:
Well, if you are using SPI then you are using SPI. I don't understand why the topic of I²C has come in. Have you tried running the example sketch from Adafruit?
Sorry about that. I missed his mention of SPI in the original post.
Hi dude, thanks for sharing this code, but unfortnutely it's not working too, i think you are right when you say that adafruit library doesn't work with some types of sensors, but i don't know what i have to do now, because i have tryed a lot of ways, i bought a new sensor yesterday and it's still not working, i tested the wiring soldered and without soldered, i don't know what i'm gonna do, maybe i have to buy a different sensor. i'm lost haha.
I don't know if it helps but i'm trying to do this project: Estação meteorológica com NodeMCU | Curto Circuito
dyso:
They use a different pinning. Did you check your pinning?
It's SPI! Don't get confused with I²C. If you want to use I²C, then connect it correctly.
I'm very confused about SPI and I2C, if i wanna change the SPI for I2C, what do i have to change in my code and wiring? Because the only thing that i don't test is change the SPI for I2C.
Can you help me with this?