Connecting MPU6050 Module with Arduino

The MPU-6050 sensor module contains an accelerometer and a gyro in a single chip. It is very accurate, as it contains 16-bits analog to digital conversion hardware for each channel. Therefore it captures the x, y, and z channel at the same time. The sensor uses the I2C-bus to interface with the Arduino

Buy MPU6050 Modulempu6050

In rundown, this application note is about how to have the Arduino correspond with IMUs., how to compose the code which will advise Arduino to peruse the information from the sensors, the best approach to have the product presentation caught information in the serial screen in an instinctive structure, and the technique for time stamping the information.

Adding  Arduino Libraries

Once the product set up is done, client can continue to next step – including libraries. Libraries are a gathering of code that makes it simple for clients to utilize the elements of an Arduino.



Arduino programming accompanies some form in libraries like SPI, WiFi and SD. Including extra libraries can expand the capacity of Arduino. It is likewise required if client need to associate extra parts like sensor, showcase and modules to Arduino. In the group’s configuration venture, two vital libraries included are “MPU6050” and “I2Cdev”.

MPU6050 library is utilized for MPU6050 sensor, which is a prior variant of MPU9150. The distinction between them is MPU6050 is a 6-pivot movement catch sensor made out of a 3-hub accelerometer and a 3-hub spinner. MPU9150 is a more up to date variant which is equipped for doing 9-pivot estimation with an extra magnetometer. In light of the closeness shared by the two sensors, a MPU6050 library is effectively altered to be perfect with MPU9150.

So as to include the vital library, firstly, download the MPU6050 libraries from official website, the libraries disseminated are ZIP records. Uncompress the ZIP file, and duplicate the craved libraries envelope into the product’s libraries’ organize

Arduino Sketch

The three primary libraries are one form in library named “Wire.h” and two extra libraries included by group named “I2Cdev.h” and “MPU6050.h”.

Since the correspondence picked in the configuration task is I2C, relating libraries should be included development to dynamic the correspondence. Between the two libraries identified with I2C correspondence, “Wire.h” is utilized to bolster the working of “I2Cdev.h”.

With respect to the “MPU6050.h”, it is code library particularly utilized for IMUs. Manufacture in elements of this library permits the client to get information of 9-hub estimation with one single summon, which makes the programming much simpler.

Serial.begin (baudrate) – the speed of transferring data, replace “baudrate” with number of desired speed.
Wire.begin() – active the I2C bus.


Both of the two codes are utilized for setup reason. The I2C correspondence does not consequently dynamic, along these lines utilize this fabricate in code from library trigger on the information move of I2C transport.

The Arduino support a few baud rates, i.e. 9600, 38400 etc. Higher baud rate permits more information to be transmitted in a unit time. For exactness reason, a high baud rate is picked in the outline to guarantee that a lot of information is gathered.

You can buy all project modules from our Robomart Store find the following link to buy the module.

Buy MPU6050 Module

In the next tutorial we’re going to make Computer controlled Robot with Windows application. Stay updated..