Skip to content

Gyroscope TinyShield (OBSOLETE) Tutorial

The TinyShield Gyroscope features the high performance and lower power ST L3G4200D 3-axis gyroscope. The L3G4200D allows measurement of angular rates in three axes. There is also an integrated temperature sensor built in.

Learn more about the TinyDuino Platform


Technical Details

Written description of what the board does, typically links back to product page somehow.

To see what other TinyShields are compatible with this TinySheild, see the TinyShield Compatibility Matrix

Technical Details ST L3G4200D Gyroscope Specs
  • 3-axis (X, Y, & Z)
  • Three selectable full scales (250/500/2000 dps)
  • 16 bit-rate value data output
  • 8-bit temperature data output
  • Integrated low-pass and high-pass filters with user-selectable bandwidth
  • Ultra-stable over temperature and time
  • Embedded power-down and sleep mode
  • Embedded temperature sensor
  • Embedded FIFO
TinyDuino Power Requirements
  • Voltage: 3.0V - 5.5V
  • Current
    • 6.1mA (normal operation)
    • 5uA (power down mode)
    • This board can be used with the TinyDuino coin cell option, however the user should power down the gyro between readings to minimize the current draw or else battery life will be very short
Pins Used
  • A5/SCL - I2C Serial Clock line
  • A4/SDA - I2C Serial Data line
Dimensions
  • 20mm x 20mm (.787 inches x .787 inches)
  • Max Height (from lower bottom TinyShield Connector to upper top TinyShield Connector): 5.11mm (0.201 inches)
  • Weight: 1.00 grams (.04 ounces)

Notes

  • You can also use this shield without the TinyDuino – there are 0.1″ spaced connections for power, ground, and the two I2C signals along the side of the TinyShield to allow you to connect a different system.

Materials

Materials Used

Hardware

Software


Hardware Assembly

Stack the Gyroscope TinyShield and your chosen processor board of choice. If using a TinyDuino, include the USB TinyShield.

The ST L3G4200D is a low power device, drawing 6.1mA at full power mode and can be configured to draw much lower current at slower operating rates. Due to the low power, a coin cell battery is sufficient to run this board.

The Gyroscope TinyShield includes a local voltage regulator and level-shifters, so your TinyDuino system can operate from 3 to 5 Volts safely.


Software Setup

Be sure to install the L3G4200D Arduino Library before uploading your program!

Upload Program

The Gyroscope TinyShield uses the I2C bus to communicate between the TinyDuino processor and the ST L3G4200D. Below is a sample sketch to get the data for all three axises and display them on the USB serial port.

Code
/* LucidTronix L3G4200D Gyroscope Library
 * For instructions, details and schematic, See:
 * http://www.lucidtronix.com/tutorials/63
 */

#include "L3G4200D.h"
#include "Wire.h"

L3G4200D gyro;

int x, y, z;

void setup(){
  Wire.begin();
  gyro.initialize(2000);
  Serial.begin(9600);
}

void loop(){
  x = gyro.getX();
  Serial.print("X:");
  Serial.print(x);

  y = gyro.getY();
  Serial.print(" Y:");
  Serial.print(y);

  z = gyro.getZ();
  Serial.print(" Z:");
  Serial.println(z);
  delay(300); //Just here to slow down the serial to make it more readable
}

Downloads


Contact Us

If you have any questions or feedback, feel free to email us or make a post on our forum. Show us what you make by tagging @TinyCircuits on Instagram, Twitter, or Facebook so we can feature it.

Thanks for making with us!