The GY-85 is a 9-axis motion sensor module that integrates an accelerometer, gyroscope, and magnetometer into a single compact board. This module is widely used for applications requiring precise orientation and motion tracking, such as robotics, drones, smartphones, and gaming devices. Its ability to measure acceleration, angular velocity, and magnetic field strength makes it a versatile choice for projects involving motion sensing and navigation.
The GY-85 module is built around three key sensors:
The GY-85 module has 6 pins for interfacing. The table below describes each pin:
Pin Name | Description |
---|---|
VCC | Power supply input (3.3V to 5V) |
GND | Ground connection |
SDA | I²C data line for communication |
SCL | I²C clock line for communication |
XDA | Auxiliary I²C data line (used for daisy-chaining multiple I²C devices) |
XCL | Auxiliary I²C clock line (used for daisy-chaining multiple I²C devices) |
Below is an example Arduino sketch to read data from the GY-85 module:
#include <Wire.h>
// I²C addresses for the sensors
#define ADXL345_ADDR 0x53 // Accelerometer
#define ITG3200_ADDR 0x68 // Gyroscope
#define HMC5883L_ADDR 0x1E // Magnetometer
void setup() {
Wire.begin(); // Initialize I²C communication
Serial.begin(9600); // Start serial communication for debugging
// Initialize ADXL345 (Accelerometer)
Wire.beginTransmission(ADXL345_ADDR);
Wire.write(0x2D); // Power control register
Wire.write(0x08); // Set measurement mode
Wire.endTransmission();
// Initialize ITG-3200 (Gyroscope)
Wire.beginTransmission(ITG3200_ADDR);
Wire.write(0x3E); // Power management register
Wire.write(0x00); // Set normal mode
Wire.endTransmission();
// Initialize HMC5883L (Magnetometer)
Wire.beginTransmission(HMC5883L_ADDR);
Wire.write(0x00); // Configuration register A
Wire.write(0x70); // Set 8-average, 15 Hz default
Wire.endTransmission();
}
void loop() {
// Read data from ADXL345 (Accelerometer)
Wire.beginTransmission(ADXL345_ADDR);
Wire.write(0x32); // Start reading from data registers
Wire.endTransmission(false);
Wire.requestFrom(ADXL345_ADDR, 6); // Request 6 bytes (X, Y, Z)
int16_t ax = Wire.read() | (Wire.read() << 8);
int16_t ay = Wire.read() | (Wire.read() << 8);
int16_t az = Wire.read() | (Wire.read() << 8);
// Print accelerometer data
Serial.print("Accel X: "); Serial.print(ax);
Serial.print(" Y: "); Serial.print(ay);
Serial.print(" Z: "); Serial.println(az);
delay(500); // Delay for readability
}
No Data from Sensors:
Inaccurate Readings:
Module Not Detected:
Can the GY-85 work with 5V microcontrollers?
How do I calibrate the magnetometer?
Adafruit_Sensor
can help.Can I use the GY-85 with other I²C devices?
By following this documentation, you can effectively integrate the GY-85 module into your projects for accurate motion and orientation sensing.