Is it possible to use multiple I2C sensors with Arduino without an I2C multiplexer?

I have an IMU sensor and a Bluerobotics temperature sensor, both have different I2C addresses.

I want to integrate both with an Arduino UNO, I know I can do this with an I2C multiplexer but I don't have access to one right now.

Is it possible to integrate them with arduino without a multiplexer, i.e., by just connecting them parallelly on the A4 and A5 pins of Arduino? (This didn't work though when I tried, the temperature sensor was giving values but the values of IMU sensor were only zeros on the Arduino Serial Monitor)

That's the whole idea of I2C as a bus.

edit: did the IMU give the right values when connected alone?

Yes.

As long as both I2C devices have unique addresses they will work when connected in parallel.

Sense you are having some issues I would run the Arduino I2C scanner. It should be in the IDE examples. When run on the processor it looks at each possible I2C address to see if a device responds.

In your situation the scanner should report the the I2C address for each sensor. If not there is some other issue. If so you should check your sensor reading software.

Hi, @ssmalik
Welcome to the forum.

If the devices have different addresses, then you can run both on the same I2C bus lines.

The library or setup for them will use their individual addresses to communicate with each as required.

If you Google;

arduino two devices on I2C bus

There is quite a bit of information.

Tom... :smiley: :+1: :coffee: :australia:

Could be an issue with the pullup resistors?

If the sensors you have are modules as opposed to "bare" sensors, they will probably each have sda and scl pullups on their boards so that they can operate alone. Then when you have various boards hooked up together, you have duplicate pullups in parallel and the resulting value may not be suitable.

1 Like

(post deleted by author)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.