How to detect and use grove devices on BBG?

Hi,

I am trying to hook up some grove sensors and use them from Python. However, I do not know the I2C address of any sensor. The addresses are not written on the sensor boards as usually and wiki is lacking.

At this moment, grove relay is connected to UART port (which is configured to become I2C) and on BBG I2C port a grove light sensor is connected. OS is up to date and there are no other devices connected.

i2cdetect returns nothing.

i2cdetect -y -r 0 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

i2cdetect -y -r 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --

However, this code works:

[code]import time
import Adafruit_BBIO.GPIO as GPIO

Note: Use P9_22(UART2_RXD) as GPIO.

Connect the Grove Relay to UART Grove port of Beaglebone Green.

RELAY = “P9_22” # GPIO P9_22
GPIO.setup(RELAY, GPIO.OUT)

GPIO.output(RELAY, GPIO.LOW)
time.sleep(4)
GPIO.output(RELAY, GPIO.HIGH)[/code]

How come Python can communicate with relay but the i2cdetect does not see it? Also, the example using grove button on UART port also uses GPIO P9_22 address. Is this port hardcoded to only one device?

Thanks.

Hello,

Here is the explanation for your question

  1. BBG has two I2C: I2C0 and I2C1.
    I2C0 is not pulled out as it’s connected to EEPROM(0x50) and PMU(0x24). The first picture actually shows I2C0 address.

bbg1.jpg

I2C1 has two functions:
① Peripheral Device. See the I2C Grove Port.
② Cape for BBG. Cape requires EEPROM with limited address from 0x54 to 0x57. So only max to FOUR capes can be connected.
The second picture indicates its address.bbg2.jpg

In addition, Grove_-_Light_Sensor is a GPIO sensor. It cannot be detected as I2C address.
Before connecting Grove Button to UART Port, UART should be set as GPIO.
Here is the instruction: seeedstudio.com/recipe/362-h … n-bbg.html

Thanks and Regards