Introduction: Arduino Nano Altimeter Using GY-BMP280

Picture of Arduino Nano Altimeter Using GY-BMP280

This is my first project.

I searched how to setup this sensor using i2c with an Arduino Nano but couldn't find anything that worked right away. I had to change some stuff in the default library to get it work with my sensor and wrote a simple sketch to store the data and display it to the serial monitor.

I started flying RC planes and wanted something to check how far up I went. the next step is to integrate the data in the OSD (on screen display, used for flying FPV).

Step 1: Copy Paste Code and Library

Picture of Copy Paste Code and Library

the wiring is simple:

VCC to the 3V3 (important, do not use 5V, could destroy the sensor)

GND to GND

SDA to A4

SCL to A5

If the code does not work, but you hooked up everything accordingly try scanning for i2c devices using the scanner (not my program, author is declared in the header, also I didn't write most of the other, I left the original header of those as well). I changed the i2c address in the library to 0x76 as the sensor appeared on my scanner. if you detect your sensor on 0x77 just change this in the library.
If this still does not work you need to change the wire connection. On my Arduino Nano (some cheap chinese knock-off) I figured that the i2c ports are on A4 and A5. But there are several versions out there and some of them seem to use pin 4 (SDA) and pin 5 (SCL). If it still does not work you could download some other guys code. good luck! I hope it worked though :)

I will soon (if I get it to work) program the arduino to output the data via PWM (FrSky Smart Sensor) to use telemetry and compatibility with mini OSD

edit1: added new testing.ino file (code for arduino) that should be sleeker. make sure you have the libraries in the correct folder. ( /arduino/libraries/"library name"/"library name".h ) this caused me some trouble...

Comments

nediffs made it! (author)2017-12-02

I making this as part of a car alarm. I'm still to figure out how the pressure changes when a door is opened (can exactly test window being broken into).

If it works good enough, I'll add a GSM shield to send me a text if my car's been broken into. If that works well I'll add a proper Sound alarm and maybe even a GPS shield.

nediffs (author)2017-12-02

By the way, if you're not using just SDA +SCL but all the pins then the variable needs to be

#define BMP_SCK 13

#define BMP_MISO 12

#define BMP_MOSI 11

#define BMP_CS 10

Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

instead of just

Adafruit_BMP280 bme;

Had a huge issue with that, thought my soldering was shit, then I thought i screwed the sensor, but thanks to the i2c scanner seeing the sensor I eventually figured it out.

Swansong (author)2017-03-20

Thanks for sharing :)

cladeport (author)Swansong2017-03-20

did you get to try it out?

About This Instructable

1,815views

7favorites

License:

More by cladeport:Arduino Nano Altimeter Using GY-BMP280
Add instructable to: