Two sensors on I2C bus, different voltages - How?

I'm constructing a weather logger/display system for my office so that we can check to see if the A?C is working. It's using an Arduino Nano as the base, and has a number of components hanging off it (temperature, humidity, pressure, etc), as well as a microSD breakout board and a DS1307 RTC.

I've had all of the individual parts of the circuit working in isolation and mostly together, and the last attempt had everything bar the BMP085 pressure sensor breakout board connected; I'd previously had that working on its own on my Uno board. The code compiles and looks ok, but I have run into a problem with the DS1307 and the BMP085 in that, whilst they both run on the I2C bus (not a problem), they use different supply voltages.

How can I get round this problem and connect both devices to the I2C bus? I am guessing that I can't connect +3.3 to the BMP085 and +5 to the DS1307..

The closest link to the DS1307 breakout that I can find is here: http://bluesmokelabs.com/kits/52-real-time-clock-rtc-kit.html I have asked for a more complete datasheet from the seller. The main datasheet for the Dallas IC is here: http://datasheets.maxim-ic.com/en/ds/DS1307.pdf

The BMP085 breakout I bought was this one (sorry for the eBay link) http://www.ebay.co.uk/itm/BMP085-Barometric-Pressure-Sensor-board-/260767108492?pt=Radio_Control_Vehicles&hash=item3cb6ee4d8c#ht_1074wt_907 and the datasheet is here: http://www.bosch-sensortec.com/content/language1/downloads/BMP085_DataSheet_Rev.1.0_01July2008.pdf

I've tried to find documentation on doing this, but no joy so far, so I figured that the forum would be a good place to ask. If anyone can help, I'd appreciate it.

The DS1307 supports 3.3v signals (a logical high is > 2.2V), so I would just pull the I2C bus to 3.3v. Since the Arduino is also 3.3v tolerant, that should work out. You'll still need to power 5v devices with 5v and 3.3v devices with 3.3v supplies.

Aeturnalus:
The DS1307 supports 3.3v signals (a logical high is > 2.2V), so I would just pull the I2C bus to 3.3v. Since the Arduino is also 3.3v tolerant, that should work out. You'll still need to power 5v devices with 5v and 3.3v devices with 3.3v supplies.

Not a perfect solution, as the Arduino wire library enables internal pull-up resistors on the IC2 clock and data lines to whatever Vcc the processor chip is running at.

Lefty

You can use a 4052 to switch the clock and data lines into the arduino. Switch these with a spare arduino output (or two).
Then disable the enabling of the pullups by editing the wire library, there is a single line that does this and it is commented so you can just comment out the line.
Then one the other side of the 4052 you can have pull ups to 5V and 3V3 on each of the four buses it gives you (although you only need two)

It's a shame parts like TI's TXS0104E don't come in a DIP package. They operate to 2 Mbps in an open-drain configuration and "just work". Maybe some supplier has one on a break-out board or if you are not afraid to solder one onto a SparkFun SOIC to DIP Adapter - 20-Pin - BOB-00495 - SparkFun Electronics you could use that.

You guys are going to hate me for saying this, but your are talking a different language... Is there any chance someone could post a circuit diagram of how to do this that I could use to try and get this straight in my head?

The talking of pulling the bus to 3.3v and then powering the DS1307 with 5v sounds what I need, but I could do with pointers. Idiot pointers.

Your best bet is to buy a logic level converter as they really do come in handy. You can purchase one from Sparkfun with the link above or I have this one available that uses the TXS0102 (as mentioned above) http://www.dsscircuits.com/i2c-level-converter.html and connect it between the Arduino and BMP085. Both sites listed should have sample wiring diagrams available. The DS1307 can connect directly to the Arduino.

Actually you can do it with just two mosfet transistors and four pull-up resistors. See fig. 1 in the linked application note. The 5v I2C devices wire to the 5volt side and the 3.3v devices to the well 3.3v side.

http://www.nxp.com/documents/application_note/AN10441.pdf

Lefty

You can use a sparkfun adapter if you want a pre-made solution:

Thanks guys! It looks like that DSScircuits LLC is the thing that I need (or the Sparkfun one), I just hope that I can get one from someone in the UK.

Really appreciate your help, and I will let you know how it turns out!

Edit

No sign of that one in the UK, looks like the Sparkfun one from Cool Components will be getting purchased. Let's hope it is simple enough for me to work with!

EmilyJane
I ordered the TXS0140E and soldered to the PCB adapter to make it a DIP chip, but it seems to be a brick no signal come across
Have you ever used it?
Thanks

Are you controlling the OE signal correctly?
Do you have a 0.1uF cap on the two Vcc lines?

This board from Adafruit will work.