Advanced

Angular positioning of a door or window - using a MEMS accelerometer and a magnetometer

Voigt, Josefin LU (2015) EEM820 20151
Department of Biomedical Engineering
Abstract
The accurate and reliable detection of opening of doors and windows is vital for home security applications. This master thesis aims to present a way to achieve this using a low-cost and low-power ecompass, containing a MEMS accelerometer and a magnetometer.
This has been achieved by attaching such a device to a door and collecting sensor data when opening and closing the door. Said data were then analysed in the Matlab environment to study the impact of different methods found in literature to correct for errors in measurements. These include Zero Velocity Compensation for the accelerometer values and hard- and soft-iron compensation for the magnetometer. Thereafter the angle of opening has been calculated, using corrected measurement... (More)
The accurate and reliable detection of opening of doors and windows is vital for home security applications. This master thesis aims to present a way to achieve this using a low-cost and low-power ecompass, containing a MEMS accelerometer and a magnetometer.
This has been achieved by attaching such a device to a door and collecting sensor data when opening and closing the door. Said data were then analysed in the Matlab environment to study the impact of different methods found in literature to correct for errors in measurements. These include Zero Velocity Compensation for the accelerometer values and hard- and soft-iron compensation for the magnetometer. Thereafter the angle of opening has been calculated, using corrected measurement values.
The finished algorithm has also been adapted for implementation on a Cortex-M4 CPU as this, or a similar processor, is likely what is available to use with the e-compass in a real world application. This also motivates the adjustment of the algorithm to use less memory. Finally said implementation has been performed.
The results show that it is possible to correct for most of the errors of the accelerometer, but the errors that are left will still propagate to the angular calculations, causing the angle to drift. This can be compensated for by using the angle calculated from magnetometer measurements. The correction of effects affecting the magnetometer is also mostly successful.
Likewise the implementation of the algorithm on the processor shows promising results. However, to generalise the algorithm to work on all kinds of doors, as opposed to only the doors it has been developed on, further studies are required. (Less)
Popular Abstract
Detection of breaking and entering using an eCompass

To stop breaking and entering a new way of detecting the opening of doors or windows has been developed in collaboration with Verisure Innovation AB. The method is based on sensor data from a device called an eCompass, made up of an accelerometer and a magnetometer.
In home security it is important to determine if a door or window is open or closed, as an opening when the alarm is activated might indicate an attempted burglary. Some sort of sensor to be placed on the door or window for this detection is required. Today a magnetic contact is often used. However, to provide options that could increase power efficiency, decrease cost or simplify the installation, an alternative... (More)
Detection of breaking and entering using an eCompass

To stop breaking and entering a new way of detecting the opening of doors or windows has been developed in collaboration with Verisure Innovation AB. The method is based on sensor data from a device called an eCompass, made up of an accelerometer and a magnetometer.
In home security it is important to determine if a door or window is open or closed, as an opening when the alarm is activated might indicate an attempted burglary. Some sort of sensor to be placed on the door or window for this detection is required. Today a magnetic contact is often used. However, to provide options that could increase power efficiency, decrease cost or simplify the installation, an alternative component has been investigated.
Since it is a consumer product, placed on doors and windows, it will need to be wireless; a component requiring chords everywhere would not be popular. This means that it needs to be battery-powered. To limit the amount of service, the device should still have a life-span of several years. Therefore it simply needs to be very low-power. Recent development of the accelerometers on the market provides just such a sensor; low power and sensitive enough to react to movement of the door or window. Not to forget, it is also affordable.
An accelerometer is a component measuring acceleration acting on it. When a door is opened the outer edges of the door will move in a demi-circle.
By placing the accelerometer close to the outer edge of the door, the acceleration when opening the door can be measured. From the acceleration it is possible to calculate an angle of the door in relation to the starting position.
These calculations are subjected to certain problems: Firstly, errors will cause the calculated angles to drift. Secondly, the noise levels of the accelerometer will hide very low accelerations. During a burglary the burglar might try to escape notice by opening the door utterly slowly. Therefore some kind of verification of the angle is needed to counteract the drift and detect slow openings. One good option for this is to include a magnetometer.
This is a component that measures magnetic fields. Combined with an accelerometer it is often referred to as an eCompass.
As the name implies, it measures the compass heading, that is the angle relative to north. When attached to the door this angle will change as the door turns during opening. This can be related to the angle relative to the closed door by simply subtracting the compass heading of the door when closed. Then the resulting angle of the closed door is 0 degrees.
This method has been tested and works in real life on doors, showing the angle of opening. By setting a limit of around 2 degrees for the "open" state of the door (to combat false negatives due to errors, while still having too small an angle for anyone to pass through) the "open" or "closed" state of the door can be determined.
The inclusion of another component for the algorithm will cause the power consumption to increase, especially since the magnetometer has around 10 times higher power consumption than the accelerometer. To counteract this one could decrease the sampling rate of foremost the magnetometer. Since the accelerometer is very good at detecting motion, the main point of the magnetometer is to detect slow opening of doors. For that purpose it does not need to be sampled very often. It should therefore be possible to optimize the algorithm so that the magnetometer only detects openings too slow for the accelerometer, while the latter detects the fast openings.
To sum up, it is possible to use the combination of an accelerometer and a magnetometer to determine the opening angle of a door or window. The power consumption can also be controlled by optimizing the algorithm. (Less)
Please use this url to cite or link to this publication:
author
Voigt, Josefin LU
supervisor
organization
course
EEM820 20151
year
type
H2 - Master's Degree (Two Years)
subject
language
English
additional info
2015-05
id
5276512
date added to LUP
2015-04-20 14:28:47
date last changed
2015-04-20 14:28:47
@misc{5276512,
  abstract     = {The accurate and reliable detection of opening of doors and windows is vital for home security applications. This master thesis aims to present a way to achieve this using a low-cost and low-power ecompass, containing a MEMS accelerometer and a magnetometer.
This has been achieved by attaching such a device to a door and collecting sensor data when opening and closing the door. Said data were then analysed in the Matlab environment to study the impact of different methods found in literature to correct for errors in measurements. These include Zero Velocity Compensation for the accelerometer values and hard- and soft-iron compensation for the magnetometer. Thereafter the angle of opening has been calculated, using corrected measurement values.
The finished algorithm has also been adapted for implementation on a Cortex-M4 CPU as this, or a similar processor, is likely what is available to use with the e-compass in a real world application. This also motivates the adjustment of the algorithm to use less memory. Finally said implementation has been performed.
The results show that it is possible to correct for most of the errors of the accelerometer, but the errors that are left will still propagate to the angular calculations, causing the angle to drift. This can be compensated for by using the angle calculated from magnetometer measurements. The correction of effects affecting the magnetometer is also mostly successful.
Likewise the implementation of the algorithm on the processor shows promising results. However, to generalise the algorithm to work on all kinds of doors, as opposed to only the doors it has been developed on, further studies are required.},
  author       = {Voigt, Josefin},
  language     = {eng},
  note         = {Student Paper},
  title        = {Angular positioning of a door or window - using a MEMS accelerometer and a magnetometer},
  year         = {2015},
}