Connect two I2C devices to Mega 2560

Hello,
I'm new in this forum and I had a new project, but for this I need twi I2C devices, can I connect them both at the same time to my Arduino mega and use them simultaneously.
And if this is possible how can I realize it?

The Arduino Mega 2560 has a 5V I2C bus.
You can connect a number of I2C devices to that bus, as long as those devices can handle a 5V I2C bus.

For example the BMP085 sensor can handle only a 3.3V I2C bus.

The I2C bus is a 'bus'. Connect all the SDA together and all the SCL together. In the sketch (the software) you can select a device because every device has its own I2C address on that bus.

Run to i2c_scanner to see if your wiring is okay, it will scan all the devices on the bus.
http://playground.arduino.cc/Main/I2cScanner

The devices can be scanned as above, but the addresses are type-specific, so you don't have to change them for individual items, i.e. all DS1307 will work with 0x68. The following code show different ways of expressing the address. You will see this in the example codes for the devices.

#define DS1307_ADDRESS 0x68
LiquidCrystal_I2C lcd(0x27,20,4);

Okay, thank you very much!! :slight_smile:
So does this mean I can connect as much devices as I want to the two pins as long as they have different adresses?

Essentially yes, but there is probably a sensible limit that you are not likely to reach.

Does even one 3.3V device and one 5V device work?

The Arduino Uno has not a full 5V I2C bus, and allows that 3.3V modules can be connected.
The Arduino Mega 2560 has onboard 10k pull-up resistors for the I2C bus, so you can not connect 3.3V I2C sensors to it.
You can use a level shifter for that.

Can you tell (copy a link to it in the text) which 3.3V device you have ?

I want to connect a TEA5767 FM receiver.
Like this one: http://www.ebay.de/itm/360828995394
And the other device is a ds1307 real time clock device.

The DS1307 is a 5V device, and the TEA5767 is allowed to be used at 5V.
So you power them both with 5V, and GND, and connect them both to the same SDA and both to the same SCL line.