Sensor – BMP280 – Temperatuur en Barometrische druk sensor
Hardware
Informatie (ENG)
Description:
Bosch has stepped up their game with their new BMP280 sensor, an environmental sensor with temperature, barometric pressure that is the next generation upgrade to the BMP085/BMP180/BMP183. This sensor is great for all sorts of weather sensing and can even be used in both I2C and SPI!
This precision sensor from Bosch is the best low-cost, precision sensing solution for measuring barometric pressure with ±1 hPa absolute accuracy, and temperature with ±1.0°C accuracy. Because pressure changes with altitude, and the pressure measurements are so good, you can also use it as an altimeter with ±1 meter accuracy
Feature:
Model: GY-BMP280-3.3
Chip: BMP280
Power supply: 3 – 3.3V
Communication method: Standard IIC/SPI communication protocol
Air pressure range: 300-1100hPa
Pin pitch: 2.54mm
Module size: 11.5mm*15mm
Typical application:
– Enhancement of GPS navigation (e.g. time-to-first-fix improvement,dead-reckoning,slope detection)
– Indoor navigation (floor detection,elevator detection)
– Outdoor navigation,leisure and sports applications
– Weather forecast
– Health care application (e.g. sirometry)
– Vertical velocity indication (e.g. risk/sink speed)
Pinout
Pin: | Functie: |
1 | +3.3V (VCC) |
2 | GND |
3 | SCL Serial Clock (line) |
4 | SCA Serial Clock (data) |
5 | CSB (Chip Select) |
6 | SDO (Serial Data Out) |
Arduino
Sluit de module aan volgens onderstaand overzicht:
Arduino pin: | BMP280 pin: |
---|---|
+5V | +5V (VCC) |
GND | GND |
A5 | SCL Serial Clock (line) |
A4 | SCA Serial Clock (data) |
Script met adafruit BMP280 bibliotheek
Bibliotheek module adres aanpassen
Het adres van deze module kan gewijzigd worden tussen 0x76 en 0x77 door de SD0 lijn op GND of +3.3v te zetten, te controleren met een I2C scanner:
1 2 3 4 5 6 7 8 9 |
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- 76 -- |
Het adres kan je aanpassen in het bestand : Adafruit_BMP280.h
Pas deze regel aan, van:
#define BMP280_ADDRESS (0x77)
naar:
#define BMP280_ADDRESS (0x76)
Sluit de BMP module aan zoals hierboven aangegeven.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#include <Wire.h> #include <SPI.h> #include <Adafruit_Sensor.h> #include <Adafruit_BMP280.h> #define BMP_SCK 13 #define BMP_MISO 12 #define BMP_MOSI 11 #define BMP_CS 10 Adafruit_BMP280 bme; // I2C //Adafruit_BMP280 bme(BMP_CS); // hardware SPI //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(F("Could not find a valid BMP280 sensor, check wiring!")); while (1); } } void loop() { Serial.print(F("Temperature = ")); Serial.print(bme.readTemperature()); Serial.println(" *C"); Serial.print(F("Pressure = ")); Serial.print(bme.readPressure()); Serial.println(" Pa"); Serial.print(F("Approx altitude = ")); Serial.print(bme.readAltitude(1013.25)); // this should be adjusted to your local forcase Serial.println(" m"); Serial.println(); delay(2000); } |
Het resultaat
Arduino Library
Installatie van Arduino IDE libraries: Arduino info
Wat heb je nodig?
1) Adafruit Sensor library
Adafruit BMP280 Library
Informatie (ENG)
About the BMP280
This precision sensor from Bosch is the best low-cost sensing solution for measuring barometric pressure and temperature. Because pressure changes with altitude you can also use it as an altimeter!
Compatibility
MCU | Tested Works | Doesn’t Work | Not Tested | Notes |
---|---|---|---|---|
Atmega328 @ 16MHz | X | |||
Atmega328 @ 12MHz | X | |||
Atmega32u4 @ 16MHz | X | Use SDA/SCL on pins D2 & D3 | ||
Atmega32u4 @ 8MHz | X | Use SDA/SCL on pins D2 & D3 | ||
ESP8266 | X | SDA/SCL default to pins 4 & 5 but any two pins can be assigned as SDA/SCL using Wire.begin(SDA,SCL) | ||
Atmega2560 @ 16MHz | X | Use SDA/SCL on pins 20 & 21 | ||
ATSAM3X8E | X | Use SDA/SCL on pins 20 & 21 | ||
ATSAM21D | X | |||
ATtiny85 @ 16MHz | X | |||
ATtiny85 @ 8MHz | X | |||
Intel Curie @ 32MHz | X | |||
STM32F2 | X |
- ATmega328 @ 16MHz : Arduino UNO, Adafruit Pro Trinket 5V, Adafruit Metro 328, Adafruit Metro Mini
- ATmega328 @ 12MHz : Adafruit Pro Trinket 3V
- ATmega32u4 @ 16MHz : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0
- ATmega32u4 @ 8MHz : Adafruit Flora, Bluefruit Micro
- ESP8266 : Adafruit Huzzah
- ATmega2560 @ 16MHz : Arduino Mega
- ATSAM3X8E : Arduino Due
- ATSAM21D : Arduino Zero, M0 Pro
- ATtiny85 @ 16MHz : Adafruit Trinket 5V
- ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
1 2 3 4 5 6 7 8 9 |
v1.0.2 - increased oversampling on everything - temperature is auto-read before pressure v1.0.1 - Moved calibration data from static to member variable so multiple sensors can co-exist with different calibrations. v1.0.0 - Initial release for Arduino library manager system. |
Schema
Teardown
GEEN GEGEVENS
Datasheet
Fritzing
Downloads
GEEN GEGEVENS