I am trying to use Hookup a BME280 Sensor to Arduino using I2C. I am using the Adafruit BME 280 breakoutboard. The controller is the Uno R3. I have done a i2c scan and am able to get an address of 0x77 or 0x76 depending on how I wire the BME280 to the R3. I have wired it according to the cactus.io hookup description. cactus.io bme280 hookup No matter what I do, I get the following readings that do not change:
22:05:47.568 -> Bosch BME280 Pressure - Humidity - Temp Sensor | cactus.io
22:05:47.638 -> Pressure Humdity Temp tTemp
22:05:47.671 -> -0.00 mb 0.00 % 0.00 *C 32.00 *F
22:05:49.651 -> -0.00 mb 0.00 % 0.00 *C 32.00 *F
22:05:51.663 -> -0.00 mb 0.00 % 0.00 *C 32.00 *F
22:05:53.639 -> -0.00 mb 0.00 % 0.00 *C 32.00 *F
22:05:55.652 -> -0.00 mb 0.00 % 0.00 *C 32.00 *F
I also have a second sensor. It is a BME/BMP280. It gives me the same results. (or very similar)
22:09:53.006 -> 1000.02 mb 0.00 % 0.01 *C 32.02 *F
22:09:54.983 -> 1000.02 mb 0.00 % 0.01 *C 32.02 *F
22:09:56.994 -> 1000.02 mb 0.00 % 0.01 *C 32.02 *F
22:09:59.014 -> 1000.02 mb 0.00 % 0.01 *C 32.02 *F
Here is the sketch that I have been using:
#include <Wire.h>
#include "cactus_io_BME280_I2C.h"
// Create BME280 object
BME280_I2C bme; // I2C using address 0x77
// or BME280_I2C bme(0x76); // I2C using address 0x76
void setup() {
Serial.begin(9600);
Serial.println("Bosch BME280 Pressure - Humidity - Temp Sensor | cactus.io");
if (!bme.begin()) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
bme.setTempCal(-1);// Temp was reading high so subtract 1 degree
Serial.println("Pressure\tHumdity\t\tTemp\ttTemp");
}
void loop() {
bme.readSensor();
Serial.print(bme.getPressure_MB()); Serial.print(" mb\t"); // Pressure in millibars
Serial.print(bme.getHumidity()); Serial.print(" %\t\t");
Serial.print(bme.getTemperature_C()); Serial.print(" *C\t");
Serial.print(bme.getTemperature_F()); Serial.println(" *F");
// Add a 2 second delay.
delay(2000); //just here to slow down the output.
}
I am very new to this and hope that I required the necessary information to have my question answered. Will be glad to supply more information if required and I am able.
Does anyone have any suggestions? Thanks for reading!
Andy