2009 International Symposium on Wearable Computers

Which way am I facing: Inferring horizontal device orientation from anaccelerometer signal
Kurt Partridge, Bo Begole
Palo Alto Research Center
3333 Coyote Hill Road
Palo Alto, CA 94304
kurt/bo@parc.com

Kai Kunze, Paul Lukowicz
Embedded Systems Lab
University Passau
Passau, Germany
first.lastname@uni-passau.deAbstractz

first pca component

We present a method to infer the orientation of mobile
device carried in a pocket from the acceleration signal
acquired when the user is walking. Whereas previous work
has shown how to determine the the orientation in thevertical plane (angle towards earth gravity), we demonstrate
how to compute the orientation within the horizontal plane.
To validate our method we compare the output of ourmethod with GPS heading information when walking in astraight line. On a total of 16 different orientations andtraces we have a mean difference of 5 degrees with 2.5
degrees standard deviation.

ygravity vectorx

Figure 1. Accelerometer coordinate system in relation
to the gravity vector (vertical component) and the walking direction infered using pca.

2. Approach

1. Introduction

We base the approach on three assumptions:• The user walks facing forward.
• The device is placed in a trouser’s pocket. Our approachshould also yield similar results on the persons torso orsimilar on-body placements. However, we did not test
them in this paper.
• We apply our approach on a walking segment in which
the user walked fairly straight.
As already described by Mizel [5], one can estimate thegravity vector component of a 3-axis accelerometer. We use
a slight variation of this method to get the acceleration axis
parallel to the persons torso: We apply a sliding window overover all 3 axis. If the variance of all axis is close to 0 and themagnitude approaches 9.81 m/s2 , the signal is very likely
to be dominated by the vertical orientation component.
Using this heuristic, we infer the vertical component. Now
we project the accelerometer signal in the plane perpendicular to the vertical gravity vector (=horizontal plane).
We apply principle component analysis on the projected
data points (see Figure 1) to get the direction where theacceleration variations is greatest. This is the axis that isparallel to the walking direction. Assuming that the user iswalking forward, integration over the component will allows
us to determine which way is front (leads to positive integral)

The work described in this paper is part of a larger effortof our group to facilitate the use of standard sensor enabled
devices such as a mobile phone for context recognition. Amajor issue that has to be considered is the fact that users
carry such devices in a variety of ways. In general neither thelocation (pocket, belt, bag) nor the orientation of the device
can be assumed to be known. In previous work we havedemonstrated how to detect where on the body the device islocated by analyzing the accelerometer signal during various
activities [3]. We have also shown how to deal with sensor
displacement [4]. In this paper we show how to infer theorientation of the device with respect to the user’s body.
We extend existing work by [5] that has shown how theorientation in the vertical plane (angle towards gravity) can
be computed by inferring the orientation in the horizontal
plane. Our method is based on the observation that while
walking, the most variations in the horizontal plane of theacceleration signal will be parallel to the direction of motion.
To distinguish between front and back we look at the integralof the signal over time.
We focus on the trouser pocket, as it is by far the most
likely placement for peoples mobile phones(see [2]). This
work is partially inspired by [1].
978-0-7695-3779-5/09
1550-4816/09$25.00 ©$25.00$26.002009 IEEE© 2009 IEEE
DOI 10.1109/ISWC.2009.33

149

Figure 2. The Mtx motion sensor in the phone casing
placed in the pocket depicted with the different axisorientations.

Figure 3. The accumulated integrated velocity of thefirst pca component direction for 2 trials with different
sensor orientations, one in which the test subject waswalking slowly (blue) and fast (green).

and which is back (see Figure 3).

3. Experimental Setup
We test the approach described above with following
setup. We use a MTx motion sensor (equipped with 3axis accelerometer, gyro and magnetic field) with a custom
bluetooth sender placed in a mobile phone casing as data
source for our algorithm. As reference we use a GPS device
We stream all data to a Nokia N810 running the context
recognition network toolbox1 for recording and labeling.
Note that in the MTx sensor the magnetic field sensor axes
are oriented in parallel to the acceleration sensor axes. Thismeans that if our algorithm can infer the orientation of theacceleration axis with respect to the user’s body we automatically have the orientation of the magnetic field sensor withrespect to the body. This is equivalent to knowing which way(in terms of longitude and latitude) that the user is facing. If
the user is walking forward this direction is also the user’sheading. By comparing the heading computed this way withthe heading provided by GPS we can verify the accuracy of
our method for determining the horizontal orientation of thesensor.
Two test subjects walked a straight path outside (around30 meters) with the MTx sensor in the right trouser pocket
and the GPS in hand. We repeat this experimental setup 8times per person changing the sensor orientation each time.
We pick only 8, as comparing the device with a mobilephone, users will most likely no place the device with thethin side facing towards the body. So we place the phonecasing with the sensor in the right trousers facing front
rotating it always 90 degrees for the following experimental
trial (the same procedure with the backside facing front),
leaving us with 8 distinct orientations.
Three of the 8 orientations are shown in Figure 2.

!

"

#$%&!

&"

'(()(*+,*-'.(''/

Figure 4. The errors between the accelerometer andgps based approaches, mean at around 5 degrees witha standard deviation of 2.5 degrees.
of the 16 experimental trials. Figure 3 shows an incremental
integration over the principal component acceleration axis
for a person walking slow (blue graph) and walking fast(green graph) with different sensor orientations.
Comparing now the rotation angles using the two complimentary methods to calculate them for all 16 trials, we geta mean difference of 5 degrees with a standard deviation of
2.5 degrees, as depicted in Figure 4.

References[1] U. Blanke and B. Schiele. Sensing location in the pocket.
Ubicomp Poster Session, page 2, Aug 2008.
[2] F. Ichikawa, J. Chipchase, and R. Grignani. Where’s thephone? a study of mobile phone location in public spaces.
Mobile Technology, Applications and Systems, 2005 2nd International Conference on, pages 1 – 8, Oct 2005.
[3] K. Kunze and P. Lukowicz. Using acceleration signaturesfrom everyday activities for on-body device location. Wearable
Computers, 2007 11th IEEE International Symposium on,pages 115 – 116, Sep 2007.
[4] K. Kunze and P. Lukowicz. Dealing with sensor displacement
in motion-based onbody activity recognition systems. UbiComp ’08: Proceedings of the 10th international conferenceon Ubiquitous computing, Sep 2008.

4. Results[5] D. Mizell. Using gravity to estimate accelerometer orientation. Wearable Computers, 2003. Proceedings. Seventh IEEE
International Symposium on, pages 252 – 253, Sep 2005.

Using the approach presented above, we can reliably detect the side of the sensor facing in walking direction for all
1. http://crnt.sf.net150