MPU-6050 modul za detekciju pokreta i stabilizaciju slike s akcelerometrom i žiroskopom, prikladan za hobi primjene.
SKU: OT2020-D106 Broj artikla: AB081 EAN: 8455269820906 Lokacija: D10.06
Alternativa
3-u-1 senzor Temperatura Vlažnost zraka i Tlak zraka | 5V | I2C | Bosch BME280
€ 4,49
Pogledaj ovu alternativu
Ovako spoji Akcelerometar i žiroskop za ubrzanje I2C - MPU-6050 na Arduino UNO ili ESP32, uz primjer sketcha koji možeš odmah učitati.
Ovaj projekt očitava podatke o ubrzanju i kutnoj brzini s 6-osnog MPU-6050 senzora za praćenje gibanja putem I2C. Spojite senzor na Arduino Uno, prenesite kod i otvorite Serial Monitor na 115200 baud kako biste vidjeli očitanja gibanja u stvarnom vremenu dok naginjete i zakrećete modul.
/*
* ==================================================================
* 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);
}
Potrebne biblioteke: 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
Ovaj projekt očitava 3-osno ubrzanje, brzinu rotacije i temperaturu sa senzora MPU-6050 putem I2C. ESP32 očitava podatke senzora pri 10 Hz i ispisuje oblikovane vrijednosti u Serial Monitor pri 115200 baud. Otvorite Serial Plotter za prikaz grafikona kretanja senzora uživo.
/*
* ==================================================================
* 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);
}
Potrebne biblioteke: Adafruit MPU6050 2.2.9, Adafruit Unified Sensor 1.1.15
Wiring diagram and example code generated by Codey.online — https://www.codey.online
MPU-6050 modul integrira 3-osni senzor ubrzanja i 3-osni žiroskop. Osim manjeg formata u usporedbi s pojedinačnim rješenjima, ovaj modul također rješava probleme s razlikama u tipičnim višekomponentnim sustavima.
Integrirana InvenSense baza podataka smanjuje složenu obradu i pruža okvir za razvoj aplikacija i API-ja.
I2C s do 400 kHz dostupan je za prijenos podataka.
Tehnički podaci
- MPU-6050 modul (troosni žiroskop + troosni akcelerometar)
- Napajanje: 3- 5 V (interni niskonaponski pad)
- Komunikacija: standardni IIC komunikacijski protokol
- Čip s ugrađenim 16-bitnim AD pretvaračem, 16-bitni izlaz podataka
- Raspon žiroskopa: ±250, ±500, ±1000, ±2000 °/ s (16 bitova)
- Raspon ubrzanja: ±2, ±4, ±8, ±16 g (16 bitova)
- ugrađeni temperaturni senzor
Primjeri uporabe
- igre za detekciju pokreta
- proširena stvarnost
- elektronička & optička stabilizacija slike
Dimenzije
Duljina: 2,1cm
Širina: 1,6cm
Visina: 0,34cm
| Širina | 1,6 cm |
|---|---|
| Sučelje | I2C |
| Duljina | 2,1 cm |
| Napon napajanja | 3-5V |
| Frekvencija | do 400 kHz |
| Visina | 0,34 cm |
| Raspon žiroskopa | ±250, ±500, ±1000, ±2000 °/s |
| Raspon ubrzanja | ±2, ±4, ±8, ±16 g |
Radi dobro
Bilo je dobro
radi savršeno!
Akcelerometar i žiroskop za ubrzanje I2C - MPU-6050