Crowtail- Accelerometer&Gyro

From Elecrow
(Difference between revisions)
Jump to: navigation, search
(Resource)
(Resource)
Line 102: Line 102:
 
Open the Sscom32 terminal or the Serial moniter , and set the baudrate to 38400, you will see: <BR>
 
Open the Sscom32 terminal or the Serial moniter , and set the baudrate to 38400, you will see: <BR>
 
[[file:Accelerometer&Gyro result.png|400px]]
 
[[file:Accelerometer&Gyro result.png|400px]]
 
== Resource  ==
 
 
*[http://www.elecrow.com/wiki/index.php?title=File:DigitalAccelerometer_ADXL345.zip Crowtail- 3-Axis Digital Accelerometer Program]
 
*[http://www.elecrow.com/wiki/index.php?title=File:Crowtail-_3-Axis_Digital_Accelerometer.zip Crowtail- 3-Axis Digital Accelerometer eagle files]
 

Revision as of 07:20, 8 February 2017

Contents

Description

The MPU-6050 Motion Processing Unit is the world's first motion processing solution with integrated 9-Axis sensor fusion using its field-proven and proprietary MotionFusion engine for handset and tablet applications, game controllers, motion pointer remote controls, and other consumer devices. The MPU-60X0 has an embedded 3-axis MEMS gyroscope, a 3-axis MEMS accelerometer, and a Digital Motion Processor hardware accelerator engine with an auxiliary I2C port that interfaces to 3 party digital sensors such as magnetometers. When connected to a 3-axis magnetometer, the MPU-60X0 delivers a complete 9-axis MotionFusion output to its primary I2C or SPI port (SPI is available on MPU-6000 only). The MPU-60X0 combines acceleration and rotational motion plus heading information into a single data stream for the application. This MotionProcessing technology integration provides a smaller footprint and has inherent cost advantages compared to discrete gyroscope plus accelerometer solutions. The MPU-60X0 is also designed to interface with multiple non-inertial digital sensors, such as pressure sensors, on its auxiliary I2C port. The MPU-60X0 is a 2nd generation motion processor and is footprint compatible with the MPU-30X0 family.


Model:Accelerometer&Gyro.html Crowtail- Accelerometer&Gyro

400px

Specification

  • Operating Voltage: 3.0 to 6.0V.
  • Measure dimension: Acceleration: 3D, angular velocity: 3D, attitude angle: 3D .
  • Current consumption: not more than 10mA.
  • Measuring range:Acceleration:±16g, angular velocity: ±2000 degree per second.
  • Measurement error:Acceleration:±6.1e-5g, angular velocity: ±7.6e-3 degree per second.
  • Stability: Acceleration:0.001g, angular velocity: 0.02 degree per second.
  • Data output frequency: 100Hz(115200bps)/ 20Hz(9600bps).
  • Data interface: UART or I2C.
  • RoHS/WEEE lead-free compliant
  • Crowtail compatible interface

Usage

Hardware

Connect the Crowtail- Accelerometer&Gyro to the Crowtail base board as below:
Connection of Accelerometer&Gyro.jpg

Programming

Download the MPU6050 Library. Unzip and put it in the libraries file of Arduino IDE by the path: ..File/arduino IDE/Arduino/library/MPU6050. You can also copy the following program to Arduino IDE and upload to your Arduino/Crowduino.


// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#include "Wire.h"

// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"
#include "MPU6050.h"

// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 accelgyro;

int16_t ax, ay, az;
int16_t gx, gy, gz;

#define LED_PIN 13
bool blinkState = false;

void setup() {
    // join I2C bus (I2Cdev library doesn't do this automatically)
    Wire.begin();

    // initialize serial communication
    // (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
    // it's really up to you depending on your project)
    Serial.begin(38400);

    // initialize device
    Serial.println("Initializing I2C devices...");
    accelgyro.initialize();

    // verify connection
    Serial.println("Testing device connections...");
    Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");

    // configure Arduino LED for
    pinMode(LED_PIN, OUTPUT);
}

void loop() {
    // read raw accel/gyro measurements from device
    accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

    // these methods (and a few others) are also available
    //accelgyro.getAcceleration(&ax, &ay, &az);
    //accelgyro.getRotation(&gx, &gy, &gz);

    // display tab-separated accel/gyro x/y/z values
    Serial.print("a/g:\t");
    Serial.print(ax); Serial.print("\t");
    Serial.print(ay); Serial.print("\t");
    Serial.print(az); Serial.print("\t");
    Serial.print(gx); Serial.print("\t");
    Serial.print(gy); Serial.print("\t");
    Serial.println(gz);

    // blink LED to indicate activity
    blinkState = !blinkState;
    digitalWrite(LED_PIN, blinkState);
}

Open the Sscom32 terminal or the Serial moniter , and set the baudrate to 38400, you will see:
Accelerometer&Gyro result.png

Personal tools
Namespaces

Variants
Actions
Elecrow Store
Navigation
Elecrow Products
Toolbox