i2cdetect shows an empty grid with a BME280 and a light sensor on my Pi 4
ok so this is for my lab environment monitor (2nd year project). Pi 4, Raspberry Pi OS Bookworm, a BME280 breakout and a VEML7700 lux breakout, both Adafruit-style boards with their own regulators. The plan is Python on the Pi reading both every 30 s and publishing to Hermetry. The Hermetry side already works, I tested with a fake value and it shows up on my board.
The sensors don’t. I enabled I2C in raspi-config, rebooted, and:
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
...
70: -- -- -- -- -- -- -- --
Wiring: VIN to pin 1 (3.3 V), GND to pin 6, SDA to GPIO 3, SCL to GPIO 5. Both boards daisy-chained on a breadboard. I’ve swapped jumper wires already. Is it possible both sensors are dead? They were cheap-ish.
Why is it bus 1 and not 0? I always wondered that with these commands
Bus 0 is reserved for the HAT ID EEPROM on pins 27/28. Bus 1 is the user one. Aoife, when you say “GPIO 3”, do you mean physical pin 3 or BCM GPIO 3?
…I went by the numbers printed on my breakout cable, which I think are GPIO numbers. So GPIO3 and GPIO5?
That’s the problem, I did exactly the same thing on my first build. The I2C pins are physical pin 3 (that’s BCM GPIO2, SDA) and physical pin 5 (BCM GPIO3, SCL). You have SDA on GPIO3, which is actually SCL, and SCL on GPIO5, which is physical pin 29 and not I2C at all. So the bus has no device answering and you get the empty grid. The sensors are almost certainly fine.
Move SDA to physical pin 3 and SCL to physical pin 5, then you should see 0x77 (or 0x76, depends on the SDO jumper) for the BME280 and 0x10 for the VEML7700. The Pi has 1.8 kΩ pull-ups on those two pins already, and the breakouts add their own, so don’t add more.
Then reading and sending is short. I use the Adafruit CircuitPython drivers plus paho:
import json, time, board, adafruit_bme280.basic as bme, adafruit_veml7700
import paho.mqtt.client as mqtt
i2c = board.I2C()
env = bme.Adafruit_BME280_I2C(i2c, address=0x77)
lux = adafruit_veml7700.VEML7700(i2c)
c = mqtt.Client(client_id="lab-env-01")
c.username_pw_set(TOKEN) # token as username, no password
c.tls_set()
c.connect(BROKER_HOST, 8883, 60)
c.loop_start()
while True:
msg = {"temp_c": round(env.temperature, 2), "rh": round(env.humidity, 1),
"pressure_hpa": round(env.pressure, 1), "lux": round(lux.lux, 1)}
c.publish("v1/telemetry", json.dumps(msg), qos=1)
time.sleep(30)
Flat object, so Hermetry stamps it with the receive time, fine for 30 s readings. Payload rules are here if you want to add timestamps later: MQTT topics and payload reference.
yep that was it 🤦 moved two wires and both addresses popped up (0x10 and 0x77). Script ran first try and the four keys are on my board now. lesson learned: physical pin numbers and GPIO numbers are not the same thing
thanks Lee for the bus 0 explanation, makes sense now
- 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.

