seabeam
Posts: 4
Joined: Fri Nov 30, 2018 7:54 pm

I2C not recognizing BME280

Fri Nov 30, 2018 9:05 pm

Hello everybody,
I have soldered the pins to the bme280 sensor and wired this up to my PI:
Pin 1 - VIn
Pin 3 - SDI
Pin 5 - SCK
Pin 9 - GND

I have checked with a multimeter on the VIn and GND pins and I am getting the 3.3V.

I have enabled the I2C on the raspi-config and have downloaded the i2C-tools.
sudo update in between al these steps and rebooting.

When I type

Code: Select all

sudo i2cdetect -y 1
I get no detection.

Code: Select all

root@raspberrypi:~# 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: -- -- -- -- -- -- -- -- 
When I try:

Code: Select all

root@raspberrypi:~# ls /dev/i2c*
/dev/i2c-1
root@raspberrypi:~# 
I have purged and reinstall the i2c-tools and rebooted after that.

Also I have checked:

Code: Select all

root@raspberrypi:~# lsmod | grep i2c
i2c_bcm2835             7167  0
i2c_dev                 6913  0
root@raspberrypi:~# 
Does anybody have any idea where I can keep on looking where the problem may be?? Is it the bme280 ???

Thanks in advance

Andyroo

Re: I2C not recognizing BME280

Fri Nov 30, 2018 9:21 pm

Is it configured for a SPI connection?

Do you have a link to the maker of the card?

seabeam
Posts: 4
Joined: Fri Nov 30, 2018 7:54 pm

Re: I2C not recognizing BME280

Fri Nov 30, 2018 11:03 pm

Hi,

https://learn.adafruit.com/adafruit-bme ... duino-test

The sensor is setup for both i2c and spi. I have wired it up for the i2c setup.

User avatar
joan
Posts: 15427
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: I2C not recognizing BME280

Fri Nov 30, 2018 11:16 pm

To double check it's not an address problem you could try connecting SDO to ground or 3V3.

Andyroo

Re: I2C not recognizing BME280

Fri Nov 30, 2018 11:33 pm

Odd question - are you using a model B?

If so it would be:

Code: Select all

sudo i2cdetect -y 0
Note the zero

Is this the only sensor connected to the Pi?

seabeam
Posts: 4
Joined: Fri Nov 30, 2018 7:54 pm

Re: I2C not recognizing BME280

Sat Dec 01, 2018 10:18 am

Hi guys just solved the problem.

I had jumped the step of checking the modules, and there was missing the required module for this particular sensor. I found out this by rechecking what Andyroo was asking:

Code: Select all

root@raspberrypi:~# i2cdetect -l
i2c-1	i2c       	bcm2835 I2C adapter             	I2C adapter
And then when to

Code: Select all

root@raspberrypi:~# nano /etc/modules
And saw that i2c-bcm2835 was missing. Added it:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev
i2c-bcm2835
And

Code: Select all

root@raspberrypi:~# 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: -- -- -- -- -- -- -- 77 
So thanks all for the quick answers!!!

User avatar
bensimmo
Posts: 5246
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: I2C not recognizing BME280

Sat Dec 01, 2018 10:37 am

shouldn't that all have been sorted when you enabled it in Raspi-config.
I've never needed to alter modules for a long time for anything.

What OS are you using?
and from when ?

Latest Raspbian?

seabeam
Posts: 4
Joined: Fri Nov 30, 2018 7:54 pm

Re: I2C not recognizing BME280

Sat Dec 01, 2018 11:23 am

hi Benissimo,

Code: Select all

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
I have back stepped : removing the added module and the sensor is still being detected, the system works. Which makes me wonder what has really happened. I have rebooted the PI and it is still going good. I am running the PI through VNC from a ubuntu 14.04 computer.

Thanks all.

Return to “General discussion”