KS0405 Keyestudio BMP280 Module (Black and Eco-friendly): Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 32: Line 32:
== Hookup Guide ==
== Hookup Guide ==
<br>
<br>
'''For I2C communication:'''<br>
<big>'''For I2C communication:'''</big><br>
<br>[[Image:KS0405-I2C.jpg|700px|frameless]]<br>
<br>[[Image:KS0405-I2C.jpg|700px|frameless]]<br>


<br>
<br>
'''For SPI communication:'''<br>
<big>'''For SPI communication:'''</big><br>
<br>[[Image:KS0405-SPI-.jpg|700px|frameless]]<br>
<br>[[Image:KS0405-SPI-.jpg|700px|frameless]]<br>
<br>
<br>
Line 42: Line 42:
== Test Program ==
== Test Program ==
<br>
<br>
'''For I2C communication:'''<br>
<big>'''For I2C communication:'''</big><br>


<pre>
<pre>
Line 85: Line 85:
}
}
</pre>
</pre>


<br>
<br>
'''For SPI communication:'''<br>
<big>'''For SPI communication:'''</big><br>
 
<pre>
<pre>
#include <Wire.h>
#include <Wire.h>
Line 132: Line 132:


<br>
<br>
== Upload the program ==  
== Upload the program ==  
<br>
<br>
Line 138: Line 139:
https://www.arduino.cc/en/Main/OldSoftwareReleases#1.5.x  <br>
https://www.arduino.cc/en/Main/OldSoftwareReleases#1.5.x  <br>
<br>
<br>
Here we use the Arduino 1.6.1 version to test the BMP280 module in the code.<br>
<span style="color: red"> Here we use the '''Arduino 1.6.1 version''' to test the BMP280 module in the code.<br>
It might fail to compile the test program when using other versions of arduino IDE.  
It might fail to compile the test program when using other versions of arduino IDE. </span> <br>
<br>[[Image:Ks0405-1.png|700px|frameless]]<br>
<br>[[Image:Ks0405-1.png|700px|frameless]]<br>
<br>
<br>
Line 176: Line 177:
== Resources ==
== Resources ==


'''Download the PDF:''' <br>
*'''Download PDF,code and libraries :''' <br>
https://drive.google.com/open?id=1gyzmH7GTabga8h2i-BocPAgUo2UwPVI3
 
https://fs.keyestudio.com/KS0405
 
 
<br>
 
== Buy From ==
*[https://www.keyestudio.com/keyestudio-bmp280-module-digital-sensor-temperature-humidity-barometric-pressure-sensor-module-p0519.html  Official website ]


*[https://www.aliexpress.com/store/product/Keyestudio-BMP280-5V-Digital-Barometric-Pressure-Altitude-Sensor-High-Precision-Atmospheric-Module-For-Arduino/1452162_32984799188.html?spm=2114.12010615.8148356.1.3d1f31519Gr79c    Shop on aliexpress ]




[[Category: Module]]
[[Category: Module]]

Latest revision as of 11:58, 4 March 2021

Keyestudio BMP280 Module(Black and Eco-friendly)


Overview

The keyestudio BMP280 module mainly uses the BMP280 sensor, a temperature and air pressure sensor, which is an absolute air pressure sensor designed for mobile applications.
The sensor module is available in an extremely compact package with small size and low power consumption. It features proven piezoresistive pressure sensor technology with high accuracy and linearity, as well as long-term stability and high EMC robustness. The multiple device working options provide the ultimate flexibility; we can optimize the device in terms of power consumption, resolution and filtering performance.
The module has two modes: I2C communication and SPI communication mode. When using the BMP280 module, users can choose the communication method according to their own needs.


Technical Parameters

  • Operating voltage: DC 5V
  • Air pressure measurement range: 300hPa~1100hPa (elevation +9000~-500m)
  • Air pressure measurement error: ±1hPa (±1m)
  • Air pressure measurement accuracy: 0.18Pa
  • Temperature measurement range: 0℃~ 65℃
  • Temperature measurement error: ±0.5℃, maximum ±1℃
  • Temperature measurement accuracy: 0.1℃


Application field

  • temperature check
  • Atmospheric pressure detection
  • Altitude detection
  • Indoor navigation (floor inspection, elevator inspection)
  • Outdoor navigation, leisure and sports apps
  • Healthcare applications (i.e. spirometry)
  • Vertical speed indication (i.e. ascending/sinking speed)


Hookup Guide


For I2C communication:

KS0405-I2C.jpg


For SPI communication:

KS0405-SPI-.jpg

Test Program


For I2C communication:

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>

#define BMP_SCK 13    //SCL
#define BMP_MISO 12   //SDO
#define BMP_MOSI 11   //SDA
#define BMP_CS 10     //CSB

Adafruit_BMP280 bme; // I2C
//Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO,  BMP_SCK);
  
void setup() {
  Serial.begin(9600);
  Serial.println(F("BMP280 test"));
  
  if (!bme.begin()) {  
    Serial.println("Could not find a valid BMP280 sensor, check wiring!");
    while (1);
  }
}
  
void loop() {
    Serial.print("Temperature = ");
    Serial.print(bme.readTemperature());
    Serial.println(" *C");
    
    Serial.print("Pressure = ");
    Serial.print(bme.readPressure());
    Serial.println(" Pa");

   // Serial.print("Approx altitude = ");
   // Serial.print(bme.readAltitude(1013.25));
   // Serial.println(" m");
    
    Serial.println();
    delay(2000);
}



For SPI communication:

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>

#define BMP_SCK 13    //SCL
#define BMP_MISO 12   //SDO
#define BMP_MOSI 11   //SDA
#define BMP_CS 10     //CSB

//Adafruit_BMP280 bme; // I2C
Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO,  BMP_SCK);
  
void setup() {
  Serial.begin(9600);
  Serial.println(F("BMP280 test"));
  
  if (!bme.begin()) {  
    Serial.println("Could not find a valid BMP280 sensor, check wiring!");
    while (1);
  }
}
  
void loop() {
    Serial.print("Temperature = ");
    Serial.print(bme.readTemperature());
    Serial.println(" *C");
    
    Serial.print("Pressure = ");
    Serial.print(bme.readPressure());
    Serial.println(" Pa");

   // Serial.print("Approx altitude = ");
   // Serial.print(bme.readAltitude(1013.25));
   // Serial.println(" m");
    
    Serial.println();
    delay(2000);
}


Upload the program


Special note:
You can download different version of Arduino IDE from the link here:
https://www.arduino.cc/en/Main/OldSoftwareReleases#1.5.x

Here we use the Arduino 1.6.1 version to test the BMP280 module in the code.
It might fail to compile the test program when using other versions of arduino IDE.


Ks0405-1.png

Downloaded Arduino 1.6.1, unzip the software package to open the arduino application.
Ks0405-2.png

Follow the hookup guide to connect well the module, and open the arduino software.


Note: before open the software, do remember to place the code libraries inside the arduino libraries folder.

Ks0405-3.png

Ks0405-4.png

Open the arduino software, firstly select the proper Board and COM port in “Tools”.
Ks0405-5.png

After that, copy and paste the test code to arduino window. Click to compile and upload the code.
Ks0405-6.png

Done uploading the test code, click to open the monitor Ks0405-7.png and set the baud rate to 9600.
The monitor will show the current temperature and air pressure.
Ks0405-8.png


Schematics Diagram


Ks0405-9.png


Extension


Ks0405-9.jpg


Resources

  • Download PDF,code and libraries :

https://fs.keyestudio.com/KS0405



Buy From