Connect the GY-521 to an Arduino over I²C, then read the MPU-6050 sensor’s accelerometer, gyroscope and temperature registers. For a first test, use the four-wire hookup below and either the Adafruit library example or a short raw Wire sketch. Keep the board still when calibrating, and convert raw counts using the sensor’s configured ranges before treating them as physical measurements.
What the GY-521 measures
The GY-521 is a breakout board built around the MPU-6050 sensor IC; it is not the sensor chip itself. The MPU-6050 combines a three-axis accelerometer, a three-axis gyroscope, a temperature sensor and a digital motion processor (DMP). The DMP can process motion algorithms on the chip, but a beginner setup can start by reading raw register values over I²C. Michael Schoeffler’s GY-521 guide describes the breakout and its pins.
The accelerometer responds to acceleration, including gravity. When the module is stationary, its readings should reflect gravity along the axis aligned with it. The gyroscope reports angular rate; if you integrate that rate to estimate angle, error accumulates and the estimate can drift. Raw register counts are not yet acceleration or rotation units: the appropriate conversion depends on the full-scale ranges configured for the sensor.
Wire the GY-521 to an Arduino Uno
Use an Arduino Uno, GY-521, breadboard and jumper wires. Connect the four I²C and power lines as follows:
#1 Best Overall
- MPU-6050 MPU6050 6-axis Accelerometer Gyroscope Sensor
- Communication mode: standard IIC communication protocol
- Chip built-in 16bit AD converter, 16bit data output
- Gyroscopes range: +/- 250 500 1000 2000 degree/sec
- Acceleration range: ±2 ±4 ±8 ±16g
| GY-521 pin | Arduino Uno |
|---|---|
| VCC | 5V on a typical regulator-equipped breakout, or the voltage recommended for your particular board revision |
| GND | GND |
| SDA | SDA, or A4 on Uno boards without dedicated SDA/SCL labels |
| SCL | SCL, or A5 on Uno boards without dedicated SDA/SCL labels |
Breakout revisions and clones may differ in their regulator and voltage behavior, so do not assume every board accepts the same supply. Michael Schoeffler’s pinout guide identifies the remaining pins as XDA, XCL, AD0 and INT: XDA and XCL are auxiliary I²C pins, INT is an interrupt output, and AD0 selects the I²C address. For the ordinary four-wire Arduino hookup, leave those auxiliary and interrupt pins unconnected.
Choose between a library and raw I²C
A library is the easier starting point if you want readable output and helper functions. Raw Wire access is useful for learning how the MPU-6050 register map works or confirming basic communication, but it leaves configuration and interpretation to your sketch.
Rank #2
- MPU-6050 MPU6050 Module: adopts the standard IIC communication for communication and is powered by 3V-5V for sustainable use.
- 3 Axis Accelerometer Gyroscope Module: Gyroscope range: ± 250 500 1000 2000 ° / s; Acceleration range: ± 2 ± 4 ± 8 ± 16 g; Transmission can pass I2C up to 400kHz or SPI up to 20MHz.
- MPU 6050 Chip built-in: with three 16-bit analog-to-digital converters (ADCs) for digitizing the gyroscope outputs and another three ones for digitizing the accelerometer outputs.
- Universally Compatible: This sensor is easy to use with just about any microcontroller that has an I2C interface, for Raspberry Pi and ESP32 models.
- What You Will Get: 3pcs Pre-Soldered GY-521 mpu-6050 mpu6050 3 axis accelerometer sensor. Ready to plug in and go.
| Approach | What it provides | Best fit |
|---|---|---|
| Adafruit MPU6050 library | Guided setup and a basic readings example that reports acceleration, rotation and temperature. The guide specifies Adafruit BusIO and Adafruit Unified Sensor as dependencies. | First readings and a supported library workflow |
| RobTillaart GY521 library | Address support for 0x68 and 0x69, connection checking, sensitivity configuration and calibration helpers. Its README labels the library experimental. | Code that needs its calibration-oriented API or sensitivity controls |
Raw Wire sketch |
Direct register access, including waking the chip and reading a register block. Range configuration, scaling and additional processing are your responsibility. | Learning I²C and register-level behavior |
Use the Adafruit basic-readings example
- In the Arduino IDE, open Library Manager and install Adafruit MPU6050, Adafruit BusIO and Adafruit Unified Sensor.
- Open File → Examples → Adafruit MPU6050 → basic_readings.
- Upload the sketch, open Serial Monitor and set the baud rate to 115200, as specified in the Adafruit guide.
- Hold the module still, then tilt and rotate it. Confirm that the reported acceleration, rotation and temperature values appear and respond to movement.
See the Adafruit MPU6050 Arduino guide for the library setup and example path.
Read raw values with Wire
The minimal register workflow below reads acceleration, temperature and gyroscope data. It assumes AD0 is low, making the address 0x68. If you only need the three accelerometer and three gyroscope axes, the Arduino Project Hub example reads 12 bytes; requesting 14 also includes the two-byte temperature value.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #3
- Product Name MPU-6050 MPU6050 6-Axis Accelerometer Gyro Sensor, which is a key component for motion sensing applications.
- Communication Protocol Utilizes the standard IIC communication protocol, enabling reliable data transfer between the sensor and other connected devices.
- AD Converter and Data Output Incorporates a built-in 16-bit AD converter, providing precise 16-bit data output for accurate measurement and analysis.
- Gyroscope Range Offers a gyroscope range of +/- 250, 500, 1000, and 2000 degrees per second, allowing for the detection of various rotational speeds and movements.
- Acceleration Range The acceleration range spans ±2, ±4, ±8, and ±16 grams, facilitating the measurement of different levels of linear acceleration in various applications such as inertial navigation and motion tracking.
- Include
Wire.h, set the device address to0x68(or0x69if AD0 is high), and callWire.begin(). - Wake the sensor by writing
0to register0x6B(PWR_MGMT_1). - Set the register pointer to
0x3B(ACCEL_XOUT_H). - Request 14 bytes. Combine each high and low byte into a signed 16-bit value: accelerometer X, Y and Z; temperature; then gyroscope X, Y and Z.
- Print the values to Serial Monitor and move or rotate the board to verify that they change.
The Arduino Project Hub GY-521 example demonstrates reading the sensor over I²C, while Schoeffler’s Uno tutorial includes the 14-byte read with temperature. Neither raw byte values nor combined signed integers should be labelled as physical units until you have accounted for the selected accelerometer and gyroscope ranges and their sensitivity factors.
Find the I²C address
The MPU-6050 address depends on the AD0 pin: AD0 low selects 0x68, and AD0 high selects 0x69. The Uno examples commonly use 0x68. If the sketch cannot find the sensor, check AD0 and run an I²C scanner, or call isConnected() when using the RobTillaart library. Its GY521 README documents both supported addresses and the connection check.
Rank #4
- Product Name MPU-6050 MPU6050 6-Axis Accelerometer Gyro Sensor, which is a key component for motion sensing applications.
- Communication Protocol Utilizes the standard IIC communication protocol, enabling reliable data transfer between the sensor and other connected devices.
- AD Converter and Data Output Incorporates a built-in 16-bit AD converter, providing precise 16-bit data output for accurate measurement and analysis.
- Gyroscope Range Offers a gyroscope range of +/- 250, 500, 1000, and 2000 degrees per second, allowing for the detection of various rotational speeds and movements.
- Acceleration Range The acceleration range spans ±2, ±4, ±8, and ±16 grams, facilitating the measurement of different levels of linear acceleration in various applications such as inertial navigation and motion tracking.
Calibrate and interpret readings
Keep the module motionless during calibration. The RobTillaart library’s calibrate(times, angleX, angleY, inverted) routine writes accelerometer and gyroscope offsets; its README says times values of 100 or more are typical and warns that calibration can take time. Repeat calibration after changing sensitivity settings. The maintainer’s guidance is explicit: “To improve the quality of the error offsets, the GY521 sensor should not move during the calibration.”
Quick Recap
- Accelerometer: readings include gravity. At rest, expect gravity to appear primarily on the axis aligned with it, after applying the correct conversion and calibration.
- Gyroscope: readings represent angular rate. Integrating them to estimate orientation will normally drift; the cited beginner examples do not establish a universal drift or accuracy figure.
- Raw counts: use the selected full-scale range and corresponding sensitivity factor before converting counts to physical units.
Troubleshoot missing or unstable readings
- No device detected: verify whether AD0 is low or high, then check for address
0x68or0x69with a scanner orisConnected(). - Bus communication fails: confirm GY-521 and Arduino share ground, and recheck SDA and SCL. On an Uno without dedicated labels, use A4 for SDA and A5 for SCL.
- Power or board behavior is inconsistent: check the voltage guidance for your specific breakout revision. Regulator and input-voltage behavior should not be assumed identical across clones.
- Calibration offsets are poor: place the module on a stable surface and leave it still for the calibration call; repeat after changing sensitivity.
- Values move but orientation is noisy or drifts: raw register reads are a connectivity and learning test, not a complete orientation solution. Use a library when you need range configuration, filtering or orientation helpers, and account for gyroscope drift.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute

