Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit L3GD20H Triple-Axis Gyro Breakout Board: Examples, Pinouts, and Specs

Image of Adafruit L3GD20H Triple-Axis Gyro Breakout BoardDesign with Adafruit L3GD20H Triple-Axis Gyro Breakout Board in Cirkit Designer

Introduction

The Adafruit L3GD20H Triple-Axis Gyro Breakout Board is a compact and versatile sensor designed to measure angular velocity along three perpendicular axes: pitch, roll, and yaw. This makes it an ideal component for applications in robotics, motion sensing, and stabilization systems. The board features the L3GD20H gyroscope chip, which provides high-resolution measurements and is capable of detecting rates with a high degree of accuracy.

Explore Projects Built with Adafruit L3GD20H Triple-Axis Gyro Breakout Board

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Adafruit MPU6050 and VL6180X Sensor Interface with Servo Control: A project utilizing Adafruit L3GD20H Triple-Axis Gyro Breakout Board in a practical application
Adafruit MPU6050 and VL6180X Sensor Interface with Servo Control

This circuit features an Adafruit QT Py microcontroller interfaced with an Adafruit MPU6050 6-axis accelerometer/gyroscope and an Adafruit VL6180X Time of Flight (ToF) distance sensor, both connected via I2C communication. The QT Py also controls a Servomotor SG90, likely for physical actuation based on sensor inputs. The embedded code initializes the sensors, reads their data, and outputs the readings to a serial monitor, with the potential for motion control based on the sensor feedback.

Open Project in Cirkit Designer
Image of ESP32-Based Multi-Sensor Interface with GSM and Display: A project utilizing Adafruit L3GD20H Triple-Axis Gyro Breakout Board in a practical application
ESP32-Based Multi-Sensor Interface with GSM and Display

This circuit features an ESP32 Devkit V1 microcontroller as its central processing unit, interfacing with a variety of sensors and modules for monitoring and communication purposes. It includes an LCD I2C display for user interface, a SIM800L module for GSM communication, and sensors like the Adafruit L3GD20H gyro, Adafruit ADXL377 accelerometer, DS18B20 temperature sensor, and a pulse sensor for environmental and physiological data collection. The circuit also controls a red and a green LED, each with a current-limiting resistor, and a buzzer for audio feedback, all of which are likely used for status indication or alerts.

Open Project in Cirkit Designer
Image of Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer: A project utilizing Adafruit L3GD20H Triple-Axis Gyro Breakout Board in a practical application
Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer

This circuit integrates a Teensy 4.1 microcontroller with an Adafruit LIS3DH Triple-Axis Accelerometer and an AD8232 Heart Rate Monitor. The accelerometer communicates with the Teensy via I2C (SCL and SDA lines), while the heart rate monitor's output and lead-off detection (LO+ and LO-) are connected to the Teensy's analog inputs. The circuit is designed to measure both acceleration and heart rate signals, likely for a wearable or health monitoring device.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 VIN Supply voltage (2.4V to 3.6V)
2 GND Ground connection
3 SCL I2C clock line
4 SDA I2C data line
5 SA0 I2C address selection pin
6 CS Chip select for SPI (active low)
7 SDO SPI data output (MISO)
8 SDA/SPI SPI data input (MOSI)
9 SCL/SPC SPI clock

Usage Instructions

How to Use the Component in a Circuit

  1. Powering the Board:

    • Connect the VIN pin to a 2.4V to 3.6V power supply.
    • Connect the GND pin to the ground of your power supply.
  2. I2C Communication:

    • Connect the SCL pin to the I2C clock line of your microcontroller.
    • Connect the SDA pin to the I2C data line of your microcontroller.
    • If using multiple I2C devices, ensure each device has a unique address by setting the SA0 pin accordingly.
  3. SPI Communication (Optional):

    • Connect the SCL/SPC to the SPI clock line of your microcontroller.
    • Connect the SDA/SPI to the SPI MOSI line of your microcontroller.
    • Connect the SDO to the SPI MISO line of your microcontroller.
    • Control the CS pin to enable and disable the device on the SPI bus.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_L3GD20_U.h>

Adafruit_L3GD20_Unified gyro = Adafruit_L3GD20_Unified(20);

void setup(void) {
  Serial.begin(9600);
  Serial.println("Gyroscope Test"); Serial.println("");
  
  /* Initialize the sensor */
  if(!gyro.begin())
  {
    /* There was a problem detecting the L3GD20 ... check your connections */
    Serial.println("Ooops, no L3GD20 detected ... Check your wiring!");
    while(1);
  }
}

void loop(void) {
  /* Get a new sensor event */
  sensors_event_t event;
  gyro.getEvent(&event);
 
  /* Display the results (angular velocity is measured in degrees per second) */
  Serial.print("X: "); Serial.print(event.gyro.x); Serial.print(" ");
  Serial.print("Y: "); Serial.print(event.gyro.y); Serial.print(" ");
  Serial.print("Z: "); Serial.print(event.gyro.z); Serial.print(" ");
  Serial.println("deg/s");
  
  /* Delay a bit to keep serial output from being too crazy */
  delay(500);
}

This example initializes the L3GD20H sensor and continuously reads the angular velocity in degrees per second from the X, Y, and Z axes, outputting the results to the serial monitor.

Troubleshooting and FAQs

Common Issues Users Might Face

Solutions and Tips for Troubleshooting

FAQs

Q: Can the L3GD20H be used with a 5V microcontroller? A: Yes, but ensure that the VIN pin is connected to a 3.3V supply, and use logic level converters for I2C/SPI lines if necessary.

Q: How can I change the sensitivity of the sensor? A: The sensitivity can be adjusted through software using the provided library functions.

Q: What is the default I2C address of the L3GD20H? A: The default I2C address is 0x6B when SA0 is high and 0x6A when SA0 is low.

Q: How do I calibrate the gyroscope? A: Calibration involves taking multiple readings at a known stationary state and averaging them to determine an offset. This offset is then subtracted from subsequent readings.