Test of MPU6050 accelerometer/gyroscope
- Platformio (Atom IDE)
- I2Cdevlib-Core_ID11
- I2Cdevlib-MPU6050_ID107
- ESP32 chip
- MPU6050 accelerometer
I have MPU6050 interrupt pin connected to ESP32 (Wemos D1 mini) GPIO34 pin to detect motion and zero motion interrupts. I don't need (and I don't want) to read accelerometer data in each loop() call.
I observe some strange behaviour.
- no matter what threshold I set, it's still too sensitive and gives interrupt on little movement (even max value 255). Do I understand it correctly that max detection sensitivity is 0,5 g (512 mg) as the unit of threshold is 2mg?
- when the duration is 9 (or less) the interrupt is fired even on little movement. When it's 10 (or more) the interrupt is not fired no matter how hard I shake the device. Why the MPU6050 detects movement for 9ms but not for 10ms as the unit of duration is 1 ms (at 1kHz)?
- same applies to wakeup. I set the ESP32 to wake up on interrupt on PIN 34 and put it to sleep. It wakes up on little movement. I tried various thresholds and durations.
accelerometer.setIntMotionEnabled(true);
accelerometer.setMotionDetectionThreshold(255);
accelerometer.setMotionDetectionDuration(9);