Shopping Cart

Menu

GY-521 MPU-6050 | 6-Axis Gyro Accelerometer IMU Module

GY-521 MPU-6050 | 6-Axis Gyro Accelerometer IMU Module

Original price was: $9.99.Current price is: $7.99.

Availability: In Stock

GY-521 MPU-6050 – 6-Axis Gyroscope and Accelerometer IMU Module for Motion Sensing

The GY-521 MPU-6050 module is a compact 6-axis inertial measurement unit that combines a 3-axis gyroscope and a 3-axis accelerometer with an onboard temperature sensor and Digital Motion Processor. It is a practical choice for robotics, gesture control, balance platforms, motion logging, tilt detection, and learning projects that need reliable orientation and acceleration data over a simple I2C connection.

Because the module communicates over I2C, it only needs SDA and SCL plus power and ground for most microcontroller builds. The AD0 pin lets you select between common I2C addresses 0x68 and 0x69, making it easier to place two MPU-6050 devices on the same bus. It pairs well with boards such as the ELAB Nano V3, the UNO R3 Prototype Expansion Board, and quick wiring setups built on an MB 102 Breadboard Kit.

Inside the MPU-6050, configurable full-scale ranges allow the accelerometer to measure up to +/-16g and the gyroscope to measure up to +/-2000 degrees per second, while the 1024-byte FIFO and DMP can reduce the host processor workload in more advanced designs. For exact register definitions, electrical limits, and performance details, refer to the official TDK InvenSense MPU-6050 datasheet and register map before finalizing production hardware.

Technical Specifications

Parameter Value
SKU TB-GY521
Module Type GY-521 MPU-6050 IMU module
Sensor IC MPU-6050
Motion Axes 3-axis accelerometer + 3-axis gyroscope
Additional Sensor On-chip temperature sensor
Accelerometer Ranges +/-2g, +/-4g, +/-8g, +/-16g
Gyroscope Ranges +/-250, +/-500, +/-1000, +/-2000 degrees/s
Digital Interface I2C primary interface
I2C Addresses 0x68 when AD0 is low; 0x69 when AD0 is high
FIFO 1024-byte FIFO buffer
Digital Motion Processor Integrated DMP for motion-processing offload
Auxiliary Bus Auxiliary I2C bus for external sensors supported by MPU-6050
Sensor Supply Range 2.375V-3.46V at IC level; confirm breakout-board VCC pin before wiring
Logic Compatibility Use host logic levels compatible with the breakout board and pull-up configuration
Typical Applications Robot balancing, gesture sensing, vibration logging, tilt detection, attitude estimation

Board Layout & Label Guide

  • VCC – Power input for the GY-521 breakout. Confirm the exact board voltage support before connecting to 5V or 3.3V rails.
  • GND – Common ground shared with the host microcontroller.
  • SCL – I2C clock line connected to the host controller’s I2C clock pin.
  • SDA – I2C data line connected to the host controller’s I2C data pin.
  • AD0 – I2C address-select pin. Low selects 0x68; high selects 0x69.
  • INT – Interrupt output for data-ready, FIFO, or motion events depending on firmware configuration.
  • XDA / XCL – Auxiliary I2C data and clock pins for external sensors supported by the MPU-6050.
  • MPU-6050 IC – Main motion-sensing chip; mount the board securely to reduce vibration artifacts.
  • Axis Orientation – Confirm board silkscreen orientation in software before interpreting roll, pitch, and yaw.
  • Calibration Note – Perform offset calibration after mounting, since tilt, vibration, and temperature can affect raw readings.

Application Scenarios

1. Arduino Raw Accelerometer and Gyroscope Readout

This Arduino example wakes the MPU-6050, reads raw accelerometer and gyroscope registers over I2C, and prints values for first-time wiring checks.

#include const int MPU_ADDR = 0x68;void setup() { Serial.begin(115200); Wire.begin(); Wire.beginTransmission(MPU_ADDR); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true);}void loop() { Wire.beginTransmission(MPU_ADDR); Wire.write(0x3B); Wire.endTransmission(false); Wire.requestFrom(MPU_ADDR, 14, 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(); int16_t temp = Wire.read() << 8 | Wire.read(); int16_t gx = Wire.read() << 8 | Wire.read(); int16_t gy = Wire.read() << 8 | Wire.read(); int16_t gz = Wire.read() << 8 | Wire.read(); Serial.print("AX="); Serial.print(ax); Serial.print(" AY="); Serial.print(ay); Serial.print(" AZ="); Serial.print(az); Serial.print(" GX="); Serial.print(gx); Serial.print(" GY="); Serial.print(gy); Serial.print(" GZ="); Serial.println(gz); delay(200);}

2. Tilt Angle Estimate on Arduino

This example converts accelerometer readings into approximate roll and pitch angles for tilt switches, dashboard displays, and simple leveling tools.

