Crowtail-IMU-10DOF

From Elecrow
(Difference between revisions)
Jump to: navigation, search
(Specification)
(Usage)
Line 28: Line 28:
 
*Pressure altimeter Accuracy: 0.02hPa (0.17m).
 
*Pressure altimeter Accuracy: 0.02hPa (0.17m).
  
== Usage ==
+
== Usage ==
This demo is going to show you how to read temperature and humidity information from this Crowtail - HTU21D Humidity&Temperature Sensor.
+
  
1.Hardware Connection<br>
+
=== Hardware===
The HTU21D Humidity&Temperature Sensor is connecting to digital port D5 of Crowtail - Base Shield.
+
Connect the Crowtail- Accelerometer&Gyro to the Crowtail base board as below:<BR>
 +
[[file:connection of Accelerometer&Gyro.jpg|600px]]
  
[[File:connection of HTU21D Humidity&Temperature Sensor.jpg |600px]]
+
=== Programming  ===
 
+
Download the [http://www.elecrow.com/wiki/index.php?title=File:MPU6050.zip  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.  
2.Download the [http://www.elecrow.com/wiki/index.php?title=File:SparkFunHTU21D.zip  HTU21D Humidity&Temperature Sensor] Library. Unzip and put it in the libraries file of Arduino IDE by the path: ..File/arduino IDE/Arduino/library/SparkFunHTU21D. You can also copy the following program to Arduino IDE and upload to your Arduino/Crowduino.  
+
 
<BR>
 
<BR>
 
3.Open “SparkFunHTU21D” example:
 
 
<pre>
 
<pre>
  
#include <Wire.h>
+
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
#include "SparkFunHTU21D.h"
+
// is used in I2Cdev.h
 +
#include "Wire.h"
  
//Create an instance of the object
+
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
HTU21D myHumidity;
+
// for both classes must be in the include path of your project
 +
#include "I2Cdev.h"
 +
#include "MPU6050.h"
  
void setup()
+
// class default I2C address is 0x68
{
+
// specific I2C addresses may be passed as a parameter here
  Serial.begin(9600);
+
// AD0 low = 0x68 (default for InvenSense evaluation board)
  Serial.println("HTU21D Example!");
+
// AD0 high = 0x69
 +
MPU6050 accelgyro;
  
  myHumidity.begin();
+
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()
+
void loop() {
{
+
    // read raw accel/gyro measurements from device
  float humd = myHumidity.readHumidity();
+
    accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
  float temp = myHumidity.readTemperature();
+
 
 +
    // these methods (and a few others) are also available
 +
    //accelgyro.getAcceleration(&ax, &ay, &az);
 +
    //accelgyro.getRotation(&gx, &gy, &gz);
  
  Serial.print("Time:");
+
    // display tab-separated accel/gyro x/y/z values
  Serial.print(millis());
+
    Serial.print("a/g:\t");
  Serial.print(" Temperature:");
+
    Serial.print(ax); Serial.print("\t");
  Serial.print(temp, 1);
+
    Serial.print(ay); Serial.print("\t");
  Serial.print("C");
+
    Serial.print(az); Serial.print("\t");
  Serial.print(" Humidity:");
+
    Serial.print(gx); Serial.print("\t");
  Serial.print(humd, 1);
+
    Serial.print(gy); Serial.print("\t");
  Serial.print("%");
+
    Serial.println(gz);
  
  Serial.println();
+
    // blink LED to indicate activity
  delay(1000);
+
    blinkState = !blinkState;
 +
    digitalWrite(LED_PIN, blinkState);
 
}
 
}
  
 
</pre>
 
</pre>
4.Upload it into your Arduino board and open the serial monitor to observe the temperature and relative humidity information of the environment.
 
  
[[File:result of HTU21D Humidity&Temperature Sensor.png |400px]]
+
Open the Sscom32 terminal or the Serial moniter , and set the baudrate to 38400, you will see: <BR>
 +
[[file:Accelerometer&Gyro result.png|400px]]

Revision as of 08:57, 9 February 2017

Contents

Description

The crowtail-IMU-10DOF is a 10-axis sensor that can be used for motion pose monitoring, and can also read azimuth, altitude and temperature. Very suitable for use in DIY aircraft or balance robot for human-computer interaction.

The onboard MPU9255 incorporates a 3-axis accelerometer, a 3-axis gyroscope and a 3-axis magnetometer. The built-in digital motion processing engine reduces the processor load. Compared to the MPU6050, with lower power consumption, more suitable for wear equipment. Onboard BMP180 (barometric altimeter), built-in temperature sensor, can be temperature compensation.

10-axis data can be acquired only through the IIC interface.

Model:Crowtail-IMU-10DOF

400px

Specification

  • Power supply range: 3.3 to 5.5V.
  • Accelerometer resolution: 16 bits.
  • Accelerometer measurement range: ± 2, ± 4, ± 8, ± 16g.
  • Accelerometer operating current: 450mA.
  • Gyro resolution: 16 bits.
  • Gyro measurement range: ± 250, ± 500, ± 1000, ± 2000 ° / s.
  • Gyroscope operating current: 3.2mA.
  • Magnetometer resolution: 14 or 16 bits.
  • Magnetometer measurement range: ± 4800uT.
  • Magnetometer operating current: 280uA.
  • Barometric altimeter resolution: 16 to 19 bits.
  • Pressure altimeter measurement Range: 300hPa (+9000 m) to 11hPa (-500m).
  • Pressure altimeter Accuracy: 0.02hPa (0.17m).

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