Electronic – Arduino I2C and multiple devices

arduinoi2crtc

I have created two projects, one with a Tiny RTC and another one with the BM180 sensor to read barometric pressure and temperature. Now I want to combine both.

I'm trying to connect both – the BM180 sensor and a TinyRTC clock module via. the I2C pins to my Arduino Uno (r3) and because I'm just a beginner I have some problems.

The BM180 works with 3.3V, but the TinyRTC is on 5V. Can I just connect all the SDA together and all the SCL together?

Best Answer

The DS1307 used in the TinyRTC is not designed to run at 3.3V. It will go into backup mode, only keeping time. But it has a Voltage Input High minimum of 2V. As I2C is a open collector bus, where a device only pulls the line low, and then releases it so the pull-up resistors bring it high, this can be done simply by making sure the pull-ups are connected to the right voltage. Since the BM180 can only run at 3.3V, that sets the required i2c voltage.

Power the TinyRTC at 5V, and the BM180 at 3.3V. Simply remove or cut the i2c pull-ups on the TinyRTC module. If your BM180 is a module with pull-ups to 3.3V, then you are done. If not, use two pull-up resistors (4.7k is average) to a 3.3V source. Then the rest depends on your code.