I have a system mounted on a door. I need to know when the door is open and when it is closed. I'm not able to have a switch on the door or modify the room where the door is located in any way. I am looking at your MMA8453QT product as a solution. If the door is opened I need an interrupt sent to a microprocessor and again when the door is closed. This may be overkill but it looks like a good solution. How can I use this or another similar sensor to perform this task?
Thanks Anthony, Could you please direct me to an application note that covers this application? The FXOS8700 part looks like the perfect solution!
Hello Tom,
For this kind of application, using an accelerometer only is not a suitable solution. I highly recommend to add a magnetometer (such as the MAG3110) to your system or a the combo accelerometer+magnetometer device alone (FXOS8700).
The magnetometer can be used to detect the door position (closed and non-closed state only) and the accelerometer to wake-up the system when a motion is detected. This allows to save a lot in the power consumption side.
An algorithm using the magnetic distance between the closed and the non-closed position can be used to detect if the door is opened or not.
The algorithm must compute the magnetic distance (modulus on 2 axis) between the reference magnetic position and the current magnetic fields. If the current measurement is located in the reference area (initial position plus threshold radius), the door is assumed closed.
The magnetic distance is defined as:
= √( − )²+ ( − )²
With:
- the X magnetic closed door position
- the Z magnetic closed door position
- the X magnetic current door position
- the Z magnetic current door position
If you want more details I can share additional material.
Thanks,
Anthony