1

When I run this (sudo i2cdetect -y 1):

I get:

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

Can anyone tell me if 0x13 is the right address?

I'm getting an error when trying to interact with VCNL4000 sensor.

UPDATE:

#!/usr/bin/python

from VCNL4000 import VCNL4000
import time

# ===========================================================================
# Example Code
# ===========================================================================

# Initialise the VNCL4000 sensor
vcnl = VCNL4000(0x13)

# Print proximity sensor data every 100 ms
while True:

    print "Data from proximity sensor", vcnl.read_proximity()
    time.sleep(0.1)

CPU info:

Processor   : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS    : 697.95
Features    : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xb76
CPU revision    : 7

Hardware    : BCM2708
Revision    : 000e
Serial      : 000000007b9b5e3c

/etc/modprobe.d/raspi-blacklist.conf content:

# blacklist spi and i2c by default (many users don't need them)

#blacklist spi-bcm2708
#blacklist i2c-bcm2708
8
  • How are you truing to interact with your sensor? Commented Jul 14, 2013 at 18:20
  • @KrzysztofAdamski: Updated my question
    – el.severo
    Commented Jul 14, 2013 at 20:12
  • 1
    could you please also show us your /proc/cpuinfo ? Commented Jul 15, 2013 at 5:07
  • @KrzysztofAdamski: Sure, updated the question. Thanks!
    – el.severo
    Commented Jul 15, 2013 at 16:50
  • Everything is correct. Do you run your script with sudo? Commented Jul 15, 2013 at 17:41

1 Answer 1

1

Here are the things to check:

  1. If you can communicate with the device. You should take a look at the datasheet (section REGISTER FUNCTIONS) for the register numbers. VCNL4000 uses 0x81 register as a Product ID Revision register. You can check it's content with command sudo i2cget -y 1 0x13 0x81. 1 is your bus number 0x13 is the device address, 0x81 is the register address. According to datasheet, this command should print 0x11. If you get this, then the communication with the device is fine.
  2. If your script/library uses proper bus number. For revision 2 of model B it should be 1 while for revision 1 it should be 0. This is why I asked for /proc/cpuinfo content in the commends. The version of the library I found here uses revision number to automatically select proper bus number but the one you can find here seems to be the older version without such checks (by default it uses bus number 0 so it's not the proper bus for your revision).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.