Is it possible to hook up multiple accessories that require the i2c pins?

I'm attempting to hook up both a second arduino and a sensor that requires i2c connection to my arduino Uno. I am able to get them run by themselves, but as soon as both are installed, the program hangs when it reaches out to either device. Any tips?

Are both devices using an open collector type output? you should post your code and a link to info about the devices in question.

Sensor link: https://www.sparkfun.com/products/11859. Up until the config_TMP006() method on which it hangs:

#include <SPI.h>
#include <SD.h>
#include <stdint.h>
#include <math.h>
#include <Wire.h>
#include "I2C_16.h"
#include "TMP006.h"
Sd2Card card;
SdVolume volume;
SdFile root;
File userFile;

uint8_t sensor1 = 0x40; // I2C address of TMP006, can be 0x40-0x47
uint16_t samples = 4; // # of samples per reading, can be 1/2/4/8/16
int wait = 15;
int sensorValue;
int sound[5];
int temp[5];
boolean go = true;
String userInput;
boolean pool;

int delay3 = 0;
int delay4 = 0;
int delay5 = 0;
int delay6 = 0;
int delay7 = 0;
int delay8 = 0;
float count;
float seconds;

void setup()
{
  Serial.begin(9600);
  pinMode(10, OUTPUT);
  digitalWrite(10, HIGH);
  Serial.println("Searching for SD Card...");
  if (!SD.begin(10)) {
    Serial.println("Cannot find SD card.");
    return;
  }
  Serial.println("SD Card found.");
  while (!Serial) {                                                      // Open serial communications and wait for port to open:
    ;
    delay(100);
  }
  Serial.println("Initializing SD card...");
  if (!card.init(SPI_HALF_SPEED, 10)) {                                  //***10 used to be: chipSelect***
    Serial.println("initialization failed.");
    go = false;
    return;
  }
  else {
    Serial.println("Card Initialized");
  }
  int sensor_temp = readDieTempC(sensor1);
  config_TMP006(sensor1, samples);                                    //*****hangs here*****
}

TMP006 (sensor) Library:

// Configures sensor, use before reading from it
void config_TMP006(uint8_t addr, uint16_t samples)
{
  Wire.begin();
  write16(addr, TMP006_CONFIG, samples | TMP006_CFG_MODEON | TMP006_CFG_DRDYEN);
}

// Read raw sensor temperature
int16_t readRawDieTemperature(uint8_t addr)
{
  int16_t raw = read16(addr, TMP006_TAMB);

  raw >>= 2;
  return raw;
}

// Read raw thermopile voltage
int16_t readRawVoltage(uint8_t addr) 
{
  int16_t raw = read16(addr, TMP006_VOBJ);
  return raw;
}

// Calculate object temperature based on raw sensor temp and thermopile voltage
double readObjTempC(uint8_t addr) 
{
  double Tdie = readRawDieTemperature(addr);
  double Vobj = readRawVoltage(addr);
  Vobj *= 156.25;  // 156.25 nV per LSB
  Vobj /= 1000000000; // nV -> V
  Tdie *= 0.03125; // convert to celsius
  Tdie += 273.15; // convert to kelvin

  // Equations for calculating temperature found in section 5.1 in the user guide
  double tdie_tref = Tdie - TMP006_TREF;
  double S = (1 + TMP006_A1*tdie_tref + 
      TMP006_A2*tdie_tref*tdie_tref);
  S *= TMP006_S0;
  S /= 10000000;
  S /= 10000000;

  double Vos = TMP006_B0 + TMP006_B1*tdie_tref + 
    TMP006_B2*tdie_tref*tdie_tref;

  double fVobj = (Vobj - Vos) + TMP006_C2*(Vobj-Vos)*(Vobj-Vos);

  double Tobj = sqrt(sqrt(Tdie * Tdie * Tdie * Tdie + fVobj/S));

  Tobj -= 273.15; // Kelvin -> *C
  return Tobj;
}

// Caculate sensor temperature based on raw reading
double readDieTempC(uint8_t addr) 
{
  double Tdie = readRawDieTemperature(addr);
  Tdie *= 0.03125; // convert to celsius
  return Tdie;
}

The second arduino is running no code, and is hooked up in parallel with the sensor and first arduino for both its a4 and a5 pins and ground.

Is the second arduino connected directly to the I2C bus with no open collector buffer IC? Is that pin set as an OUTPUT or left as an INPUT?

Attached is a picture of my a4 and a5 connections. On the far left, you have the yellow A5 of the first arduino, and a purple a4. The next green and yellow pair are the SCL and SDA pins of the TMP006. The white and orange are the a5 and a4 of the second arduino respectively, and I have not set any pin values in my code. Should I?

If the A4 and A5 pins have not been set as OUTPUT in its code, they should still be INPUTs.

Are all the Gnds connected together?

Which of the pins should be set to input/output? Do they need to be changed on both arduinos?

Also, attached is a picture of my grounds. From left to right: First arduino, TMP006, second arduino.

The slave Arduino pins should be INPUTs for testing. That should be the default for those pins.

edit: Do you have pullup resistors on the clock and data lines?

And the master arduino's pins should also be set to their default? Is there maybe an adjustment in my code that I need to make? If I disconnect the second arduino, the sensor runs fine, and if I disconnect the sensor I am able to send bytes between the arduinos fine.

A4 and A5 should be INPUT by default. Do you have pullup resistors on the clock and data lines?

I am not familiar with pullup resistors.

Pullup resistors are required on the I2C bus. The TMP006 may have them, but they may not be strong enough. Run a 5 volt line to the breadboard and put a 10K resistor from there to the clock and data lines of the I2C bus.

So I should take the five volt line, run it through a 10k resistor, and then run it through two separate rows on the breadboard (one for a4 and the other for a5), and connect the SDA and SCL them? Am I still using the a4 and a5 pins with the TMP006 at all? I'm sure you're right, I'm just unsure how to wire it.

Run a 5 volt line to the breadboard. Connect a 10K resistor from the 5 volt line to the clock lines. Run another 10K resistor from the 5 volt line to the data lines. Insure the second (slave) Arduino has either A4 and A5 set to INPUT or run Wire.begin(xx) where xx is the slave I2C address.

Alright, and the SDA and SCL will no longer be in parallel with the two arduino's a4 and a5 pins?

They will still be in parallel. The only thing you are doing is installing pullup resistors on the clock and data lines.

edit here is what you are doing:

Thanks for the help. While I was waiting, I decided to attempt another transmission and the programs are now both running. I feel that the issue was the second arduino was not running the Wire.begin() and the signals were somehow interfering? It runs now, however.