#include #include const int MPU_ADDR = 0x68;int16_t readWord() { return Wire.read() << 8 | Wire.read();}void setup() { Serial.begin(115200); Wire.begin(); Wire.beginTransmission(MPU_ADDR); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true);}void loop() { Wire.beginTransmission(MPU_ADDR); Wire.write(0x3B); Wire.endTransmission(false); Wire.requestFrom(MPU_ADDR, 6, true); float ax = readWord() / 16384.0; float ay = readWord() / 16384.0; float az = readWord() / 16384.0; float roll = atan2(ay, az) * 57.2958; float pitch = atan2(-ax, sqrt(ay * ay + az * az)) * 57.2958; Serial.print("Roll="); Serial.print(roll); Serial.print(" Pitch="); Serial.println(pitch); delay(250);}

3. Raspberry Pi Python Motion Logger

This Python script uses SMBus to log raw motion samples from the MPU-6050 into a CSV file for later analysis.

import timefrom smbus2 import SMBusADDR = 0x68def read_word(bus, reg): high = bus.read_byte_data(ADDR, reg) low = bus.read_byte_data(ADDR, reg + 1) value = (high << 8) | low return value - 65536 if value > 32767 else valuewith SMBus(1) as bus: bus.write_byte_data(ADDR, 0x6B, 0) with open(“mpu6050_log.csv”, “a”, encoding=”utf-8″) as log: while True: ax = read_word(bus, 0x3B) ay = read_word(bus, 0x3D) az = read_word(bus, 0x3F) gx = read_word(bus, 0x43) gy = read_word(bus, 0x45) gz = read_word(bus, 0x47) log.write(f”{time.time():.0f},{ax},{ay},{az},{gx},{gy},{gz}”) log.flush() time.sleep(0.1)

4. MicroPython I2C Scanner

Use this quick MicroPython check on RP2040 or ESP32 boards to confirm whether the module appears at address 0x68 or 0x69.

from machine import Pin, I2Ci2c = I2C(0, scl=Pin(17), sda=Pin(16), freq=400000)devices = i2c.scan()for device in devices: print(hex(device))

5. Shake Detection with Arduino

This sketch turns on an LED when acceleration magnitude changes sharply, useful for simple gesture, alarm, or impact-detection demos.

#include const int MPU_ADDR = 0x68;const int ledPin = 13;int16_t readWord() { return Wire.read() << 8 | Wire.read();}void setup() { pinMode(ledPin, OUTPUT); Wire.begin(); Wire.beginTransmission(MPU_ADDR); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true);}void loop() { Wire.beginTransmission(MPU_ADDR); Wire.write(0x3B); Wire.endTransmission(false); Wire.requestFrom(MPU_ADDR, 6, true); long ax = readWord(); long ay = readWord(); long az = readWord(); long magnitude = abs(ax) + abs(ay) + abs(az); digitalWrite(ledPin, magnitude > 45000 ? HIGH : LOW); delay(50);}

6. Temperature Register Readout

The MPU-6050 includes an internal temperature sensor that can help with diagnostics and drift observation during long motion tests.

#include const int MPU_ADDR = 0x68;void setup() { Serial.begin(115200); Wire.begin(); Wire.beginTransmission(MPU_ADDR); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(true);}void loop() { Wire.beginTransmission(MPU_ADDR); Wire.write(0x41); Wire.endTransmission(false); Wire.requestFrom(MPU_ADDR, 2, true); int16_t rawTemp = Wire.read() << 8 | Wire.read(); float tempC = rawTemp / 340.0 + 36.53; Serial.print("Temperature C: "); Serial.println(tempC); delay(1000);}

Packing List

  • 1 x GY-521 MPU-6050 6-Axis IMU Module

FAQ

Q: What does the GY-521 MPU-6050 measure?
A: It measures 3-axis acceleration and 3-axis angular velocity, and also includes an internal temperature sensor.

Q: Is this a 6-axis or 9-axis IMU?
A: It is a 6-axis IMU. It does not include a built-in magnetometer, though the MPU-6050 supports an auxiliary I2C bus for external sensors.

Q: What I2C address should I use?
A: Use 0x68 when AD0 is low and 0x69 when AD0 is high.

Q: Can it calculate roll and pitch?
A: Yes. Roll and pitch can be estimated from accelerometer data, and smoother attitude estimates can be produced by combining gyro and accelerometer readings.

Q: Does the module need calibration?
A: Yes. Offset calibration is recommended after the board is mounted in the final orientation.

Q: Can I use it with Arduino?
A: Yes. It communicates over I2C and is commonly used with Arduino-compatible boards and libraries.

Q: Why are my readings noisy?
A: Check mounting rigidity, power stability, I2C pull-ups, sample rate, and nearby vibration sources. Software filtering may also be needed.

Q: What should I check if the module is not detected?
A: Verify VCC, GND, SDA, SCL, I2C address, AD0 state, pull-ups, and whether your host logic voltage is compatible with the breakout.

Add a Review

Your email address will not be published. Required fields are marked *

Related Products