how to configure MPU6050 hardware interrupt to trigger on device tilt

Hi,

I am new to MPU6050 and i want to configure the MPU6050 such that it wake up the Arduino device when the device is found in vertical position. Actually want to make the power efficient device which will be mounted on the oil tanker CAP and only wakeup when the CAP is open and send alert. I also want to detect even when it opens so smoothly. I have tried this with the motion detection interrupt but it fail to detect the motion when open the door so smoothly. And if I configure the motion detection threshold at lower side value then it continuously waking up on bumpy road when driving the tanker on the road.

Please suggest some way to work with fuel tanker CAP open and close detection with MPU6050 interrupt.

Thanks in advance

A search, using my favorite internet search thingy using the words " mpu6050 wake on motion " gave me a lot of solutions.

A switch would be a very reliable way to detect an open cap, and is much cheaper and simpler.

@Idahowalker,
I have the idea for motion detect capability and i have already given a try to this, but problem is that when i configure the threshold on lower value then it become more sensitive that trigger even when vehicle on bumpy road and trigger false condition. When i configure the threshold and motion duration at some higher end then the mpu6050 is not triggering when I open the fuel CAP very much smoothly and carefully and i missed the event.

@jremington,

Thanks for the suggestion, and i have already give a try to the switch and different type of magnetic sensor also. But the problem with these approach is that it require proper mechanical stuff as well as the tempering to the switch/magnetic sensor is easy for oil stolen activity and i personally seen this on field. That's why I am exploring the solution which is not easy to temper and can detect the oil stealing activity.

Feel free to suggest any approach if you have.

When your truck moves the entire vehicle is moving. If there is a sensor on the body of the truck and a sensor on the cap both sensors would register movement during truck movements. If both sensors detect movement then the cap opening sensor data would be invalid. After all, whiles possible, someone opening the cap whiles the truck is moving is a bit difficult, correct?

Buuuuutttt, if the truck is stopped, then both sensors should detect 'no movement' and, at this point, sensor caps input would be opening detection.