Questions tagged [accelerometer]

An accelerometer is a device that measures the proper acceleration of the device.

From Wikipedia:

An accelerometer is a device that measures proper acceleration. The proper acceleration measured by an accelerometer is not necessarily the coordinate acceleration (rate of change of velocity). Instead, the accelerometer sees the acceleration associated with the phenomenon of weight experienced by any test mass at rest in the frame of reference of the accelerometer device.

For example, an accelerometer at rest on the surface of the earth will measure an acceleration of g=9.81 m/s^2 straight upwards, due to its weight. By contrast, accelerometers in free fall or at rest in outer space will measure zero. Another term for the type of acceleration that accelerometers can measure is g-force acceleration.

Most questions regarding this tag deal with how to access, interpret, and process accelerometer data that is abundant in smartphones.

2578 questions
42
votes
6 answers

Android TYPE_LINEAR_ACCELERATION sensor - what does it show?

I am developing application for car acceleration tracking. I used standard accelerometer, calibrating it in specific position beforehand. Then, assuming phone's orientation is not changing, I logged the accelerometer data for a specified time and…
Maep
  • 833
  • 1
  • 10
  • 16
41
votes
3 answers

How do I use the Android Accelerometer?

I'm trying to build an app for reading the values from the accelerometer on my phone, which supports Android 2.1 only. How do I read from the accelerometer using 2.1-compatible code?
user642866
  • 419
  • 1
  • 4
  • 3
38
votes
7 answers

FFT library in android Sdk

I am working with android project.I need FFT algorithm to process the android accelerometer data.Is there FFT library available in android sdk?
stefy abraham
  • 461
  • 1
  • 5
  • 8
37
votes
3 answers

How to measure the tilt of the phone in XY plane using accelerometer in Android

I tried to use the Z axis data from SensorEvent.values, but it doesn't detect rotation of my phone in the XY plane, ie. around the Z-axis. I am using this as a reference for the co-ordinate axes. Is it correct? How do I measure that motion using…
udiboy1209
  • 1,472
  • 1
  • 15
  • 33
35
votes
5 answers

When to use accelerometer or gyroscope on Android

Is it ok to assume most of the user devices will have a gyroscope? In other words will I be excluding a significant number of people by using a gyroscope in my app? I'm making a children's storybook app and I'm wanting the user to be able to tilt…
user2892857
  • 405
  • 1
  • 5
  • 7
35
votes
1 answer

Gyroscope on iPhone

I need some help using gyroscope on iPhone. I can't understand readings from CMAttitude regarding pitch, roll and yaw in a particular situation. This is my code - (void)handleDeviceMotion:(CMDeviceMotion*)motion { NSLog(@"Yaw %f ",attitude.yaw…
Fab
  • 1,468
  • 1
  • 16
  • 37
33
votes
2 answers

How Nike+ GPS on iPhone receives accelerometer updates in the background?

The new Nike+ GPS application for iOS 5 is able to process accelerometer events in the background (thus allowing for indoor treadmill tracking). How is this possible? When I put my application in background, it ceases receiving events. I use the…
kyrpoff
  • 331
  • 1
  • 4
  • 4
30
votes
4 answers

Acceleration from device's coordinate system into absolute coordinate system

From my Android device I can read an array of linear acceleration values (in the device's coordinate system) and an array of absolute orientation values (in Earth's coordinate system). What I need is to obtain the linear acceleration values in the…
28
votes
2 answers

Set iPhone accelerometer to ±8g mode

Is it possible to set iPhone accelerometer to receive data in the ±8g range? (as far as I know ST LIS331DLH accelerometer installed on iPhone supports this mode) We are looking not only into standard API, but also undocumented functions possible…
Evgeny Vinnik
  • 1,235
  • 2
  • 16
  • 27
26
votes
5 answers

How does knocktounlock work?

I am trying to figure out how knocktounlock.com is able to detect "knocks" on the iPhone. I am sure they use the accelerometer to achieve this, however all my tries come up with false flags (if user moves, jumps, etc it sometimes fires) Basically, I…
Jonovono
  • 3,437
  • 5
  • 42
  • 64
26
votes
4 answers

calculating distances using accelerometer

After reading many researches and papers beside to many forums about how to measure the distance based on the acceleration data I found the double integration method, but the error related to this method is big and increases by time. In addition I…
steelkassel
  • 271
  • 1
  • 3
  • 3
26
votes
5 answers

Filtering accelerometer data noise

How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter…
Faiz
  • 517
  • 2
  • 7
  • 10
26
votes
2 answers

Using Android gyroscope instead of accelerometer. I find lots of bits and pieces, but no complete code

The Sensor Fusion video looks great, but there's no code: http://www.youtube.com/watch?v=C7JQ7Rpwn2k&feature=player_detailpage#t=1315s Here is my code which just uses accelerometer and compass. I also use a Kalman filter on the 3 orientation values,…
HappyEngineer
  • 4,017
  • 9
  • 46
  • 60
25
votes
5 answers

Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock

I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the device is off (I'm careful with battery life and…
23
votes
1 answer

Why is accelerometer:didAccelerate: deprecated in IOS5?

The release of IOS5 has this core function listed as deprecated. Does anyone know what will replace it? I'm assuming that apple is not going to remove the accelerometer from iPhone 5.
jcpennypincher
  • 3,970
  • 5
  • 31
  • 44