Difference between revisions of "MPU6050 Module"
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=='''Introduction'''== | =='''Introduction'''== | ||
− | [[File:mpu6050.png]]<br> | + | [[File:mpu6050.png]][[File:Mpu6050-1.jpg]]<br> |
The MPU-6050 is the world’s first and only 6-axis motion tracking devices designed for the low power, low cost, and high performance requirements of smartphones, tablets and wearable sensors.<br> | The MPU-6050 is the world’s first and only 6-axis motion tracking devices designed for the low power, low cost, and high performance requirements of smartphones, tablets and wearable sensors.<br> | ||
=='''Experimental Procedures'''== | =='''Experimental Procedures'''== | ||
===Step 1: Connect the circuit=== | ===Step 1: Connect the circuit=== | ||
See the following table for connection between the I2C LCD2004 and the SunFounder Uno board:<br> | See the following table for connection between the I2C LCD2004 and the SunFounder Uno board:<br> | ||
− | + | ||
− | + | ||
{| border="1" class="wikitable" | {| border="1" class="wikitable" | ||
|- | |- | ||
Line 23: | Line 22: | ||
|align="center"|SCL | |align="center"|SCL | ||
|align="center"|A5 | |align="center"|A5 | ||
+ | |- | ||
+ | |align="center"|INT | ||
+ | |align="center"|D2 | ||
|} | |} | ||
− | |||
− | + | [[File:Untitled Sketch 2_bb.png]] <br> | |
+ | ===Step 2:Add library=== | ||
+ | Open Arduino IDE, then click Sketch -> Include Library -> Add ZIP Library, and select MPU6050.zip to include.<br> | ||
+ | After including successfully, you can see the example in File -> Examples -> MPU6050 as shown.<br> | ||
+ | [[File:lib1.png]] <br> | ||
+ | ===Step 3: Get Drift Compensation Values=== | ||
+ | The MPU6050 sensor’s reading (raw data) is transformed in space attitude angle. To get more stable and accurate reading, we should set the drift compensation first. The drift differs for different sensors (also affected by environments), thus it’s necessary to configure it before using every time.<br> | ||
+ | Download mpu6050_calibration in folder examples, select the board type and COM. Open the serial monitor after program uploading, set the baud rate to 115200, and place the MPU6050 horizontally, do not move to avoid any vibration disturbance. Then press any key and click enter. So here you can see the compensation values are 1721, -1885, 1368, 38, -25, and 18, corresponding to six parameters including acceleration (AcceX, AcceY, and AcceZ) and gyroscope (GyroX, GyroY, and GyroZ).<br> | ||
+ | [[File:mpu6050 jz.png]] <br> | ||
+ | ===Step 4: Reading Real-time Data=== | ||
+ | Then go back to the interface of the example mpu6050_DMP6 after including, and go to line 128. Enter the compensation value for “GyroX, GyroY, GyroZ and AcceZ” (as shown in figure below)<br> | ||
+ | [[File:mpu6050cs.png]] <br> | ||
+ | Then upload the program, press any key and click Enter in the serial monitor. Move the MPU6050 and observe the real-time data (as shown in figure below).<br> | ||
+ | [[File:mpu6050ck.png]] <br> | ||
=='''Resource'''== | =='''Resource'''== | ||
− | + | For Arduino Library file download address: [http://wiki.sunfounder.cc/images/1/1b/MPU_6050.zip MPU_6050.zip][[File:LINK.jpg]]<br> | |
[https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/lesson-32-mpu6050-gyro-acceleration-sensor-sensor-kit-v2-0-for-b-plus.html Test Experiment for Raspberry Pi][[File:LINK.jpg]] | [https://www.sunfounder.com/learn/sensor-kit-v2-0-for-raspberry-pi-b-plus/lesson-32-mpu6050-gyro-acceleration-sensor-sensor-kit-v2-0-for-b-plus.html Test Experiment for Raspberry Pi][[File:LINK.jpg]] |
Latest revision as of 08:03, 6 September 2019
Contents
Introduction
The MPU-6050 is the world’s first and only 6-axis motion tracking devices designed for the low power, low cost, and high performance requirements of smartphones, tablets and wearable sensors.
Experimental Procedures
Step 1: Connect the circuit
See the following table for connection between the I2C LCD2004 and the SunFounder Uno board:
MPU6050 | SunFounder uno Board |
---|---|
GND | GND |
VCC | 5V |
SDA | A4 |
SCL | A5 |
INT | D2 |
Step 2:Add library
Open Arduino IDE, then click Sketch -> Include Library -> Add ZIP Library, and select MPU6050.zip to include.
After including successfully, you can see the example in File -> Examples -> MPU6050 as shown.
Step 3: Get Drift Compensation Values
The MPU6050 sensor’s reading (raw data) is transformed in space attitude angle. To get more stable and accurate reading, we should set the drift compensation first. The drift differs for different sensors (also affected by environments), thus it’s necessary to configure it before using every time.
Download mpu6050_calibration in folder examples, select the board type and COM. Open the serial monitor after program uploading, set the baud rate to 115200, and place the MPU6050 horizontally, do not move to avoid any vibration disturbance. Then press any key and click enter. So here you can see the compensation values are 1721, -1885, 1368, 38, -25, and 18, corresponding to six parameters including acceleration (AcceX, AcceY, and AcceZ) and gyroscope (GyroX, GyroY, and GyroZ).
Step 4: Reading Real-time Data
Then go back to the interface of the example mpu6050_DMP6 after including, and go to line 128. Enter the compensation value for “GyroX, GyroY, GyroZ and AcceZ” (as shown in figure below)
Then upload the program, press any key and click Enter in the serial monitor. Move the MPU6050 and observe the real-time data (as shown in figure below).
Resource
For Arduino Library file download address: MPU_6050.zip
Test Experiment for Raspberry Pi