New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

i2cdetect shows no address at all, is the BME280 broken or did I wire it wrong?

i2cdetect shows no address at all, is the BME280 broken or did I wire it wrong?

Solved 5 3

Translated from Türkçe by AI ·

Me again 🙂 I wanted to switch from the DHT22 to a BME280 in my greenhouse prototype, since it’s supposed to be more stable. Pi 4, Raspberry Pi OS, I enabled I2C via raspi-config and rebooted. I got a purple 6-pin module: VCC, GND, SCL, SDA, CSB, SDO.Wiring: VCC 3.3 V (pin 1), GND (pin 6), SDA pin 3, SCL pin 5. CSB and SDO are unconnected. Result:

$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
...
70: -- -- -- -- -- -- -- --

No address at all. How can I tell whether I2C is working or not? I bought two modules and both behave the same way.

♥ 1

Translated from Türkçe by AI ·

i2cdetect -y 0 try it, maybe it’s on the other bus.

Ağ geçidi yine bağlanıyor…
♥ 1

Translated from Türkçe by AI ·

-y 0 says “Could not open file /dev/i2c-0”.

♥ 1

Translated from Türkçe by AI ·

On a Pi 4 you don’t need to look at bus 1, 0 on the header. A completely empty table usually comes from one of two things, and I ran into the same thing on a site:1. SDA and SCL are swapped. Pin 3 is SDA (GPIO2), pin 5 is SCL (GPIO3). Follow the wiring again using the labels on the module, cheap cables often have mixed-up colours.2. On a 6-pin module, if CSB is left floating the chip can switch to SPI mode at power-up. Connect CSB to 3.3 V and SDO to GND and the address becomes 0x76; connect SDO to 3.3 V and it becomes 0x77.Quick check: with the Pi on and the sensor connected, measure the voltage of SDA and SCL against GND with a multimeter. Both should be around 3.3 V (the Pi has pull-ups). If you see 0 V, something is pulling the line down: a short circuit or a wrong pin.Once the address shows up, check the chip ID too: on a BME280 register 0xD0 returns 0x60. If it returns 0x58, you were sold a BMP280, which has no humidity sensor; there are a lot of them on the market.

sudo i2cget -y 1 0x76 0xD0
Accepted solution♥ 4

Translated from Türkçe by AI ·

SDA and SCL were swapped 🤦 After I also connected CSB to 3,3 V, 0x76 showed up. But the chip id came back as 0x58, so both are BMP280s, no humidity. For now I’m sending the temperature and pressure to Hermetry, I’ve ordered a real BME280. Thanks!

♥ 1

Translated from Türkçe by AI ·

I fell into the BMP280 trap too, get well soon 🙂

Ağ geçidi yine bağlanıyor…
♥ 1
Viewing 6 posts – 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Join the conversation

Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

Share