Connecting 5 mpu6050 with one arduino

I have connected 5 mpu6050 with arduino mega using the trick mentioned in http://playground.arduino.cc/Main/MPU-6050
i am using address (0*69) for all the sensors and have connected the AD0 pin of each sensor to a seperate digital pin in mega. For every sensor i make the AD0 pin high before reading its value and then make it low. The problem is its only working for 3 sensors and whenever i attach the sda pin of the fourth sensor the serial monitor stops giving me values. My code is very simple, just reading the raw values. My code is attached with the serial monitor result.

#include<Wire.h>
const int MPU_addr=0x69;  // I2C address of the MPU-6050
int16_t X1,Y1,Z1,Tmp,GX1,GY1,GZ1,X2,Y2,Z2,Tmp1,GX2,GY2,GZ2,X3,Y3,Z3,Tmp2,GX3,GY3,GZ3,X4,Y4,Z4,Tmp3,GX4,GY4,GZ4,X5,Y5,Z5,Tmp4,GX5,GY5,GZ5;
void setup(){
  Wire.begin();
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
  Wire.endTransmission(true);
   pinMode(3,OUTPUT);
   pinMode(4,OUTPUT);
   pinMode(5,OUTPUT);
   pinMode(6,OUTPUT);
   pinMode(7,OUTPUT);
  Serial.begin(115200);
}
void loop(){
Reading1();
Reading2();
Reading3();
Reading4();
Reading5();
danish();
}

void Reading1(){
    digitalWrite(3,HIGH);
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  X1=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  Y1=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  Z1=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GX1=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GY1=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GZ1=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  digitalWrite(3,LOW);
  delay(500);
  }

  void Reading2(){
    digitalWrite(4,HIGH);
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  X2=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  Y2=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  Z2=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GX2=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GY2=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GZ2=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  digitalWrite(4,LOW);
  delay(500);
  }

  
  void Reading3(){
    digitalWrite(5,HIGH);
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  X3=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  Y3=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  Z3=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GX3=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GY3=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GZ3=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  digitalWrite(5,LOW);
  delay(500);
  }

  
  void Reading4(){
    digitalWrite(6,HIGH);
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  X4=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  Y4=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  Z4=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GX4=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GY4=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GZ4=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  digitalWrite(6,LOW);
  delay(500);
  }

  void Reading5(){
    digitalWrite(7,HIGH);
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers
  X5=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  Y5=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  Z5=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  Tmp=Wire.read()<<8|Wire.read();  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)
  GX5=Wire.read()<<8|Wire.read();  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
  GY5=Wire.read()<<8|Wire.read();  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
  GZ5=Wire.read()<<8|Wire.read();  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  digitalWrite(7,LOW);
  delay(500);
  }
  
void danish(){
//  delay(400);
    Serial.print("X1="); Serial.print(X1);
  Serial.print(",Y1="); Serial.print(Y1);
  Serial.print(",Z1="); Serial.print(Z1);
   Serial.print(",X2="); Serial.print(X2);
  Serial.print(",Y2="); Serial.print(Y2);
  Serial.print(",Z2="); Serial.print(Z2);
   Serial.print(",X3="); Serial.print(X3);
  Serial.print(",Y3="); Serial.print(Y3);
  Serial.print(",Z3="); Serial.print(Z3);
    Serial.print(",X4="); Serial.print(X4);
  Serial.print(",Y4="); Serial.print(Y4);
  Serial.print(",Z4="); Serial.print(Z4);
    Serial.print(",X5="); Serial.print(X5);
  Serial.print(",Y5="); Serial.print(Y5);
  Serial.print(",Z5=");
  Serial.println(Z5);
 
  
}

And the value of the external pull up resistors are?

The Arduino Mega 2560 has a 5V I2C bus, because it has 10k pullup resistors for SDA and SCL to 5V. The output pins are also 5V.

You may not connect the MPU-6050 (either with SDA, SCL or AD0) to 5V. You need level shifters for the SDA, SCL, and the five AD0 pins. Or use a 3.3V Arduino board.

Which MPU-6050 modules do you use ? Could you give a link to them ? Perhaps there are pullup resistors on the modules, and the resulting pullup (all the pullup resistors parallel) is too low.

Perhaps there are pullup resistors on the modules, and the resulting pullup (all the pullup resistors parallel) is too low.

Unlikely because they are going to be 4K7 if fitted and with 40mA sinking current you could put 37 on the bus without exceeding the current limits on a pin. Even then it would not stop working because you are overloading a pin.

Some MPU-6050 modules from Ebay have 2k2, and the sourcing current is specified by the I2C standard as maximum 3mA. The Arduino Mega can do probably more than 3mA, but the 'LOW' will lift : http://gammon.com.au/forum/?id=10896&reply=5#reply5. The 3mA should still be used as maximum, because the sensors might do no more than 3mA. The I2C hardware does not use the normal digital logic of the Atmel chip. The I2C hardware inside the Atmel chip has slew-rate filter, other voltage levels for HIGH and LOW and so on.