Using multiple I²C devices on one port

Discussion specific to the intelligent brick, sensors, motors, and more.
Post Reply
madscripter
Posts: 7
Joined: 19 Feb 2011, 15:56
Location: Germany

Using multiple I²C devices on one port

Post by madscripter »

Hi,
as I ran out of ports on one of my prjojects und i dont have the money to buy a second NXT I was thinking of just connecting them to one port.
Is this possible?
i was espicially worrying about the power supply and wondering if I could just unse batterys for this purpose

Julian
Julian
nxtreme
Posts: 246
Joined: 29 Sep 2010, 03:53
Location: 192.168.1.2

Re: Using multiple I²C devices on one port

Post by nxtreme »

What you need is a multiplexer. Link 1 & Link 2.
One King to rule them all, One King to find them,
One King to bring them all and in the darkness bind them
On Earth where Shadows lie.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using multiple I²C devices on one port

Post by mattallen37 »

madscripter wrote:Hi,
as I ran out of ports on one of my prjojects und i dont have the money to buy a second NXT I was thinking of just connecting them to one port.
Is this possible?
i was espicially worrying about the power supply and wondering if I could just unse batterys for this purpose

Julian
If they have different addresses, then yes, but most of the HT I2C sensors are the same as the ultrasonic sensor (0x02). Each one MUST have a different address. Most of the I2C mindsensors products have a default address of 0x02 as well, but you can change it (unlike the HT and lego sensors). If they do have different addresses, then the cheap Port Splitter that nxtreme mentioned will work, but If they don't have different addresses, then you need to use the HiTechnic Sensor Multiplexer that nxtreme also mentioned.

Unless I was really tight on space, I don't think I would buy the HT sensor multiplexer. It costs almost as much as you can get an NXT for, and an extra NXT would also be able to run another 3 motors, and be "smart" (do some of the processing).

As far as power, it depends on the sensors you are using. The NXT can supply about 180ma (4.3-4.7v), but it is shared by all four sensor ports, as well as the motor ports (to power the encoders). As long as you don't pull too much, it should be fine without an extra supply.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
madscripter
Posts: 7
Joined: 19 Feb 2011, 15:56
Location: Germany

Re: Using multiple I²C devices on one port

Post by madscripter »

first of all:
thank you for this fast and great support :D
this is a great forum ;)
i wanted to use a HT IR seeker V2 which luckily has the adress 0x10 and a HT compass sensor (with standart adress)
and i dont think they need too much power as this is the only port I am using with more than one I²C device.
I have now ordered chaep splitter and will try it when it arrives.

Julian
Julian
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using multiple I²C devices on one port

Post by mattallen37 »

Sounds good. Yes, fortunately, HT gave one of their sensors a different address.

Just one thing, the 180ma supply needs to be shared among all ports. For example, if you have a 150ma load on one port, and a 20ma load on another, there is only 10ma left for all 5 other ports to use. This power "limitation" is not something you really need to worry about much, as most sensors only use a few ma each.

BTW, what other sensors are you using, and what is this robot for?
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Using multiple I²C devices on one port

Post by mightor »

The HT sensors cannot have their pull-ups disabled, which may or may not give you issues. You will end up with 2 pull-ups on each line when only one is allowed. You're effectively halving your pull-up resistance.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using multiple I²C devices on one port

Post by mattallen37 »

You do have a point Xander, but I have used 10k pullups with no issues, so 41k should be okay. I have also seen three mindsensors' I2C devices all on one bus with no errors (each obviously had 82k pullups). The worst that could happen, is the sensor(s) won't see an NXT signal (low) causing it to just not work.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
madscripter
Posts: 7
Joined: 19 Feb 2011, 15:56
Location: Germany

Re: Using multiple I²C devices on one port

Post by madscripter »

i am trying to build a soccer bot for the robocup
On S1 I have IRSeeker and compass
S2: is an USsensor (to notice if a wal is reached)
S3 is a colorsensor combined with a laserpointer to find out if the ball is directly in front of the robot
S4 will be used as a motor control for the backspinn (could look a bit like this http://www.youtube.com/watch?v=VtBDwqBpyhs)
(though i am having problems with that one)

I am using 2 motor ports as nomal wheels and one as a kicker

the problem is that everything has to fit on a circle with the diameter 22cm and can only be 22cm high(rules)
Julian
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Using multiple I²C devices on one port

Post by mattallen37 »

IC. Thanks for explaining it, it sounds interesting.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests