Home > Projects > Sensor – Transducer – Detector Projects > L3G4200D Tripple Axis Gyroscope + Arduino

L3G4200D Tripple Axis Gyroscope + Arduino

Summary of L3G4200D Tripple Axis Gyroscope + Arduino


Summary: The article describes using the L3G4200D three-axis gyroscope with an Arduino via I2C. It explains what gyros measure (angular velocity), why they complement accelerometers, and notes selectable scale ranges (250, 500, 2000 °/s). The guide focuses on a simple I2C hookup: connect SDA and SCL to the Arduino (A4/A5 on most boards, D20/D21 on Mega). The board supports SPI and I2C and offers extra features like programmable interrupts.

Parts used in the L3G4200D Gyroscope Project:

  • L3G4200D 3-axis gyroscope breakout (from SparkFun)
  • Arduino (any model; Uno/Nano or Mega noted)
  • Wiring/jumper wires for connections
  • Power source for the Arduino
  • Optional: breadboard for prototyping
Before we begin, just note, that while this all works, I believe the output is scaled wrong. The noise floor is very high. But from everything I have found it looks like this is how it is.
We have covered, accelerometers, GPSs, compasses… But no gyros. Why? Not sure, but I figured today I would put an end to that, so I grabbed a L3G4200D 3-axis gyro from sparkfun.

The L3G4200D is a 3-axis angular rate sensor, aka gyro/gyroscope with a user selectable 250, 500 or 2000º/Sec scale. I was about to write about what a gyro is, but Sparkfun has done a really great job of that, so to quote them:

Gyroscopes measure angular velocity, how fast something is spinning about an axis. If you’re trying to monitor the orientation of an object in motion, an accelerometer may not give you enough information to know exactly how it’s oriented. Unlike accelerometers gyros are not affected by gravity, so they make a great complement to each other. You’ll usually see angular velocity represented in units of rotations per minute (RPM), or degrees per second (°/s). The three axes of rotation are either referenced as x, y, and z, or roll, pitch, and yaw.

Hooking It Up

The L3G4200D has a lot of pins on it because it supports both SPI and I2C but also has some other features as well such as programmable interrupts. We are going to go as simple with this as possible.

The L3G4200D supports both SPI and I2C, but we are just going to talk I2C here. I2C is a 2-wire serial connection, so you just need to connect the SDA (Data) and SCL (Clock) lines to your Arduino for communication. On your Arduino (everything but the mega) SDA is on analog pin 4, and SCL is on analog pin 5. On an arduino mega, SDA is digital 20, and SCL is digital 21.

For more detail: L3G4200D Tripple Axis Gyroscope + Arduino

Quick Solutions to Questions related to L3G4200D Gyroscope Project:

  • What does the L3G4200D measure?
    The L3G4200D measures angular velocity (degrees per second) on three axes.
  • Why use a gyro with an accelerometer?
    Gyros are not affected by gravity and provide angular velocity, complementing accelerometers for orientation tracking.
  • What scale ranges does the L3G4200D support?
    The sensor supports selectable scales of 250, 500, or 2000 degrees per second.
  • Does the L3G4200D support I2C or SPI?
    The L3G4200D supports both I2C and SPI communication interfaces.
  • How do I connect the L3G4200D to an Arduino using I2C?
    Connect SDA and SCL from the L3G4200D to the Arduino SDA and SCL pins (A4 and A5 on most Arduinos, D20 and D21 on the Mega).
  • Which Arduino pins are SDA and SCL on a Mega?
    On an Arduino Mega, SDA is digital 20 and SCL is digital 21.
  • Are there additional features on the L3G4200D breakout?
    Yes, the breakout includes additional features such as programmable interrupts.
  • Is I2C a two-wire connection?
    Yes, I2C uses two wires: SDA (data) and SCL (clock).

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top