Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
3,510 Views

Grove I2C Color Sensor not detected

Hi All

I'm trying to connect a Grove I2C Color Sensor ( http://www.seeedstudio.com/wiki/index.php?title=Twig_-_I2C_Color_Sensor_v0.9b http://www.seeedstudio.com/wiki/index.php?title=Twig_-_I2C_Color_Sensor_v0.9b ) to an Intel Edison Board.

These is the suggested wiring I've followed (sensor to board):

VCC to 5V

GND to GND

SDA to SDA pin on Edison

SCl to SCL pin on Edison

I've also done setup of I2C Bus as described on edisonarduino_hg_331191007.pdf chapter 16.6

# echo 28 > /sys/class/gpio/export

# echo 27 > /sys/class/gpio/export

# echo 204 > /sys/class/gpio/export

# echo 205 > /sys/class/gpio/export

# echo 236 > /sys/class/gpio/export

# echo 237 > /sys/class/gpio/export

# echo 14 > /sys/class/gpio/export

# echo 165 > /sys/class/gpio/export

# echo 212 > /sys/class/gpio/export

# echo 213 > /sys/class/gpio/export

# echo 214 > /sys/class/gpio/export

# echo low > /sys/class/gpio/gpio214/direction

# echo high > /sys/class/gpio/gpio204/direction

# echo high > /sys/class/gpio/gpio205/direction

# echo in > /sys/class/gpio/gpio14/direction

# echo in > /sys/class/gpio/gpio165/direction

# echo low > /sys/class/gpio/gpio236/direction

# echo low > /sys/class/gpio/gpio237/direction

# echo in > /sys/class/gpio/gpio212/direction

# echo in > /sys/class/gpio/gpio213/direction

# echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

# echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

# echo high > /sys/class/gpio/gpio214/direction

I've checked voltage values on SDA and SCL: about 4,8 V (used a multimeter)

I supposed this was enough to see sensor working, but at the moment it seems there's somethign missing.

1) Tried i2cdetect -y -r 1 and i2cdetect -y -r 6 --> no device is detected

root@edison:~# i2cdetect -y -r 1

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- UU UU UU -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

root@edison:~# i2cdetect -y -r 6

0 1 2 3 4 5 6 7 8 9 a b c d e f

00: -- -- -- -- -- -- -- -- -- -- -- -- --

10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

70: -- -- -- -- -- -- -- --

2) tried also m2ctool (https://github.com/m2aglabs/m2ctool https://github.com/m2aglabs/m2ctool) --> no deivce detected

3) tried GroveColorSensorDemo from https://github.com/Seeed-Studio/Grove_I2C_Color_Sensor https://github.com/Seeed-Studio/Grove_I2C_Color_Sensor with Arduino IDE --> see no RGB values from sensor

4) tried Javascript sample from https://software.intel.com/en-us/iot/hardware/sensors/tcs3414cs-color-sensor https://software.intel.com/en-us/iot/hardware/sensors/tcs3414cs-color-sensor with Intel Iot XDK --> see no RGB values from sensor

5) tried I2CScanDevices.ino sketch from /thread/60144 https://communities.intel.com/thread/60144 on Arduino IDE --> No sensor detected at any address

I've tried also 1 to 5 after wiring sensor to Edison on A4 and A5 instead of SDA and SCL --> Again no effect

Some questions:

Is there someone who can tell me what I need to see Color Sensor correctly detected by Edison?

Is there someone who has succeded in connecting Grove I2C Color Sensor to Edison that could list actions taken?

Is there a way to check I2C bus is not damaged? Is there a way to re-initialise I2C in case it is stuck for any reason?

Thanks

Regards

Marco

Tags (1)
0 Kudos
18 Replies
Highlighted
Community Manager
18 Views

Hi marco,

Could you please try entering the following instructions to configure the I2C interface? Lines 15 and 16 are not present on the Hardware Guide, but once I was able to solve the issue by adding these two lines so this might work for you too.

echo 28 > /sys/class/poi/export

 

echo 27 > /sys/class/poi/export

 

echo 204 > /sys/class/poi/export

 

echo 205 > /sys/class/poi/export

 

echo 236 > /sys/class/poi/export

 

echo 237 > /sys/class/poi/export

 

echo 14 > /sys/class/poi/export

 

echo 165 > /sys/class/poi/export

 

echo 212 > /sys/class/poi/export

 

echo 213 > /sys/class/poi/export

 

echo 214 > /sys/class/poi/export

 

echo low > /sys/class/poi/gpio214/direction

 

echo high > /sys/class/poi/gpio204/direction

 

echo high > /sys/class/poi/gpio205/direction

 

echo 0 > /sys/class/poi/gpio204/value

 

echo 0 > /sys/class/poi/gpio205/value

 

echo in > /sys/class/poi/gpio14/direction

 

echo in > /sys/class/poi/gpio165/direction

 

echo low > /sys/class/poi/gpio236/direction

 

echo low > /sys/class/poi/gpio237/direction

 

echo in > /sys/class/poi/gpio212/direction

 

echo in > /sys/class/poi/gpio213/direction

 

echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

 

echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

 

echo high > /sys/class/gpio/gpio214/direction

Run i2cdetect once more to check if there's anything different and let us know your results.

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Thanks a lot Pablo.

Unfortunately now will take few days for me to test your solution.

I'll get back to you as soon I've tested

