10 DOF Mems IMU Sensor (Arduino Compatible) v2.0 wiki - DFRobot

Introduction

10 DOF Mems IMU Sensor V2.0

At the beginning,the inertial measurement unit is an electronic device that measures and reports on a craft's velocity, orientation, and gravitational forces, using a combination of accelerometers,gyroscopes, and magnetometers. Now IMUs are commonly used in the Human-computer interaction(HCI), navigational purposes and balancing technology used in the Segway Personal Transporter as we all known.

Version Upgrade: V2.0 has upgraded the barometer sensor IC to BMP280.

Applications

Specification

Connection Diagram

10 DOF IMU Sensor V2.0 Connection Diagram

Sample Code 1

Please download following library first.


#include <FreeSixIMU.h>
#include <FIMU_ADXL345.h>
#include <FIMU_ITG3200.h>

#include <Wire.h>

float angles[3]; // yaw pitch roll

// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();

void setup() {
  Serial.begin(9600);
  Wire.begin();

  delay(5);
  sixDOF.init(); //begin the IMU
  delay(5);
}

void loop() {

  sixDOF.getEuler(angles);

  Serial.print(angles[0]);
  Serial.print(" | ");
  Serial.print(angles[1]);
  Serial.print(" | ");
  Serial.println(angles[2]);

  delay(100);
}

Open the arduino IDE serial monitor, you will get Yaw; Pitch; Roll value:

Yaw; Pitch; Roll Value

Sample Code 2

BMP280 Barometer & Temperature Test

/*!
 * @file bmp280test.ino
 * @brief DFRobot's Temperature、Pressure and Approx altitude
 * @n [Get the module here](等上架后添加商品购买链接)
 * @n This example read the Temperature、Pressure and Altitude from BMP280, and then print them
 * @n [Connection and Diagram](等上架后添加wiki链接)
 *
 * @copyright   [DFRobot](https://www.dfrobot.com), 2016
 * @copyright   GNU Lesser General Public License
 *
 * @author [yuxiang](1137717512@qq.com)
 * @version  V1.0
 * @date  2016-12-06
 */

#include <Wire.h>
#include "DFRobot_BMP280.h"

DFRobot_BMP280 bmp280;

void setup() {
  Serial.begin(9600);
  Serial.println("BMP280 demo");

  if (!bmp280.begin()) {
    Serial.println("Could not find a valid BMP280 sensor!");
    while (1);
  }
}

void loop() {
    Serial.print("Temperature = ");
    Serial.print(bmp280.readTemperatureValue());
    Serial.println(" *C");

    Serial.print("Pressure = ");
    Serial.print(bmp280.readPressureValue());
    Serial.println(" Pa");

    Serial.print("Altitude = ");
    Serial.print(bmp280.readAltitudeValue(1013.25)); // this should be adjusted to your local forcase
    Serial.println(" m");

    Serial.println();
    delay(2000);
}

Temperature & Barometer Value

More Documents