+ All Categories
Home > Devices & Hardware > MPU6050 IMU with Arduino

MPU6050 IMU with Arduino

Date post: 17-Feb-2017
Category:
Upload: yeokm1
View: 969 times
Download: 2 times
Share this document with a friend
12
MPU-6050 Inertia Measurement Unit (IMU) with Arduino By: Yeo Kheng Meng (yeokm1@gmai https://github.com/SustainableLivingLab/imu-mpu6050 artathon (20 Feb 2016) signathon (9 Jan 2016) 1
Transcript
Page 1: MPU6050 IMU with Arduino

1

MPU-6050 Inertia Measurement Unit

(IMU)with Arduino

By: Yeo Kheng Meng ([email protected])https://github.com/SustainableLivingLab/imu-mpu6050-usageStartathon (20 Feb 2016)

Designathon (9 Jan 2016)

Page 2: MPU6050 IMU with Arduino

2

Equipment check1. Laptop installed with Arduino IDE• https://www.arduino.cc/en/Main/Software

2. Arduino Uno3. USB cable4. MPU-60505. Breadboard6. At least 5 jumper wires

Page 3: MPU6050 IMU with Arduino

3

What is an IMU?• Inertia Measurement Unit• Measures rate of change of movement via acceleration

sensors along the axes• Commonly called accelerometers

• Measures orientation changes via gyroscopic sensors

Page 4: MPU6050 IMU with Arduino

4

What is MPU-6050?

• An IMU that includes a temperature sensor• Accelerometer + Gyroscope -> 6 degrees of freedom

Note the axes

Page 5: MPU6050 IMU with Arduino

5

6 degrees of freedom

• Accelerometer: Left-Right, Back-Forward, Up-Down• Gyroscope: Pitch, Roll, Yaw

Page 6: MPU6050 IMU with Arduino

6

Connectivity with Arduino

Source: http://diyhacking.com/arduino-mpu-6050-imu-sensor-tutorial/

Page 7: MPU6050 IMU with Arduino

7

Code• Download and extract zip file• https://github.com/yeokm1/imu-mpu6050-usage• Remove “-master” from directory name• imu-mpu6050-usage-master -> imu-mpu6050-usage

• Open “imu-mpu6050-usage.ino”

Page 8: MPU6050 IMU with Arduino

8

Concept of I²C• Two-wire connection between components• SDA and SCL

• One master and many slaves• Master: Arduino• Slave: MPU6050• Every slave has its own address• MPU6050 default address = 0x68

Page 9: MPU6050 IMU with Arduino

9

Arduino I²C command structure• Start I2C transmission• Wire.beginTransmission(“address”)

• Set register to write to• Wire.write(“register”)

• Read/Write to register• Wire.read(), Wire.write(“value”)

• End I2C transmission• Wire.endTransmission(true);

Page 10: MPU6050 IMU with Arduino

10

MPU-6050 results

• Open Serial Monitor and observe results• Try rocking the IMU side to side/rotating/moving in a regular manner• Accelerometer results

• AcX, AcY and AcZ

• Gyroscope results• GyX, GyY and GyZ

Page 11: MPU6050 IMU with Arduino

11

Making sense of the results• Disable autoscroll• Copy paste values to spreadsheet like Excel• Select column A• Data Tab, Text to columns, Delimited, tick Space, Finish

• Add an empty row above the first row• Add column titles above values on first row

• AcX, AcY, AcZ, GyX, GyY, GyZ

• Delete unused rows• Creating a chart

• Select only the 6 columns• Insert Tab, Line chart• See how the data corresponds to the movement

Page 12: MPU6050 IMU with Arduino

12

Some sample results


Recommended