Answer the question
In order to leave comments, you need to log in
How to work with the Chinese pressure sensor GY-BMP280-3.3?
The Chinese sell just such an atmospheric pressure sensor: GY-BMP280-3.3 . It is based on the Bosch BMP280. I ordered one for myself. There are sketches and libraries for the Adafruit board on the network , but it turned out that they are not suitable for the Chinese sensor (at least I could not get them to work).
In addition, there is this library and, as it turned out, it works with the sensor, but the pressure values \u200b\u200bare given incorrectly (the error in the readings is about 20 millibars, which corresponds to a pressure drop of 100 meters above sea level). The sensor reacts to pressure changes, so there is hope that it is not broken. It is not clear how to calibrate, since the library itself takes the pressure calculation method directly from the Bosch datasheetand I would not want to correct something there - and so it is not at all clear how what is considered there.
In connection with all this, the question arises - is my sensor incorrectly calibrated, or is there some separate library for the GY-BMP280-3.3 that can work correctly with it?
Who uses the GY-BMP280-3.3, please throw in the sources with which the sensor worked correctly for you.
Answer the question
In order to leave comments, you need to log in
I connected the Adafruit library like this: I
launched a sketch that scanned the i2c bus (there are many examples of such sketches on the network)
, the counter returned "Unknown device 0x76" to me,
then I connected the Adafruit library and passed the address that I found during scanning to the first command.
got something like this:
if (!bme.begin(0x76)) {
Serial.println("Could not find a valid BMP280 sensor, check wiring!");
while(1);
}
and everything worked
At first, I also could not connect it with a swoop. I had to figure it out - and everything turned out to be simple. I connected to arduino uno, with the following pinout:
SCL - 13
SDA - 11
CSB - 10
SDO - 12.
Next, you need to install the Adafruit BMP280 library ( Sketch-include library-manage libraries-install ), open the bmp280test sketch from it, and make a small edit:
instead
of Adafruit_BMP280 bme; // I2C
//Adafruit_BMP280 bme(BMP_CS); // hardware SPI
//Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
insert
//Adafruit_BMP280 bme; // I2C
//Adafruit_BMP280 bme(BMP_CS); // hardware SPI
Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
That is, comment out the first line, and unblock the third. After that everything worked.
Sensor address 0xEC (236) works with adafruit sketches and the like.
The sensor with aliexpress with SCL, SDA, CSB and SDO contacts is connected via I2C. Sensor address 0x76.
Connecting BMP280 --> Arduino Pro Mini (3v3):
SCL --> A5
SDA --> A4
CSB --> Vcc
Necessary and sufficient sources
Adafruit_BMP280_Library
Adafruit_Sensor This description is taken as a
basis
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question