MPU6050 GY521 & Arduino Nano v3.0 [Newbe_Help]

Hello All

What im trying to do here is to simple test my MPU6050 with my arduino nano v3.0, the problem is that i don't know how to connect the "MPU" with the arduino and how to test it (Code...etc), the other problem is that i don't know how to insert the library's
in the arduino software the (#include "I2Cdev.h" & #include "MPU6050.h").
I know some of you may tell me go search on internet there is several tutorial's with that post, but everything what i tryed, failed
what i simply ask :roll_eyes: if someone can give me some direct links from the download page with the library's and a simple code to test my "MPU".

ps Im newbe and i need time to understand what im doing.

Hi Domino60,

Funny, I'm in the exact same boat as you. Noob with the same Arduino and the same chip.

I've managed to get data from my MPU6050 using the sample at:

I just got started on it tonight. So far using the sample, the data I'm getting looks like the gyro and acc data are swapped.

Maybe try the same sample just to get some data exchange. There are a lot of defines in the sample, but from what I can tell, only a few are used in the actual sample code. Hopefully someone more knowledgeable will chime in, otherwise we can stumble through this together!

BTW, what are you planning on doing with yours? I'm building a balancing robot, maybe too ambitious for a first project, but thats how I roll I guess :slight_smile:

Not sure if this is going to work (not sure how to embed images from google drive), but here are my results and setup:

Data from serial monitor in a graph, you can see that the red line is supposed to be accel y data but it looks more like it is gyro y data to me and the green line is supposed to be gyro x data but it looks more like accel data. Maybe I'm confused about how the chip works (I know I should RTFM...). In the test, I tilted it from vertical to horizontal 90deg, pausing three times on the way down:


Here is a picture of the orientation of the sensor:


Here it is on my project:


Hi steveb1475
Thanks alot for Reply, as i see you got more stuffs than me "info", code and other ...
I found how to put my library's in the arduino software and i found how to get some info from my MPU6050
from Arduino Playground - MPU-6050 the bottom code, thats the only thing that i done untill now.
As i see you know more than i expected when you posted the photos, can you send me an example of the code and how to connect the MPU6050, thats will be very nice. :slight_smile:

Well im planning to do the same, but for start i try to understand how the mpu works with the motor, and to understand the full code how its working.

Thanks for reply i hope you will keep reply.


I also just got a MPU-6050 from Sparkfun ( but for a Uno R3 instead of a Nano. How did you connect it to the board? Where do the wires go? I couldn't find any documentation about the actual wiring of it, or maybe I'm just missing something obvious as I'm quite a noob when it comes to wiring these things, so any help would be much appreciated!



Dear steveb1475,

Please help me to share a little infor..

Thanks & Best Regards,