GeorgeChin1
Posts: 5
Joined: Sat Dec 07, 2019 6:22 pm

Device not detected using i2c-detect y 1

Sat Dec 07, 2019 6:42 pm

I have a BME280 wired as shown in the picture below to a RaspberryPi 3b. When I run i2cdetect I expect to see an address, however it is not being detected. With the sensor unplugged, the voltage measurement is 3.36v. When wired as shown below the voltage is 0.57v Have I wired the set-up incorrectly or is my board defective?

Pi Side
Red Wire: 3.3v
Yellow Wire: SDA
Orange Wire: SCL1
Green Wire: Ground

BME280 Break Board Side
Red Wire: Vin
Yellow Wire: SDI
Orange Wire: SCK
Green Wire: GND


pi@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: -- -- -- -- -- -- -- --
20191207_101154.jpg
20191207_101154.jpg (32.54 KiB) Viewed 921 times
20191207_101016.jpg
20191207_101016.jpg (39.37 KiB) Viewed 921 times

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5906
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Device not detected using i2c-detect y 1

Sat Dec 07, 2019 9:26 pm

From your photo's you appear to also have a connection to the CS pin on the BME280 (Red wire ). If I'm interpreting Adafruit's BME280 Pinouts ( https://learn.adafruit.com/adafruit-bme ... ut/pinouts ) data correctly for I2C use that pin should not be connected. Since both the Pi and the BME280 also support a SPI interface it may be worth trying that instead of I2C (connection info. at the linked page above). Since I don't have a BME280 I can't test either method myself.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

GeorgeChin1
Posts: 5
Joined: Sat Dec 07, 2019 6:22 pm

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 12:52 am

Thanks for replying,

I was following the instructions from
https://learn.adafruit.com/adafruit-bme ... ython-test
Since I wasn't having any luck with I2C I attempted to use SPI as you recommended.

When running the following code from the tutorial in the link above I get the error:
RuntimeError: Failed to find BME280! Chip ID 0xff

Below is the python code I used
import board
import busio
import digitalio
import adafruit_bme280
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5)
bme280 = adafruit_bme280.Adafruit_BME280_SPI(spi, cs)

The thing that bothers me is that measuring from the 3.3v pin to ground should return around 3.3v even if the sensor is attached. I am thinking there might be a short in the breakout board.
Attachments
20191207_162905.jpg
SPI setup
20191207_162905.jpg (34.23 KiB) Viewed 875 times
20191207_162913.jpg
SPI setup
20191207_162913.jpg (41.23 KiB) Viewed 875 times
adafruit_products_rpi_bme280_i2c.png
I2C Setup From Tutorial
adafruit_products_rpi_bme280_i2c.png (117.64 KiB) Viewed 875 times

User avatar
Gavinmc42
Posts: 4843
Joined: Wed Aug 28, 2013 3:31 am

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 1:36 am

The wiring looked correct for i2c.
You have enabled i2c in raspi-config?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4843
Joined: Wed Aug 28, 2013 3:31 am

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 1:41 am

Check and see if there is a file /dev/i2c-1
If it is not enable it will not be there.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

GeorgeChin1
Posts: 5
Joined: Sat Dec 07, 2019 6:22 pm

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 6:00 am

Yes the file is present.

User avatar
Gavinmc42
Posts: 4843
Joined: Wed Aug 28, 2013 3:31 am

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 7:45 am

I usually have bunch of i2c units and even have a USB based i2c tester I use on Windows.
If i2c-detect is not working I have a PC test unit and also PI testing using baremetal with Ultibo.
If these don't detect the i2c uni then it is usually a wiring/datasheet misread.

Do you have any other i2c devices you can test to see if your OS is ok?
I use temperature sensors as my basic i2c test units.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 8:27 am

If you have a ribbon cable between the Pi and breadboard it may be inserted the wrong way around at one end.

sparkyhall
Posts: 168
Joined: Mon Aug 27, 2012 9:14 am

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 8:29 am

GeorgeChin1 wrote:
Sat Dec 07, 2019 6:42 pm
With the sensor unplugged, the voltage measurement is 3.36v. When wired as shown below the voltage is 0.57v
It's not going to work if the 3V3 measures 0.57V at the BME280, this is the area we need to focus on.

What supplies the 3V3, is the Raspberry Pi or something else?

What happens to the Raspberry Pi when the BME280 is connected, does it still function correctly or does it fail to boot?

