Connect 2x VNCL4010 with the TCA9548A. Need a helpful hand.

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Connect 2x VNCL4010 with the TCA9548A. Need a helpful hand.

Post by Arbru »

Dear all,

Have anyone tried this build? I'm using Raspi 2 using the I2C connection.

The I2C bus seems to be working correctly, but I wanted to read the data from the 4010 sensors.

pi@raspi2 ~ $ sudo 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: 70 -- -- -- -- -- -- --

I'm not sure if I had to see the 2 multiplexed 4010 or just the mux (0x70).

Anyone have a Python script for that? I just found one for Arduino.

Thanks!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by adafruit_support_mike »

The TCA9548 defaults to having all the multiplexed connections shut off. You'll need to set its internal switches before you get a response from a specific VNCL4010.

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

I understand what you said, but not sure how to setup this. I Attached an image of the connections I've done. I'm probably missing a connection, or this reset is done via software?
connection_VNCL4010_MUX.jpg
connection_VNCL4010_MUX.jpg (46.11 KiB) Viewed 655 times
Best regads,

Arbru

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by adafruit_support_mike »

Send the TCA9548 a command packet telling it to use channel 1, then try running i2cdetect again.

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

I'm not much confident I understood what you want me to do.

Code: Select all

pi@raspi2 ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C $ sudo i2cset -y 1 0x70 0x00 0x02
pi@raspi2 ~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_I2C $ 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: 70 -- -- -- -- -- -- --                         

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

Reading TI docs for the TCA9548A, it says I should be connecting the RST to the 5V via a resistor (like a 10k) and ground A0, A1 and A2.

Perhaps my setup is not correct?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by adafruit_support_mike »

You've done it correctly. The second run of i2cdetect shows a device responding to address 0x13, and that's the VNCL4010's address.

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

Does anyone have ported the library on github from C to Python? I'm not really understanding how to read the value from the sensors, and where to get them, as they use different registers.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by adafruit_support_mike »

I don't know of any Python libraries for the VNCL4010.

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

So how can I get the results from the sensor? Can you give me some advice?

Code: Select all

pi@raspi2 ~ $ sudo i2cget -y 1 0x13 0x85 w
0x0000
pi@raspi2 ~ $ sudo i2cget -y 1 0x13 0x81 w
0x0021
pi@raspi2 ~ $ sudo i2cget -y 1 0x13 0x82 w
0x0200
pi@raspi2 ~ $ sudo i2cget -y 1 0x13 0x83 w
0x1d02
pi@raspi2 ~ $ sudo i2cget -y 1 0x13 0x84 w
0x001d
I'm not quite sure where to read the data from. I'm interested on the proximity sensor data.

User avatar
Arbru
 
Posts: 12
Joined: Wed Nov 25, 2015 2:44 pm

Re: Connect 2x VNCL4010 with the TCA9548A. Need a helpful ha

Post by Arbru »

Hi Mike,

As you've noticed, I'm quite new to this. I was reading the Vishay documentation. They have some examples on the Register Settings. But I'm not sure how to get the data I need from the proximity sensor, as written on page 17.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”