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
346
votes
17 answers

How do I detect when someone shakes an iPhone?

I want to react when somebody shakes the iPhone. I don't particularly care how they shake it, just that it was waved vigorously about for a split second. Does anyone know how to detect this?
Josh Gagnon
  • 5,342
  • 3
  • 26
  • 36
258
votes
17 answers

How to refresh app upon shaking the device?

I need to add a shake feature that will refresh my Android application. All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest SensorEventListener. Anybody that has a nice guide to how…
Sara
  • 3,733
  • 6
  • 26
  • 30
150
votes
4 answers

How to access accelerometer/gyroscope data from Javascript?

I have recently come across a few websites that seems to access the accelerometer or gyroscope on my laptop, detecting changes in orientation or movement. How is this done? Must I subscribe to some kind of event on the window object? On which…
Jørn Schou-Rode
  • 37,718
  • 15
  • 88
  • 122
118
votes
6 answers

Android accelerometer accuracy (Inertial navigation)

I was looking into implementing an Inertial Navigation System for an Android phone, which I realise is hard given the accelerometer accuracy, and constant fluctuation of readings. To start with, I set the phone on a flat surface and sampled 1000…
woodstock365
  • 1,780
  • 4
  • 19
  • 35
98
votes
4 answers

Understanding FFT output

I need some help understanding the output of the DFT/FFT computation. I'm an experienced software engineer and need to interpret some smartphone accelerometer readings, such as finding the principal frequencies. Unfortunately, I slept through most…
stackoverflowuser2010
  • 38,621
  • 48
  • 169
  • 217
76
votes
5 answers

Indoor Positioning System based on Gyroscope and Accelerometer

I am developing an Android App to track indoor position. My phone is an Google Nexus S using two sensors, the first being an Accelerometer and the second being a Gyroscope. My idea is that from a starting reference point (a known GPS position),…
Alexis
  • 1,825
  • 4
  • 23
  • 28
73
votes
6 answers

Android accelerometer not working when screen is turned off

I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen…
martin
  • 1,631
  • 1
  • 13
  • 15
73
votes
2 answers

Combine Gyroscope and Accelerometer Data

I am building a balancing robot using the Lego Mindstorm's NXT system. I am using two sensors from HiTechnic, the first being an Accelerometer and the second being a Gyroscope. I've successfully filtered out noise from both sensors and derived…
Dylan Vester
  • 2,686
  • 4
  • 29
  • 40
52
votes
7 answers

How can I find distance traveled with a gyroscope and accelerometer?

I want to build an app that calculates accurate Distance travelled by iPhone (not long distance) using Gyro+Accelerometer. No need for GPS here. How should I approach this problem?
Ruchir Agile
  • 537
  • 1
  • 5
  • 4
51
votes
2 answers

Gyroscope vs Accelerometer?

Now that iOS 4 is no longer NDA, I would like to know what Gyroscope has to offer over the Accelerometer for developers. Is there a difference in APIs? Other things?
Moshe
  • 57,511
  • 78
  • 272
  • 425
51
votes
7 answers

How is it possible that Google Fit app measures number of steps all the time without draining battery?

The Google Fit app, when installed, measures the duration you are walking or running, and also the number of steps all the time. However, strangely, using it does not seem to drain the battery. Other apps like Moves which seems to record number of…
Randy Sugianto 'Yuku'
  • 71,383
  • 57
  • 178
  • 228
49
votes
11 answers

Detect change in orientation using javascript

Is it possible to detect change in orientation of the browser on the iPad or Galaxy Tab using javascript? I think it's possible using css media queries.
manraj82
  • 5,929
  • 24
  • 56
  • 83
45
votes
5 answers

How can i simulate accelerometer in android emulator?

I don't have an Android phone right now. But in my application I need to use the accelerometer values. How can I do this in a simulated environment?
sruthi
  • 529
  • 2
  • 5
  • 7
44
votes
5 answers

How to get iPhones current orientation?

Is there a special method to get iPhones orientation? I don't need it in degrees or radians, I want it to return an UIInterfaceOrientation object. I just need it for an if-else construction like if(currentOrientation==UIInterfaceOrientationPortrait…
Knodel
  • 4,359
  • 8
  • 42
  • 66
44
votes
5 answers

how to calculate exact foot step count using accelerometer in android?

I am developing some application like Runtastic Pedometer using the algorithm but I am not getting any similarity between the results. my code is as follows: public void onSensorChanged(SensorEvent event) { Sensor sensor = event.sensor; …
user3056585
  • 441
  • 1
  • 5
  • 4
1
2 3
99 100