Home PageItg3200

ITG3200

The ITG3200 is a 3 axis gyroscope. It is one of the components in the Aeroquad shield. Looking to buy or find the datasheetLook here.

  • 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 with adress at 0x69 or 0x68
  • 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)

shop button

 

You can clearly see that the jumper connected to pin9 of the ITG3200 is connected to VDD which means the software should take the HIGH adress 0x69.
The two pull up resistors are also not mounted. The datasheet can be found here http://www.sparkfun.com/datasheets/Sensors/Gyro/ITG-3200-v10.pdf

ITG3200frontITG3200backITG32003axisgyro

 

ITG3200 software

There are many libraries for the ITG3200. I found the best to be at Fabio Varesano’s site.
http://www.varesano.net/projects/hardware/FreeIMU
Below you can see a short program which demonstrates the some of the capabilities of the ITG3200.
Here the Pitch and Roll angles are calculated. The screenshots are the ouput from the program.  The first three colums are the calibrates values from the gyro in degrees per second.
The last two are the Pitch and Roll angles in degrees. Over a short time period these are accurate but you can clearly see the drift which is typical in gyros.
In only a few minutes the drift is already at 10 degrees for Roll and 11 degrees for Pitch and this with a stationary gyro.
It means that you can not determine the exact angle of the gyro over a long period of time. This is the reason that gyros are often fused with accelerometers to get reliable data.
You can download it this program from here.

Show »

// ITG-3200_test
// Copyright 2010-2011 Filipe Vieira & various contributors.
// http://code.google.com/p/itg-3200driver
// Simple test of gyro sensors output using default settings.

#include
#include

ITG3200 gyro = ITG3200();
float  x,y,z;
int ix, iy, iz;
float timeStep = 0.2;          //200ms. Need a time step value for integration of gyro angle from angle/sec
unsigned long timer;
float pitchGyro = 0;
float rollGyro = 0;

void setup(void) {
Serial.begin(9600);
Wire.begin();      // if experiencing gyro problems/crashes while reading XYZ values
// please read class constructor comments for further info.
delay(1000);
// Use ITG3200_ADDR_AD0_HIGH or ITG3200_ADDR_AD0_LOW as the ITG3200 address
// depending on how AD0 is connected on your breakout board, check its schematics for details
gyro.init(ITG3200_ADDR_AD0_HIGH);

Serial.print("zeroCalibrating...");
gyro.zeroCalibrate(2500, 2);
Serial.println("done.");
}

void loop(void) {

//    while (gyro.isRawDataReady()) {
timer = millis(); //get a start value to determine the time the loop takes
// Reads calibrated values in deg/sec
gyro.readGyro(&x,&y,&z);
Serial.print("tX:");
Serial.print(x);
Serial.print("tY:");
Serial.print(y);
Serial.print("tZ:");
Serial.print(z);
Serial.print("t");
rollGyro = rollGyro + ( x ) * timeStep;
pitchGyro = pitchGyro + ( y ) * timeStep;
Serial.print(pitchGyro);
Serial.print("t");
Serial.println(rollGyro);
timer = millis() - timer;          //how long did the loop take?
timer = (timeStep * 1000) - timer; //how much time to add to the loop to make it last time step msec
delay(timer);                      //make one loop last time step msec
//    }
}

ITG3200output1

and a few minutes later.

ITG3200output2

You can use the same processing piece of code as with the BMA180 accelerometer to visualise the angles as an artificial horizon.
This code you can get from http://arduino-projects4u.com/bma180/

ITG3200horizon

ITG3200 links.

http://code.google.com/p/itg-3200driver/

 

Leave a Reply