# Photon & Adafruit BME280 troubleshooting

**URL:** <https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269>\
**Category:** Troubleshooting\
**Tags:** photon\
**Created:** [March 6, 2019, 8:52pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269 "2019-03-06T20:52:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![karica2](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@karica2](https://community.particle.io/u/karica2)\
**Post date:** [March 6, 2019, 8:52pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/1 "2019-03-06T20:52:33Z")

</div>

I’m trying to use the Adafruit BME280 sensor with my photon. I’ve been using the Adafruit\_BME280 particle library, and in that I’ve been using the example code. Every time I’ve tried to run it, I get the “Could not find a valid BME280 sensor, check wiring!” message. This has happened when I’ve tried both the I2C and SPI options. I’ve tried the SPARKFUNBME280 library as well(didn’t expect anything from that) and got 0.00 for all the readings.  
I have looked over my SPI and I2C wiring a million times and I know the pins are correct in both cases. I’ve connected the VIN to the 3v3 pin and the VIN particle pins to no avail. It is grounded, as well.

VIN -\> Particle VIN / 3v3  
GND -\> Particle GND  
SCK -\> D0  
SDI -\> D1

I haven’t been connecting it to anything with an extreme voltage. is it possible i shorted out my sensor? I can provide any details needed.

Thanks!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [March 6, 2019, 9:38pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/2 "2019-03-06T21:38:27Z")

</div>

> [@karica2](#):
>
> I have looked over my SPI and I2C wiring a million times and I know the pins are correct in both cases.

Hmm, you said you tried SPI and I2C and "mega checked" the wiring, but then you post this

> [@karica2](#):
>
> VIN -\> Particle VIN / 3v3  
> GND -\> Particle GND  
> SCK -\> D0  
> SDI -\> D1

That is definetly _ **not** _ correct for neither SPI nor I2C.

I2C: [https://docs.particle.io/reference/device-os/firmware/photon/#wire-i2c-](https://docs.particle.io/reference/device-os/firmware/photon/#wire-i2c-)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/0/5/0576f38b9855c2197d517d8edd3350e31c331649.png)

SPI: [https://docs.particle.io/reference/device-os/firmware/photon/#spi](https://docs.particle.io/reference/device-os/firmware/photon/#spi)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/9/8/98db163c7442d6e0b1cd3de3f0faba5fb5c27a66.jpg)

Since the logic levels on the Photon are 3.3V you should power the sensor via `Photon 3v3 -> Sensor Vin`

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [March 6, 2019, 10:04pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/3 "2019-03-06T22:04:58Z")

</div>

And don’t forget pull-ups for i2c!

---

<div class="post-metadata">

**Author:** ![karica2](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@karica2](https://community.particle.io/u/karica2)\
**Post date:** [March 6, 2019, 10:25pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/4 "2019-03-06T22:25:19Z")

</div>

I have righted this mistake, and flipped the pins. It is now  
`SCK -> D1`  
`SDI -> D0`  
And I am still getting the same result.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [March 7, 2019, 3:08pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/5 "2019-03-07T15:08:22Z")

</div>

Hi @karica2

Maybe you should share a picture of the wiring, just so we can help more.

Also I would try running i2c scanner code on your Photon to see if it can find the device at address 0x77.

---

<div class="post-metadata">

**Author:** ![karica2](https://avatars.discourse-cdn.com/v4/letter/k/ed8c4c/32.png) [@karica2](https://community.particle.io/u/karica2)\
**Post date:** [March 8, 2019, 6:53pm UTC](https://community.particle.io/t/photon-adafruit-bme280-troubleshooting/48269/6 "2019-03-08T18:53:31Z")

</div>

When changing the configuration of wires to take a clean picture, I ran the test code as a hail mary and it just started working. I’m not sure what I changed, or if it was faulty wires. Thank you to everybody who helped!!!
