Arduino and L3GD20 sensor

The L3GD20 is a low-power three-axis angular rate sensor. This is the module I bought for reference

Key Features

  • Three selectable full scales (250/500/2000 dps)
  • I2 C/SPI digital output interface
  • 16 bit-rate value data output
  • 8-bit temperature data output
  • Two digital output lines (interrupt and data ready)
  • Integrated low- and high-pass filters with user-selectable bandwidth
  • Wide supply voltage: 2.4 V to 3.6 V
  • Low voltage-compatible IOs (1.8 V)
  • Embedded power-down and sleep mode
  • Embedded temperature sensor
  • Embedded FIFO
  • High shock survivability

Here is a schematic showing the module I had, the module has an on board 3.3v voltage regulator

 

Connection

Arduino Connection GY-50 L3GD20 connection
5v Vcc
Gnd Gnd
SDA – Arduino Uno A4 SDA
SCL – Arduino Uno A5 SCL

 

Code

I used the following library – https://github.com/pololu/l3g-arduino

This is the test example

#include <Wire.h>
#include <L3G.h>
 
L3G gyro;
 
void setup() {
  Serial.begin(9600);
  Wire.begin();
 
  if (!gyro.init())
  {
    Serial.println("Failed to autodetect gyro type!");
    while (1);
  }
 
  gyro.enableDefault();
}
 
void loop() {
  gyro.read();
 
  Serial.print("G ");
  Serial.print("X: ");
  Serial.print((int)gyro.g.x);
  Serial.print(" Y: ");
  Serial.print((int)gyro.g.y);
  Serial.print(" Z: ");
  Serial.println((int)gyro.g.z);
 
  delay(100);
}

 

 

Links

About $4 for one of these sensors

L3GD20 3-axis Gyroscope Sensor replace L3G4200D Angular velocity module

Related posts

Arduino Uno and PCT2075 temperature sensor

Arduino Uno and AHT20 Integrated temperature and humidity Sensor

Arduino Uno and LTR390 UV Light Sensor

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More