The Grove 6-Axis Accelerometer and Gyroscope is a versatile motion sensor that integrates both an accelerometer and a gyroscope into a single module. This sensor is capable of measuring acceleration and angular velocity across three axes (X, Y, and Z), making it ideal for applications requiring precise motion tracking and orientation data.
The following table outlines the key technical details of the Grove 6-Axis Accelerometer and Gyroscope:
Parameter | Value |
---|---|
Operating Voltage | 3.3V / 5V |
Communication Protocol | I2C |
Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
Gyroscope Range | ±250°/s, ±500°/s, ±1000°/s, ±2000°/s |
Operating Temperature | -40°C to +85°C |
Dimensions | 20mm x 40mm |
The Grove 6-Axis Accelerometer and Gyroscope module has a standard Grove connector with the following pinout:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V or 5V) |
2 | GND | Ground |
3 | SDA | I2C data line |
4 | SCL | I2C clock line |
Hardware Setup:
Software Setup:
MPU6050
library from the Arduino Library Manager.Below is an example code to read acceleration and gyroscope data from the sensor:
#include <Wire.h>
#include <MPU6050.h> // Include the MPU6050 library
MPU6050 mpu; // Create an MPU6050 object
void setup() {
Serial.begin(9600); // Initialize serial communication
Wire.begin(); // Initialize I2C communication
// Initialize the MPU6050 sensor
if (!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_16G)) {
Serial.println("Could not find a valid MPU6050 sensor, check connections!");
while (1);
}
Serial.println("MPU6050 initialized successfully!");
}
void loop() {
// Read acceleration and gyroscope data
Vector rawAccel = mpu.readRawAccel();
Vector rawGyro = mpu.readRawGyro();
// Print acceleration data
Serial.print("Accel X: "); Serial.print(rawAccel.XAxis);
Serial.print(" | Accel Y: "); Serial.print(rawAccel.YAxis);
Serial.print(" | Accel Z: "); Serial.println(rawAccel.ZAxis);
// Print gyroscope data
Serial.print("Gyro X: "); Serial.print(rawGyro.XAxis);
Serial.print(" | Gyro Y: "); Serial.print(rawGyro.YAxis);
Serial.print(" | Gyro Z: "); Serial.println(rawGyro.ZAxis);
delay(500); // Delay for readability
}
No Data Output:
Incorrect Readings:
I2C Communication Failure:
Q: Can this sensor be used with a Raspberry Pi?
A: Yes, the sensor can be used with a Raspberry Pi via the I2C interface. Ensure the appropriate libraries are installed.
Q: How do I change the sensor's sensitivity range?
A: The sensitivity range can be configured in the library's initialization function. Refer to the library documentation for details.
Q: Is the sensor affected by temperature changes?
A: The sensor has a built-in temperature compensation mechanism, but extreme temperature variations may still affect accuracy.