The GY-91 is a compact sensor module manufactured by InvenSense, combining the MPU9250 (a 9-axis motion tracking device) and the BMP280 (a precision barometric pressure sensor). This module integrates a 3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer, and a barometric pressure sensor, making it ideal for applications requiring motion tracking, orientation sensing, and altitude measurement.
Parameter | Value |
---|---|
Manufacturer | InvenSense |
Part ID | MPU9250 + BMP280 |
Operating Voltage | 3.3V - 5V |
Communication Interface | I2C (default) and SPI |
Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
Gyroscope Range | ±250, ±500, ±1000, ±2000 °/s |
Magnetometer Range | ±4800 µT |
Barometric Pressure Range | 300 hPa to 1100 hPa |
Operating Temperature | -40°C to +85°C |
Dimensions | 15mm x 10mm x 2mm |
Pin Name | Description |
---|---|
VCC | Power supply input (3.3V to 5V). |
GND | Ground connection. |
SCL | I2C clock line (or SPI clock line in SPI mode). |
SDA | I2C data line (or SPI data line in SPI mode). |
CS | Chip select for SPI communication (active low). |
INT | Interrupt pin for motion detection or data-ready signals. |
NCS | Not connected (can be left floating or grounded, depending on the module). |
Below is an example of how to interface the GY-91 with an Arduino UNO using the I2C protocol. This code uses the Adafruit_Sensor
and Adafruit_BMP280
libraries for the BMP280 and the MPU9250
library for the MPU9250.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#include <MPU9250.h>
// Create instances for the sensors
Adafruit_BMP280 bmp; // BMP280 instance
MPU9250 mpu(Wire, 0x68); // MPU9250 instance with I2C address 0x68
void setup() {
Serial.begin(9600);
Wire.begin();
// Initialize BMP280
if (!bmp.begin(0x76)) { // Default I2C address for BMP280 is 0x76
Serial.println("BMP280 initialization failed!");
while (1);
}
Serial.println("BMP280 initialized successfully.");
// Initialize MPU9250
if (mpu.begin() != 0) {
Serial.println("MPU9250 initialization failed!");
while (1);
}
Serial.println("MPU9250 initialized successfully.");
}
void loop() {
// Read BMP280 data
float temperature = bmp.readTemperature();
float pressure = bmp.readPressure();
float altitude = bmp.readAltitude(1013.25); // Sea level pressure in hPa
// Read MPU9250 data
mpu.readSensor();
float accelX = mpu.getAccelX_mss();
float accelY = mpu.getAccelY_mss();
float accelZ = mpu.getAccelZ_mss();
float gyroX = mpu.getGyroX_rads();
float gyroY = mpu.getGyroY_rads();
float gyroZ = mpu.getGyroZ_rads();
float magX = mpu.getMagX_uT();
float magY = mpu.getMagY_uT();
float magZ = mpu.getMagZ_uT();
// Print sensor data
Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" °C");
Serial.print("Pressure: "); Serial.print(pressure); Serial.println(" Pa");
Serial.print("Altitude: "); Serial.print(altitude); Serial.println(" m");
Serial.print("Accel (X, Y, Z): ");
Serial.print(accelX); Serial.print(", ");
Serial.print(accelY); Serial.print(", ");
Serial.println(accelZ);
Serial.print("Gyro (X, Y, Z): ");
Serial.print(gyroX); Serial.print(", ");
Serial.print(gyroY); Serial.print(", ");
Serial.println(gyroZ);
Serial.print("Mag (X, Y, Z): ");
Serial.print(magX); Serial.print(", ");
Serial.print(magY); Serial.print(", ");
Serial.println(magZ);
delay(1000); // Wait 1 second before the next reading
}
Sensor Not Detected:
Inaccurate Readings:
Communication Errors: