SparkFun: ITG-3200,Triple-Axis Gyro

From eLinux.org
Revision as of 20:07, 26 September 2012 by Ruff (Talk | contribs)

Jump to: navigation, search

thumb‎ Embedded Linux Class Ruffin White RHIT


Breakout board for InvenSense's ITG-3200

Overview

The ITG-3200 is a three-axis gyro that can be purchased from SparkFun. The datasheet describes it:

The ITG-3200 is the world’s first single-chip, digital-output, 3-axis MEMS gyro IC optimized for gaming, 3D mice, and 3D remote control applications. The part features enhanced bias and sensitivity temperature stability, reducing the need for user calibration. Low frequency noise is lower than previous generation devices, simplifying application development and making for more-responsive remote controls.

ITG-3200 breakout board pin-out

Inputs and Outputs

The ITG-3200 takes a supply voltage (Vs) of 1.8-3.6 V. The analog outputs are scaled proportionally to the supply voltage; at Vs = 3.6 V, the output will change by 2x for the same acceleration as compared to Vs = 1.8 V. Although the output sensitivity is scaled proportionally to the input voltage, noise is not, so higher supply voltages are advisable to reduce the impact of noise.

At all supply voltages, 0 g acceleration corresponds to an output voltage of Vs/2. At Vs = 3.6 V, the datasheet specs the typical sensitivity at 360 mV / g, with g as standard gravitational acceleration.

Connecting to the Bone

The Beagle Bone can be connected to the gyro via the I2C bus. Ground and Vcc on the breakout board should be connected to pins 1 and 2 respectively on the bone's P9 header, and the SCL and SDA pins should be connected to one of the I2C pairs on the bone. VIO should also be simply tied to Vcc, as this will be the same voltage the bone will use when acting as the master in the I2C buss. Two 4.7k resistors should used be connected between SCL and then Vcc and between SDA and Vcc. There are available resistor pads on the breakout board I you prefer to have surface mounts on the board instead of bread boarding them. I used I2C3 (P9, pins 19 and 20). The address of the magnetometer can be found by using the i2cdetect command from the shell. I get:

beagle$ i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

The address should be 0x69 (or 105 in decimal). This address can be changed by soldering an arrangement of resistors on the reserved pads on the breakout board.

Registers

the ITG-3200 has 14 8-bit registers:

Address Name Access
00 WHO_AM_I Read/Write
15 SMPLRT_DIV Read/Write
16 DLPF_FS Read/Write
17 INT_CFG Read/Write
1A INT_STATUS Read
1B TEMP_OUT_H Read
1C TEMP_OUT_L Read
1D GYRO_XOUT_H Read
1E GYRO_XOUT_L Read
1F GYRO_YOUT_H Read
20 GYRO_YOUT_L Read
21 GYRO_ZOUT_H Read
22 GYRO_ZOUT_L Read
3E PWR_MGM Read/Write

The sensor values for each axis are 16-bit and are stored across 2 registers each. GYRO_#OUT_H and GYRO_#OUT_L where # is just letter for the axis. Will have to get the two halves of the 16-bit signed measurement to read the entire value..

Sample C Code

Header File

Features

Digital-output X-, Y-, and Z-Axis angular rate sensors (gyros) on one integrated circuit Digitally-programmable low-pass filter Low 6.5mA operating current consumption for long battery life Wide VDD supply voltage range of 2.1V to 3.6V Standby current: 5μA Digital-output temperature sensor Fast Mode I2C (400kHz) serial interface Optional external clock inputs of 32.768kHz or 19.2MHz to synchronize with system clock Pins broken out to a breadboard friendly 7-pin 0.1" pitch header

Dimensions

0.70 x 0.55" (17.78 x 13.97mm)

Documents

Schematic

Eagle Files

Quickstart Guide

ITG-3200 Datasheet

Code (ATmega328)

Example

Sparkfun




thumb‎ Embedded Linux Class Ruffin White RHIT