Also read!
Home / Tools / Arduino / Módulo GY-521 MPU-6050 triple 3-axis accelerometer gyroscope magnetrômetro i2c

Módulo GY-521 MPU-6050 triple 3-axis accelerometer gyroscope magnetrômetro i2c

This small and cheap GY-521 module, connected to an Arduino Uno, It measures acceleration, gyro and magnetic field thanks to chip M6050. You can use to check the orientation of the Board as well as a cell phone can tell odo landscape or portrait. or picture.

57d8accb58a61_IMG_20160912_172520

It comes with the terminal sticks to you weld.

57d8acce7e9c5_IMG_20160912_172532

On the back there is no chip. These two small holes are used to attach the module in place where if you want to make the measure of angle X and Y (ROLL and PITCH).

57d8acd139c8a_IMG_20160912_172544

To connect to the Arduino simply place the VCC of the GY-521 to 5V, the GND to GND of the Arduino and the SDA and SCL pins for A4 and A5 respectively.

57d8acd4afaef_IMG_20160913_215847

Now you have to install the library FREEIMU, that can be downloaded by This link. You should give it a read in the documentation and instructions in the main site of the library. Basically, put all the files in the ZIP in the Libraries directory within the directory the program Arduino Libraries.

The surprise is in the two examples that comes with the library, and must be rotated in the calling program Processing. You send it to the Arduino example code of the library called FREEIMU_SERIAL and open the program FreeIMU_yaw_pitch_roll (or FreeIMU_cube) within this processing. Then simply change the following line of code to point to the SERIAL port, in my case it's the COM12, but will differ according to the computer.

57d8ace0c30d7_IMG_20160913_221231

The FreeIMU_yaw_pitch_roll program of the processing takes the data from the GY-521 (the MPU6050) received by the USB serial port (sent by the Arduino) and shows on the screen graphically. See below the values of the compass (magnetometer) and the PITCH and ROLL.

57d8acd7ee97b_IMG_20160913_221225

See now how is also interesting the other program FreeIMU_cube. I recorded to a video to show:

The module is cheap and one cannot expect much quality. Actually, angle values are not stable when the label's standing, making enough any serious project. I'm trying to see why this happens, but so far haven't found. Anyway, I leave the link to the GY-521, because it is very interesting:

http://www.dx.com/pt/p/gy-521-mpu6050-3-axis-acceleration-gyroscope-6dof-module-blue-154602

About Adriano

Professor, Engineer and buyer of products crazy China.

Leave a Reply

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

*