Can not read data from BMP280 Digital Pressure sensor + Raspberry Pi

Hi,
I am using a BMP280 digital pressure sensor for my research project. I have assembled this sensor with a Raspberry Pi. My target is to read sensor data using the provided python code (downloaded from here: https://github.com/ControlEverythingCommunity/BMP280).

While running the python code it thowring the output as like below:

Traceback (most recent call last):
File “BMP280.py”, line 16, in
b1 = bus.read_i2c_block_data(0x76, 0x88, 24)
IOError: [Errno 110] Connection timed out

Then I tried to run the following command to see the available hardware attached to the Pi:

sudo i2cdetect -y 1

It only showing
pi@raspberrypi:~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

Is that means Pi is not detecting any Sensor?

Now, my questions:

  1. If Pi is not detecting the sensor, what needs to do to resolve this problem?
  2. Then, how to get sensor data using python code?

does the i2c has pull ups?

Hi Bhaskar,
Sorry, I didn’t understand your question. Actually I am a novice in this case. You can see my setup here-

is the i2c enabled on this pi?
you can check by going into raspi-config

Yes, it is enabled. I had to turned it enabled since the SMBus library was not working without it.

is the address jumper installed ?
replace the i2c address in the lib to 0x77 and give it a go.

i dont have one of these to test. i will see if i can get one

Hi,
Can you please briefly explain how to install address jumper? And where to replace i2c address to 0x77? into the python code?

Sorry, as I told you I am a novice.

Today, I tested with the Pi model 3 (previously using Pi model 4). Facing the same issue.

do you have any arduino module by any chance ?

Ohh sorry I don’t have right now.

can you remove all the jumpers from the board and retry the i2c detect ?

Hi Bhaskar,
After removing all the jumpers from the sensor, it is working perfectly. I had no idea to remove this since jumpers were there with the package when delivered.

Thank you so much for your help.

if you are interested in what was wrong

You had one of the jumper installed in parallel position. and the shorted SCL and SDA lines.

1 Like