Video Tutorial (Optional)
Watch first if you want to follow the full Arduino Uno + MPU6050 setup in real time.
Project Overview
In this project, you connect an Arduino Uno to an MPU6050 (GY-521) 6-axis accelerometer + gyroscope module and upload an example sketch to get live motion readings over I2C in the Serial Monitor.
The MPU6050 combines a 3-axis accelerometer, a 3-axis gyroscope, and a temperature sensor in a compact module. It is commonly used for orientation, motion, and tilt detection in robotics and interactive projects.
- Time: 15 to 30 minutes
- Skill level: Beginner
- What you will build: A working Arduino Uno + MPU6050 I2C setup that outputs accelerometer and gyroscope readings
Parts List
From ShillehTek
- MPU6050 (GY-521) pre-soldered module - the 6-axis motion sensor used to read acceleration and gyroscope data over I2C
External
- Arduino UNO - the microcontroller board running the example sketch
- Jumper wires - connect MPU6050 pins to the Arduino Uno
- USB-A to B cable - powers the Arduino Uno and uploads code
- MPU6050 on Amazon - alternative source for the sensor module
Note: Use discount code SHILLEHTEK for 30% off on ShillehTek. The MPU6050 VCC pin typically supports 3.3V or 5V depending on the breakout, and this guide uses the common 4-wire I2C pins (VCC, GND, SDA, SCL).
Step-by-Step Guide
Step 1 - Physical setup (wire MPU6050 to Arduino Uno)
Goal: Connect the MPU6050 to the Arduino Uno using I2C so the board can read motion data.
What to do: Use four jumper wires and wire the MPU6050 pins to the Arduino Uno as shown in the diagram.
Pin meanings:
- GND - ground reference for the circuit
- VCC - power input (typically 3.3V or 5V depending on the module)
- SCL - I2C clock line
- SDA - I2C data line
The MPU6050 also has additional pins that are not used in this tutorial:
- XDA - auxiliary I2C data
- XCL - auxiliary I2C clock
- ADO - I2C address select
- INT - interrupt output
Expected result: The MPU6050 is powered and connected to the Arduino Uno via SDA/SCL and is ready for code upload.
Step 2 - Code setup in the Arduino IDE
Goal: Install the required library and upload an example sketch that prints MPU6050 readings.
What to do: This tutorial assumes you already have the Arduino IDE installed and know how to connect your Arduino Uno.
- In the Arduino IDE, go to Tools and select the correct Board and Port for your Arduino Uno.
- Open the Library Manager (left side of the Arduino IDE) and install the Adafruit MPU6050 library along with its dependencies.
- Go to File > Examples, then scroll to Adafruit MPU6050 and open the included example sketch.
- Select basic_readings.ino and upload it to the Arduino Uno using the Upload button.
Expected result: The sketch uploads successfully, and you can open the Serial Monitor to see continuous motion sensor readings.
Step 3 - Verify readings in the Serial Monitor
Goal: Confirm the Arduino Uno is receiving live accelerometer and gyroscope data from the MPU6050.
What to do: Open the Serial Monitor after uploading the example sketch and watch the output.
Expected result: You see a stream of values updating in real time as the MPU6050 moves.
Conclusion
You just connected an Arduino Uno to an MPU6050 over I2C and used the Adafruit example sketch to get live accelerometer and gyroscope readings. This is a solid starting point for projects that need orientation, motion tracking, or tilt detection.
Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project for a robot, product demo, or a larger system, check out our IoT consulting services. You can also watch the full video on YouTube.