using GY-521 interrupt to wake up Arduino

Hello,

I've been toying with my GY-521 breakout the last few days, and I have been able to get a cursory understanding of how it works.

What I would like to do with it is to wake up an Atmega328P-PU using an interrupt if persistent movement is detected that lasts longer than one second, give or take, and that movement must have a certain magnitude, i.e. it is significant. I want to filter out accidental movements and only let the Atmega alert when there is really something going on.

To give you an idea what this is going to be for: I have begun creating an anti-theft GPS tracking device for my car that will incorporate a SIM800 module or similar, and I would like the device to be in sleep mode most of the time, except for when movement is detected. If somebody actually manages to start the car and drive off with it, the device will wake up via a pin change interrupt that's connected to the car's speed signal. But if, say, my car gets towed, I want the device to wake up as well and start sending GPS data.

To make sure the Atmega doesn't wake up everytime the car moves ever so slightly in a gust of wind or somebody just leans against it the wrong way, I would like to filter out the kind of movement that that will create.

It looks to me like a relatively simple application, but I can't really figure out where to start and how to do that using a few simple lines of code. I have looked at the example sketches of the MPU-6050 library, but that hasn't really helped so far in trying to write code for my purposes.

Could somebody point me in the right direction as to how I can achieve what I would like to do?

To achieve this you have to program the DMP inside the MPU-6050. Unfortunately the documentation for the DMP is not freely available (at least I wasn't able to find it).

ok so apparently it's not going to work that easily to use the GY-521's interrupt to wake up the Arduino.

Here's a different approach:

The GY-521 seems to draw somewhere around 6.7 mA during operation at 3.3v, if my multimeter is accurate. So there'd be no harm in keeping both it and the Atmega328P-PU in continuous operation without putting the Atmega to sleep.

Customizing the "MPU6050_DMP6" example sketch from the library, I could simply read out the acceleration continuously with

        #ifdef OUTPUT_READABLE_REALACCEL
            // display real acceleration, adjusted to remove gravity
            mpu.dmpGetQuaternion(&q, fifoBuffer);
            mpu.dmpGetAccel(&aa, fifoBuffer);
            mpu.dmpGetGravity(&gravity, &q);
            mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
            Serial.print("areal\t");
            Serial.print(aaReal.x);
            Serial.print("\t");
            Serial.print(aaReal.y);
            Serial.print("\t");
            Serial.println(aaReal.z);
        #endif

And then maybe keep calculting averages with the Atmega. If acceleration exceeds one of the previous averages by a considerable amount and does so for a longer period of time, then the Atmega will fire up the SIM800 module via a MOSFET and get a GPS reading. This is then compared to the last known previous reading stored in the Atmega's EEPROM. If a change is detected, the SIM module goes online and posts the location change to my web server.

About the power supply - what if I take a Recom 1A power regulator to bring the voltage down to 5V from the car's 12V, and then have an Adafruit LIPO charger charge up a LIPO, which will then also supply the 2A bursts needed for the GSM functionality?