# Bme280 not detect

**URL:** <https://forums.pimoroni.com/t/bme280-not-detect/24221>\
**Category:** Support\
**Created:** [February 20, 2024, 9:45am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221 "2024-02-20T09:45:25Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 20, 2024, 9:45am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/1 "2024-02-20T09:45:25Z")

</div>

bme280 wouldnt be detect on raspberry pi 3 with i2cdetect -y 1.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 20, 2024, 10:00am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/2 "2024-02-20T10:00:57Z")

</div>

How is it connected to the Pi 3, jumpers, breadboard?  
Is there a header soldered on?

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 20, 2024, 11:54am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/3 "2024-02-20T11:54:10Z")

</div>

I use for pico W  
PIN 36/39 - 3,3v  
PIN 1 for sda  
PIN 2 for. Scl  
PIN 3 for ground

 ![image](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/c/ca97fecc7f1ee76de3e51ba09ab0f699408430a1.jpeg)

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 20, 2024, 12:22pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/4 "2024-02-20T12:22:41Z")

</div>

Ok, what code are you running on the Pico to detect it?

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 20, 2024, 7:49pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/5 "2024-02-20T19:49:34Z")

</div>

thats from thonny  
from machine import Pin, I2C  
i2c = I2C(0, sda=Pin(0), scl=Pin(1))  
print(i2c.scan())  
on Pico I have MicroPython v1.22.0

But second on my RPI3 → i do i2cdetect -y 1 and no address 0x76 or 0x77 is shonw

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 20, 2024, 10:29pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/6 "2024-02-20T22:29:47Z")

</div>

Just to confirm,  
it is detected on the Pico,  
but not detected on the Pi 3?

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 21, 2024, 5:28am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/7 "2024-02-21T05:28:04Z")

</div>

Neither pico nor rpi3  
I think the bme280 is out of order

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 21, 2024, 8:27am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/8 "2024-02-21T08:27:18Z")

</div>

I’d redo your soldering, and try again.  
 ![soldering101](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/9/9e3cc7018819834233dfaec96e1e3b42d2c539ba.png)

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 21, 2024, 5:11pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/9 "2024-02-21T17:11:38Z")

</div>

I have do that and checked.  
The result is the same.

Regards  
Harald

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 21, 2024, 8:44pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/10 "2024-02-21T20:44:41Z")

</div>

> [@hraufer](#):
>
> i2c = I2C(0, sda=Pin(0), scl=Pin(1))

I “think” that should be  
`i2c = I2C(0, sda=Pin(1), scl=Pin(2))`  
It’s the GP number.

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 22, 2024, 6:10am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/11 "2024-02-22T06:10:54Z")

</div>

# I2C Scanner MicroPython

from machine import Pin, SoftI2C

# You can choose any other combination of I2C pins

i2c = SoftI2C(scl=Pin(2), sda=Pin(1))

print(‘I2C SCANNER’)  
devices = i2c.scan()

if len(devices) == 0:  
print(“No i2c device !”)  
else:  
print(‘i2c devices found:’, len(devices))

for device in devices:  
print("I2C hexadecimal address: ", hex(device))

Output  
MicroPython v1.22.0-preview.147.ga00c9d56d on 2023-11-09; Raspberry Pi Pico W with RP2040  
Type “help()” for more information.

> > > %Run -c $EDITOR\_CONTENT  
> > > I2C SCANNER  
> > > No i2c device !

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 22, 2024, 9:34am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/12 "2024-02-22T09:34:45Z")

</div>

This is the code I’ve been using in Micro Python. The physical pin number versus GP number catches me out now and then. Plus different Pimoroni devices using different pins for i2c. It is looking like your BME280 is a dud though.

```auto
import machine
sda=machine.Pin(4) # Explorer 20 Breakout 4
scl=machine.Pin(5) # Explorer 21 Breakout 5
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
 
print('Scan i2c bus...')
devices = i2c.scan()
 
if len(devices) == 0:
  print("No i2c device !")
else:
  print('i2c devices found:',len(devices))
 
  for device in devices:  
    print("Decimal address: ",device," | Hex address: ",hex(device))

```

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 22, 2024, 9:51am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/13 "2024-02-22T09:51:55Z")

</div>

I went and double checked what pins the Pico Breakout garden Base uses.  
SDA \> GP 4 \> Physical Pin 6  
SCL \> GP 5 \> Physical Pin 7  
So in the code I posted, its using the GP number.  
That means for my code its SDA 0, SCL 1, not 1, 2. You had it right and **“I”** got it confused. Sorry about that.

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 22, 2024, 11:17am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/14 "2024-02-22T11:17:27Z")

</div>

Thats Not working for ‘pico W’

 ![image](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/0/0c0c382f731feff0ac2e269b2e0af886911dd61c.jpeg)

---

<div class="post-metadata">

**Author:** ![hraufer](https://avatars.discourse-cdn.com/v4/letter/h/87869e/32.png) [@hraufer](https://forums.pimoroni.com/u/hraufer)\
**Post date:** [February 22, 2024, 11:23am UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/15 "2024-02-22T11:23:18Z")

</div>

For pico it works 👍😀

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [February 22, 2024, 12:40pm UTC](https://forums.pimoroni.com/t/bme280-not-detect/24221/16 "2024-02-22T12:40:10Z")

</div>

That pinout picture you posted is for a Raspberry Pi, not a Pico W.

[Raspberry Pi Pico GPIO Pinout](https://pico.pinout.xyz/)  
[Raspberry Pi Pico W GPIO Pinout](https://picow.pinout.xyz/)

[Raspberry Pi GPIO Pinout](https://pinout.xyz/#)

EDIT: The Micro Python Code I posted above won’t work on a Raspberry Pi.

Pi Python, [pimoroni/bme280-python: Python library for the BME280 temperature, pressure and humidity sensor (github.com)](https://github.com/pimoroni/bme280-python)

Pico, [pimoroni-pico/micropython/examples/breakout\_bme280 at main · pimoroni/pimoroni-pico (github.com)](https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/breakout_bme280)
