Hi,
I'm using MPU6050 breakout board with I2CDevLib (mpu6050 teapot example).
What I would like to achieve is that interrupt is triggered when there is actually some motion on sensor
(if I move it with hand for example).
Based on MPU6050 documentation I set INT_ENABLE (with setIntEnabled function) to B00000010.
This should mean that interrupt should be triggered based on the selected motion threshold only.
Well, the problem is that no matter how I set threshold I still get continues interrupts at ~100Hz rate (100 int/sec)
(measured by oscilloscope on MPU int line)
As mpuIntStatus I get 00000011 or 00000010. Which means that interrupt was triggered by "motion detection" (MOT_INT).
This are my current threshold settings:
Actually they are as they were in teapot example.
DEBUG_PRINTLN(F("Setting motion detection threshold to 2..."));
setMotionDetectionThreshold(2);
DEBUG_PRINTLN(F("Setting zero-motion detection threshold to 156..."));
setZeroMotionDetectionThreshold(156);
DEBUG_PRINTLN(F("Setting motion detection duration to 80..."));
setMotionDetectionDuration(80);
DEBUG_PRINTLN(F("Setting zero-motion detection duration to 0..."));
setZeroMotionDetectionDuration(0);
I'm wondering:
- what could I overlooked? Are there some additional register settings I need to make?
- What is triggering motion interrupt?
- Do I maybe have faulty MPU - received values are looking fine/are quite stable though (if +/- 1 deg in considered stable)
I would be glad if someone could give me some suggestion where to look further. I already spent few days figuring this out.
Thx,
Gregor