Adafruit BME280 library [PORTED]

Basically i was trying SPI interface with the example .ino provided by particle. With no success, i wanted to shift to I2C but even your the code provided by you is not working.I think its the problem of the I2C address but performed the I2C scanner and used different address like 0 D0, 077 and 0*76 no luck.
Even used some pull up resistors of 4.7 k for I2C interface between 3v3 to SCA AND SCL and CSB to 3V3 but no luck.
(P.S. my sensor is GY-BME/P280.)

Alright i will need more information in order to help you. Please show the code you are using and also draw the circuit of the connection you are using between the BME280 and the particle device.

Even used some pull up resistors of 4.7 k for I2C interface between 3v3 to SCA AND SCL and CSB to 3V3 but no luck.

I don't quite understand how you are connecting the sensor to the particle device. Infact this connection sounds completely wrong. You connect 3V3 to the power pin of the sensor only. SDA of the sensor connects to SDA of yhe particle device and SCL of the sensor connects to SCL of the particle device.:face_with_raised_eyebrow:
Also can you provide a link for the version of the BME280 sensor you are using. Are you using the particle photon ? Also when you ran your I2C scanner which address did the sensor respond to ?

P.S you only need 2 connections for data transmission with I2C: SDA and SCL.

Don’t know whats happening but after i tested my photon with example ino of web ide named bmetest.ino its been breathing green.
Now i am trying to get results on electron so hope i will succeed.
For the connection, as stated by @https://www.electronicwings.com/particle/particle-photon-board.

Basically i was trying SPI interface with the example .ino provided by particle.

You said you were using the example for SPI here. I have no idea what example you are referring to and it will be easier to help you if you put all the information here for us to see.

For I2C you only need 4 connections: 2 for power and 2 for communication and nothing else. Did you try connecting it the same i suggested which is also the way its suggested in the website for the I2C connection ( SDA photon to SDA BME280 and SCL photon to SCL BME280)? VCC of the sensor connects to 3.3V of the photon and GND of the photon connects to GND of the BME280. Have you done this? Those are all the connections you require.

Generally a breathing green implies a problem with cloud connection i.e. you are not connected to particles cloud. Please connect the sensor to your photon the way i suggested and run the code i provided using the library i suggested. If you are unsure of the address connect the sensor as i suggested and run the I2C scanner to find the address. Without the correct address it will not work. If your photon is breathing green still try upgrading the software of your photon from the particle dash board.

I am trying it with the next photon i bought and got this result with I2C interface and had scanned too my I2C which is 0*76.
Device photon and sensor GY-BME/P280.
Seriously in need of help…

I had issues using the adafruit library also. That’s why I changed to the control everything library and suggested that you try theirs out. It worked for me. Did you try the program I suggested in conjunction with the library I suggested ?

It's not 0*76 which would equate to zero (anything mulitplied by 0 will be 0) but it it 0x76 which is the C/C++ way of denoting hexadecimal numbers.

i connected the D0 and D1 with SDA and SCL and copied your whole code with that specified library, even it is not functioning.

Thanks for your reply. that was the silly mistake but even using right way of address, it is not functioning.

Did you try the code I provided with the correction ScruffR pointed out ?

I am open to correction but i think the adafruit library for the BME280 works best with the adafruit BME280 sensor. Control Everything’s library worked with all the BME280 sensors I tried. You said you tried the code I suggest with the library I suggested. Can you tell us what went wrong with it ? So we can try to identify the problem.

Sorry for digging up an old thread. Trying to compile, using the GitHub library (on SPI), but at the cloud compile stage (from Particle Workbench) it derives errors. Principal of these, is the use of the Arduino function in the BME280.h header.

Has anyone else come across this?

Yes, I had this problem as well. Have not been able to get my sensor working.

Good Day everyone… Thanks for the useful advice above. I was able to get my 280 up and running first try. Now I’d like to add a second BME280 using the CE_BME280 lib. I’ve done this before with DHT22’s on their lib’s and have found examples on the web for other BME280 library’s but am not skilled enough to know what to do (or if it will work with this library). I’d appreciate any direction you can offer.

You can use multiple BME280 on the same bus, but how to do it depends on the bus you are using.
With I2C you’d need to select an alternative address (depending on your board) and pass that address to the bme.begin() call and for SPI you’d need to use a dedicated CS/SS pin which you need to provide to the constructor for a new object instance.