Hey all, I have a strange problem. I had an MPU6050 hooked up to my Uno and was running fine. Just for reference, the serial port was being read by a Raspberry Pi, so they were connected there. A couple days ago the MPU6050 started outputting -1 for all the variables. They were registering correctly (or at least changing when I moved it) before. I thought it odd, but maybe the RPi couldn’t power the Uno or something like that, so I plugged the Uno into my computer USB. Same thing. Thought maybe the sensor was bad somehow, I had another and changed it out, same thing. Thought maybe the Uno got fried, changed it out for another and same thing! Of course triple checked my wiring (not that that was the issue because it was working anyway). Below is the code, it’s just the simple example sketch from

Again the sensor and Uno were working fine. Now all sensors accel and gyro reading -1 and Celsius stuck at 35. Anyone have any suggestions?

 // MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
const int MPU_addr=0x68;  // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
void loop(){
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.requestFrom(MPU_addr,14,true);  // request a total of 14 registers<<8|;  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)<<8|;  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)<<8|;  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)<<8|;  // 0x41 (TEMP_OUT_H) & 0x42 (TEMP_OUT_L)<<8|;  // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)<<8|;  // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)<<8|;  // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
  Serial.print("AcX = "); Serial.print(AcX);
  Serial.print(" | AcY = "); Serial.print(AcY);
  Serial.print(" | AcZ = "); Serial.print(AcZ);
  Serial.print(" | Tmp = "); Serial.print(Tmp/340.00+36.53);  //equation for temperature in degrees C from datasheet
  Serial.print(" | GyX = "); Serial.print(GyX);
  Serial.print(" | GyY = "); Serial.print(GyY);
  Serial.print(" | GyZ = "); Serial.println(GyZ);

Use the example in the library attached below. try powering the arduino separately as raspberry pi may not provide the sufficient current. Check the connections again SDA to A4; SCL to A5.

Have you verified that you have proper pull-up resistors?