Breaking News

Interface BME280 sensor with Raspberry Pi

This is my 11th project of #100DaysOfIoT Challenge.

This one is very basic and easy way to start working with Raspberry Pi with some industry standard sensors. BME280 sensor can sense the Pressure, Temperature, and Humidity. SO, We will see how to check these using Raspberry Pi. Of course, this setup has been used in many fields, like a weather station, agriculture, cold storage management, etc… practicing this will be a great help for your upcoming projects. 

Required Components: 

  1. Raspberry Pi 3 Model B – 1
  2. Adafruit BME 280 Sensor – 1
  3. Female To Feale Wires – 4

PIN CONNECTION:

RPi <–> Ultrasonic Sensor

2–>vin

4–> SDI

5–> SCK

6–> GND

Explanation:

  • Connect Raspberry Pi with BME280 Sensor
  • Follow the below commands.
  • sudo apt-get update
    sudo apt-get install build-essential python-pip python-dev python-smbus git
    git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
    cd Adafruit_Python_GPIO
    sudo python setup.py install
  • Now run it. 
    python Adafruit_BME280_Example.py
  • Simple. But, don’t forget to enable I2C in your Pi configuration settings

DEMO:

CODE:

import bme280
 
(chip_id, chip_version) = bme280.readBME280ID()
print "Chip ID :", chip_id
print "Version :", chip_version
 
temperature,pressure,humidity = bme280.readBME280All()
 
print "Temperature : ", temperature, "C"
print "Pressure : ", pressure, "hPa"
print "Humidity : ", humidity, "%"

One thought on “Interface BME280 sensor with Raspberry Pi”

Leave a Reply

Your email address will not be published. Required fields are marked *