MPU6050 returns all zeros or does not wake up

The MPU6050 starts in sleep mode, so you must write to its power management register to wake it. If you read the registers directly, do that first.

What the message means

After power-up the chip sleeps and its data registers stay at zero. Libraries clear the sleep bit for you; hand-written code must write 0 to register 0x6B (PWR_MGMT_1).

Fix it in this order

  1. Run an I2C scanner. The MPU6050 answers at 0x68 (AD0 low) or 0x69 (AD0 high).
  2. Write 0 to register 0x6B to wake it, or use a library that does this in begin().
  3. Check SDA and SCL wiring, power (3.3 V or 5 V as your module allows) and ground.
  4. Keep AD0 connected to a definite level, not floating.
  5. Call the library begin() and check its return value.
  6. Try a second module. Counterfeit or damaged boards exist.

Why it happens

The MPU6050 powers up in sleep mode, which keeps its measurement registers at zero. Its power management register at address 0x6B holds the sleep bit, and writing 0 to that register wakes the chip and starts measurement. Most libraries do this inside begin(), but hand-written code must do it explicitly, or every read returns zeros.

The chip also has to answer on the I2C bus, at 0x68 or 0x69 depending on the AD0 pin. A floating AD0 can leave the address unstable, and a loose connection or weak supply can leave the chip unresponsive. An I2C scanner shows whether the chip responds at all, which separates a wake-up problem from a wiring fault.

If you see this, do this

You seeDo this
Scanner finds nothingSee the I2C page.
Found at 0x68 but data are zeroThe chip is asleep.

Confirm the fix

  1. Run an I2C scanner and confirm an address of 0x68 or 0x69 appears in the output.
  2. Write 0 to register 0x6B, read it back, and confirm the value is 0 before you read any sensor data.
  3. Read the accelerometer registers with the board lying flat; one axis should show a value near gravity, not all zeros.

Common mistake: Assuming the sensor is broken when every reading is zero. The chip powers up asleep and needs a wake-up write before it reports anything.

MPU6050 gyro drift, I2C device not found, complementary filter.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

Why this happens

At power-up the MPU6050 is in sleep mode. The PWR_MGMT_1 register at address 0x6B resets to 0x40, with bit 6 set, which is the sleep bit. While it is set the sensor stays idle and the data registers stay at zero. Writing 0 to that register clears sleep and starts measurement.

The chip is found on the I2C bus at 0x68, or at 0x69 if AD0 is high. So the chip can answer a scan and still return zeros, because I2C working only shows the chip is present. A fault in the bus itself looks different: the scanner finds nothing, or the first read returns an error.

How to confirm the cause

  • Run an I2C scanner. If 0x68 or 0x69 appears, wiring and addressing are fine and the problem is configuration.
  • Read the WHO_AM_I register at 0x75. A genuine MPU6050 returns 0x68. A different value, for example 0x70, suggests a different chip such as an MPU6500 sold under the same name.
  • Read register 0x6B. A value of 0x40 means the chip is still asleep.
  • After writing 0 to 0x6B, read it back. If it does not read 0, the write is not reaching the chip.
  • Lay the board flat and read the Z acceleration. At the default range the raw value should be near 16384 for 1 g.

Worked example

This sketch wakes the chip and prints the Z acceleration in g. At the default plus or minus 2 g range, 16384 raw counts equal 1 g.

#include <Wire.h>
void setup() {
  Serial.begin(115200); Wire.begin();
  Wire.beginTransmission(0x68); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true);
}
void loop() {
  Wire.beginTransmission(0x68); Wire.write(0x3B); Wire.endTransmission(false);
  Wire.requestFrom(0x68, 6, true);
  int16_t ax = (Wire.read() << 8) | Wire.read();
  int16_t ay = (Wire.read() << 8) | Wire.read();
  int16_t az = (Wire.read() << 8) | Wire.read();
  Serial.println(az / 16384.0);
  delay(500);
}

A board lying flat should print a value close to 1.0. A value that is exactly 0 means the chip is still asleep or the read failed.

Common mistakes

  • Checking only that the scanner finds the address and calling the sensor good.
  • Leaving AD0 floating, so the address changes at random.
  • Mixing up raw counts and units, and reading 16384 as a fault.
  • Reading only one byte of each two-byte value.

If this did not fix it

  • Counterfeit or different chip: check WHO_AM_I and use a library written for that chip.
  • Supply voltage: confirm the module’s input range and use the right one.
  • Pull-ups missing on a bare chip: add resistors to SDA and SCL.