Page 1 of 1

Using multiple I²C devices on one port

Posted: 21 Feb 2011, 23:54
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

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 00:58
by nxtreme
What you need is a multiplexer. Link 1 & Link 2.

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 02:11
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.

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 08:36
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

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 08:44
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?

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 08:53
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

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 09:00
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.

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 09:08
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)

Re: Using multiple I²C devices on one port

Posted: 22 Feb 2011, 09:13
by mattallen37
IC. Thanks for explaining it, it sounds interesting.