MPU-6050 module voor bewegingsdetectie en beeldstabilisatie met versnellingsmeter en gyroscoop, geschikt voor hobbytoepassingen.
SKU: OT2020-D106 Número do artigo: AB081 EAN: 8455269820906 Localização: D10.06
Alternativa
Sensor 3-em-1 Temperatura Humidade e Pressão Atmosférica | 5V | I2C | Bosch BME280
€ 4,49
Ver esta alternativa
Como ligar o Acelerômetro e giroscópio de aceleração I2C - MPU-6050 a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project reads acceleration and angular velocity data from the MPU-6050 6-axis motion tracking sensor over I2C. Connect the sensor to the Arduino Uno, upload the code, and open the Serial Monitor at 115200 baud to view real-time motion readings as you tilt and rotate the module.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : MPU-6050 Accelerometer and Gyroscope Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : Accelerometer and Gyroscope I2C MPU-6050
* Libraries : Adafruit MPU6050 2.2.9, Adafruit Unified Sensor 1.1.15, Adafruit BusIO 1.17.4
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
Adafruit_MPU6050 mpu;
void setup() {
Serial.begin(115200);
while (!Serial) {
delay(10);
}
Serial.println(F("Initializing MPU-6050..."));
if (!mpu.begin()) {
Serial.println(F("Failed to find MPU-6050 chip. Check connections!"));
while (1) {
delay(10);
}
}
Serial.println(F("MPU-6050 initialized successfully!"));
// Configure sensor ranges and filter bandwidth
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
}
void loop() {
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
// Print acceleration in m/s^2
Serial.print(F("Accel (m/s^2) X: "));
Serial.print(a.acceleration.x, 2);
Serial.print(F(", Y: "));
Serial.print(a.acceleration.y, 2);
Serial.print(F(", Z: "));
Serial.print(a.acceleration.z, 2);
// Print rotation rate in rad/s
Serial.print(F(" | Gyro (rad/s) X: "));
Serial.print(g.gyro.x, 2);
Serial.print(F(", Y: "));
Serial.print(g.gyro.y, 2);
Serial.print(F(", Z: "));
Serial.print(g.gyro.z, 2);
// Print onboard temperature
Serial.print(F(" | Temp: "));
Serial.print(temp.temperature, 1);
Serial.println(F(" C"));
delay(500);
}
Bibliotecas necessárias: Adafruit MPU6050 2.2.9, Adafruit Unified Sensor 1.1.15, Adafruit BusIO 1.17.4
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project reads 3-axis acceleration, rotation speed, and temperature from the MPU-6050 sensor via I2C. The ESP32 reads the sensor data at 10 Hz and prints formatted values to the Serial Monitor at 115200 baud. Open the Serial Plotter to view live graphs of sensor movements.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 MPU-6050 Motion Sensor Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : Accelerometer and Gyroscope I2C MPU-6050
* Libraries : Adafruit MPU6050 2.2.9, Adafruit Unified Sensor 1.1.15
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
Adafruit_MPU6050 mpu;
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("Initializing MPU-6050...");
// Initialize I2C on ESP32 default pins: SDA (GPIO 21), SCL (GPIO 22)
Wire.begin(21, 22);
if (!mpu.begin(0x68, &Wire)) {
Serial.println("Failed to find MPU-6050 chip!");
while (1) {
delay(10);
}
}
Serial.println("MPU-6050 Found!");
// Configure sensor ranges
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
delay(100);
}
void loop() {
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
Serial.print("Accel X: ");
Serial.print(a.acceleration.x, 2);
Serial.print(" m/s^2, Y: ");
Serial.print(a.acceleration.y, 2);
Serial.print(" m/s^2, Z: ");
Serial.print(a.acceleration.z, 2);
Serial.println(" m/s^2");
Serial.print("Gyro X: ");
Serial.print(g.gyro.x, 2);
Serial.print(" rad/s, Y: ");
Serial.print(g.gyro.y, 2);
Serial.print(" rad/s, Z: ");
Serial.print(g.gyro.z, 2);
Serial.println(" rad/s");
Serial.print("Temperature: ");
Serial.print(temp.temperature, 1);
Serial.println(" degC");
Serial.println("------------------------------------");
delay(500);
}
Bibliotecas necessárias: Adafruit MPU6050 2.2.9, Adafruit Unified Sensor 1.1.15
Wiring diagram and example code generated by Codey.online — https://www.codey.online
O módulo MPU-6050 integra um sensor de aceleração de 3 eixos e um giroscópio de 3 eixos. Além de um tamanho menor em comparação com soluções individuais, este módulo também resolve problemas com diferenças em sistemas multicomponentes típicos.
A base de dados InvenSense integrada reduz o processamento complexo e oferece uma estrutura para o desenvolvimento de aplicações e APIs.
I2C com até 400 kHz está disponível para transmissão de dados.
Dados técnicos
- Módulo MPU-6050 (giroscópio de três eixos + aceleração de três eixos)
- Alimentação: 3- 5 V (diferença interna de baixa tensão)
- Comunicação: o protocolo padrão de comunicação IIC
- Chip com conversor AD de 16 bits integrado, saída de dados de 16 bits
- Faixa do giroscópio: ±250, ±500, ±1000, ±2000 °/ s (16 bits)
- Faixa de aceleração: ±2, ±4, ±8, ±16 g (16 bits)
- sensor de temperatura integrado
Exemplos de utilização
- Jogos de deteção de movimento
- realidade aumentada
- estabilização eletrónica e ótica de imagem
Dimensões
Comprimento: 2,1cm
Largura: 1,6cm
Altura: 0,34cm
| Largura | 1,6 cm |
|---|---|
| Interface | I2C |
| Comprimento | 2,1 cm |
| Tensão de alimentação | 3-5V |
| Frequência | até 400 kHz |
| Altura | 0,34 cm |
| Faixa do giroscópio | ±250, ±500, ±1000, ±2000 °/s |
| Faixa de aceleração | ±2, ±4, ±8, ±16 g |
Funciona bem
Estava bom
funciona perfeitamente!
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Acelerômetro e giroscópio de aceleração I2C - MPU-6050