Multiple Non-addressable I2C devices alternatively powered by IO pins

Hi,

I have a couple of I2C sensors which have fixed address. I want to be able to connect to both of them with arduino and read data almost simultaneously. So, I was thinking to power them alternatively by supplying power from different I/O pins by alternating them using digitalWrite.

Will it work?

I/O pins can only provide a max of 40mA and 20mA would be more sensible. You will probably need to put a transistor between the I/O pins and the I2C devices.

…R

Or use an I2C mux and leave both powered up.

As above. I made a circuit that used two oled i2c screens in the same way. I just used a CD 4053 chip. Surprisingly simple.

Jason.

In my case the sensor's current requirement is extremely low. It is only few uA. So no problem of driving current. It is way below 20mA.

Since I have a 3.3V based sensors I am unable to verify this myself with Uno. (waiting for my pro-mini to arrive). Can anyone confirm if it works without any additional circuitry?

Hi,

I have a couple of I2C sensors which have fixed address.

Ahhh yes,, fixed addresses so what.. or is it that they have the same ID?

Check this link;

http://blogs.msdn.com/b/laurelle/archive/2012/02/24/using-2-identical-i2c-device-on-the-same-i2c-bus.aspx or this

http://forum.arduino.cc/index.php?topic=305921.0 Tom.... :) What are the sensors?

If you can power down the I2c device that's not being used, then I would guess that would work. But is there a power up or warm up time involved for your sensors?

In my case. I was using two displays were on the same i2c address and I couldn't really power down the alternate display. Otherwise, they will flash. Quite undesirable.

http://forum.arduino.cc/index.php?topic=293613.0

This worked for my situation.

Jason.

I am surprised nobody tried this before!!!

@TomGeorge! I am using HM5883L magnetometers whose power requirement is very low. So using transistors/MOSFETs for driving them is overkill. But in theory, switching on one power supply while keeping the other one off should work right? But I am only bothered about any practical detail that I missed...

@retrofiesta I am not sure if they have some warm up time. Even if there is I don't mind waiting for a few ms or even a full second to get the data. I feel I2C multiplexer is an additional unnecessary component in my case!

What are the thoughts?

What are the thoughts?

The thoughts are that they are both wrong. An unpowered device looks like a diode to ground therefore one unpowered device on an I2C bus will stop the bus from working as the other device could never then see a logic one.