Regards

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

That's ok! Let us know once you're ready to give it a try.

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Dear Pablo

image version on my Edison is 159.devkit. Paths like

"/sys/class/poi/"

are not available.

I've changed the script you sent to:

echo 28 > /sys/class/gpio/export

echo 27 > /sys/class/gpio/export

echo 204 > /sys/class/gpio/export

echo 205 > /sys/class/gpio/export

echo 236 > /sys/class/gpio/export

echo 237 > /sys/class/gpio/export

echo 14 > /sys/class/gpio/export

echo 165 > /sys/class/gpio/export

echo 212 > /sys/class/gpio/export

echo 213 > /sys/class/gpio/export

echo 214 > /sys/class/gpio/export

echo low > /sys/class/gpio/gpio214/direction

echo high > /sys/class/gpio/gpio204/direction

echo high > /sys/class/gpio/gpio205/direction

echo 0 > /sys/class/gpio/gpio204/value

echo 0 > /sys/class/gpio/gpio205/value

echo in > /sys/class/gpio/gpio14/direction

echo in > /sys/class/gpio/gpio165/direction

echo low > /sys/class/gpio/gpio236/direction

echo low > /sys/class/gpio/gpio237/direction

echo in > /sys/class/gpio/gpio212/direction

echo in > /sys/class/gpio/gpio213/direction

echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

echo high > /sys/class/gpio/gpio214/direction

but no effect:

-still no device found with i2cdetect -y -r 1 or i2cdetect -y -r 6 with both connection to A4/A5 or SDA/SCL

-still no rgb values with arduino sketch or JS sample on Intel Iot XDK

Sensor seems alive (voltage on sda/scl pins, led light is on)

Any other suggestion? Please advise.

Thanks

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

We are still investigating your case, as soon as we have an answer we will let you know. We appreciate your patience in the meantime.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Meanwhile, let me update you with the latest test I've made:

-I've tried test tools found in https://github.com/fivdi/edison-i2c-config https://github.com/fivdi/edison-i2c-config and https://github.com/fivdi/i2c-bus https://github.com/fivdi/i2c-bus:

I2C on Eidson board seems fine, but anyway Grove I2C Color Sensor is not detected. Perhaps there's something wrong in wiring/voltage levels on pins?

While waiting for your precious hints

Regards

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

We don't have the sensor in our laboratory so we will order it and will do some testing so this might take some time. Also, not all I2C devices are compatible with the Edison, hopefully this won't be the case for this one, but it is something to take into account.

 

Thank you for your patience.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Dear Pablo,

to ensure compatibility with Edison I've checked the sensor on the Intel link https://software.intel.com/en-us/iot/hardware/sensors/tcs3414cs-color-sensor https://software.intel.com/en-us/iot/hardware/sensors/tcs3414cs-color-sensor

Anyway, If some particular wiring must be made around the sensor (pull up resistors, adjust In/out voltage levels) in order to make it compatible with Edison, just send me the info and I'll provide it.

While waiting for your feddback

Thanks and Regards

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

Thank you for your patience on this case.

 

Sensor has arrived and after some testing we found out that the i2c color sensor works with 3.3V, Edison can detect the 0x39 address on bus 6. So we would suggest you to please try 3.3V instead of 5V, hopefully that should solve the issue.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Thank you so much Pablo.

Do you mean I have to change position to some jumper (perhaps IOREF J9 ?) on the board? Or simply I have to connect the vcc pin of the sensor to the 3.3V power on the board?

Could you explain a bit more wiring&setup?

Thanks again

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

We used your configuration, just make sure to use A4 and A5 of the Edison Arduino board, I guess that's what you meant by SDL and SDA from the Edison. And we just provided 3.3V from the Edison to the sensor. So, go on and configure the I2C using the Edison Hardware Guide and then use the A4 and A5 from the board, as stated in the document.

 

 

Regards.

 

-Pablo
0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

Do you have updates on this case?

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Novice
18 Views

Sorry for the delay Pablo.

Unfortunately, even after:

i2c configuration according to edison hardware guide (specified above in this thread) and

having set sensor supply to 3.3V

I have the same result:

sensor is not detected with i2cdetect -y -r 6 and

weird result on arduino sketch and intel xdk sample script

(I'm beginnig to think that maybe my sensor got some defect)

Thanks

Regards

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi marco,

 

 

It would be a good idea to test the sensor on a different device, just to see if you get the same behavior. That way you'll know if the sensor is indeed defective.

 

 

Regards,

 

-Pablo
0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

Do you have updates on this case?

 

 

Regards,

 

Pablo
0 Kudos
Highlighted
Novice
18 Views

Hello Pablo,

unfortunately I have not another board to check the sensor. Is there any other test that might be done on the sensor to ensure if it is good or not?

Thanks

Marco

0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

I'm not aware of any other way to test it, so I won't be able to help you with that. However, I would like you to do just one more thing in case you haven't. When configuring the GPIOs to work with I2C, did you make sure that the changes where taking place? If possible, I would like you to run the cat command on these pins just to make sure that the direction is actually changing.

 

Let me know if you need some clarification.

Regards,

 

-Pablo
0 Kudos
Highlighted
Community Manager
18 Views

Hi Marco,

 

 

Have you been able to check what I told you last time? Did you make sure the changes took place?

 

 

Regards,

 

-Pablo
0 Kudos