User avatar
davidcoton
Posts: 5503
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 11:45 am

Check Joan's idea first. Unplug everything except the cobbler from the breakout board. Check the voltages (pins 1, 2, 4, 6 etc) with reference to the metal shell of one of the Pi's connectors (USB, HDMI, etc). Get that right before reconnecting and testing anything else (if it is wrong, connecting things to the breakout board risks breaking your Pi).
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
Gavinmc42
Posts: 4843
Joined: Wed Aug 28, 2013 3:31 am

Re: Device not detected using i2c-detect y 1

Sun Dec 08, 2019 11:49 am

You have Vin on 3V3?
That circuit is designed for 5 and 3V3 operation, those always confuse me.
Putting 5V Arduino stuff on 3v3 Pi's.
Looks like there is a 5 to 3V3 regulator on Vin.
And it looks like 3V comes out the 3VO pin

A circuit shows when used on a 3V Feather CS is connected to 3V3 on Vin.
Logic level shifting to Vin voltage.
Page 18 shows the Pi connection, it should just work.
At this point I usually drag out a multimeter and cro.
If the Pi voltage drops then it sound like short.

Try powering it up with multimeter measuring the current.
Just connect Vin and Gnd to power, current limited power supplies are useful here.
If it draws lot of current the smokes has got out.
Not sure of the exact power it needs but probably less than 20ma.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

GeorgeChin1
Posts: 5
Joined: Sat Dec 07, 2019 6:22 pm

Re: Device not detected using i2c-detect y 1

Mon Dec 16, 2019 5:30 am

sparkyhall wrote:
Sun Dec 08, 2019 8:29 am
What supplies the 3V3, is the Raspberry Pi or something else?
The 3v3 is supplied by the Raspberry Pi
sparkyhall wrote:
Sun Dec 08, 2019 8:29 am
What happens to the Raspberry Pi when the BME280 is connected, does it still function correctly or does it fail to boot?
It boots properly I and I am communicating with it through ssh
joan wrote:
Sun Dec 08, 2019 8:27 am
If you have a ribbon cable between the Pi and breadboard it may be inserted the wrong way around at one end.
Below are the voltages I measured:
3V3 pin to HDMI_metal shell = 3.3V
3v3 pin to Gnd = -1.79
5v0 pin to HDMI_metal shell = 0v
5v0 pin to Gnd = 5v


I am pretty sure it is my 3v3 source.
When I connect a LED and resistor between 3.3v and ground the LED doesn't light. When I place the resistor between 5.0v and ground the LED does light up.

Thank you guys for all your help

sparkyhall
Posts: 168
Joined: Mon Aug 27, 2012 9:14 am

Re: Device not detected using i2c-detect y 1

Mon Dec 16, 2019 9:03 pm

3V3 pin to HDMI_metal shell = 3.3V is Correct
3v3 pin to Gnd = -1.79 suggests that your gnd is connected to 5V
5v0 pin to HDMI_metal shell = 0v suggests that your gnd is connected to 5V
5v0 pin to Gnd = 5v is correct and contradicts the readings above?

It think it is time to check the continuity between your Pi and your GPIO breakout board.

With your Pi disconnected from everything apart from your GPIO breakout board, use a multi-meter set to continuity or low resistance to measure between the breakout board gnd and the shell of the HDMI connector. You are looking for a reading of < 0.5. Test both polarities i.e your red lead to HDMI shell and black to gnd, then black to HDMI shell and red to gnd. If you get a reading of <0.5 test the 5V and 3V3 connection.

Post the results here.

GeorgeChin1
Posts: 5
Joined: Sat Dec 07, 2019 6:22 pm

Re: Device not detected using i2c-detect y 1

Mon Dec 23, 2019 7:32 am

Hello

My previous post was measured with only the breakout board connected. The results were
3V3 pin to HDMI_metal shell = 3.3V
3v3 pin to Gnd = -1.79
5v0 pin to HDMI_metal shell = 0v
5v0 pin to Gnd = 5v

I decided to measure the voltage without the break board attached.
3v3 to HDMI_metal shell = 3.30v
3v3 pin to Gnd = 3.30v
5v0 to HDMI_metal shell = 5.08v
5v to Gnd = 5.08v

I connected a different sensor and I was able to get i2c detect.

Thanks for all your help.

Return to “General discussion”