Questions tagged [accelerometer]

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

accelerometer
Filter by
Sorted by
Tagged with
346 votes
17 answers
127k views

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's user avatar
  • 5,352
258 votes
17 answers
126k views

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 ...
Sara's user avatar
  • 3,733
152 votes
4 answers
128k views

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 ...
Jørn Schou-Rode's user avatar
118 votes
6 answers
106k views

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 ...
woodstock365's user avatar
  • 1,790
99 votes
4 answers
54k views

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 ...
stackoverflowuser2010's user avatar
76 votes
5 answers
78k views

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 ...
Alexis's user avatar
  • 1,835
75 votes
6 answers
28k views

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 ...
martin's user avatar
  • 1,671
73 votes
2 answers
107k views

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 ...
Dylan Vester's user avatar
  • 2,696
52 votes
7 answers
70k views

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's user avatar
52 votes
7 answers
92k views

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 ...
Randy Sugianto 'Yuku''s user avatar
51 votes
2 answers
46k views

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's user avatar
  • 57.9k
50 votes
11 answers
80k views

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's user avatar
  • 6,129
45 votes
5 answers
56k views

How can i simulate accelerometer in android emulator? [closed]

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's user avatar
  • 529
44 votes
5 answers
50k views

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(...
Knodel's user avatar
  • 4,369
44 votes
5 answers
94k views

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 ...
user3056585's user avatar
42 votes
6 answers
56k views

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 ...
Maep's user avatar
  • 833
41 votes
3 answers
96k views

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's user avatar
38 votes
3 answers
35k views

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 ...
udiboy1209's user avatar
  • 1,492
38 votes
7 answers
69k views

FFT library in android Sdk [closed]

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's user avatar
35 votes
5 answers
35k views

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 ...
user2892857's user avatar
35 votes
1 answer
11k views

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:(...
Fab's user avatar
  • 1,518
33 votes
2 answers
14k views

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 ...
kyrpoff's user avatar
  • 331
30 votes
4 answers
24k views

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 ...
alex's user avatar
  • 11.2k
28 votes
2 answers
2k views

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 ...
Evgeny Vinnik's user avatar
27 votes
4 answers
59k views

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 ...
steelkassel's user avatar
26 votes
2 answers
25k views

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 ...
HappyEngineer's user avatar
26 votes
5 answers
38k views

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 ...
Faiz's user avatar
  • 517
26 votes
5 answers
5k views

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 ...
Jonovono's user avatar
  • 3,437
25 votes
5 answers
20k views

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 ...
William's user avatar
  • 251
24 votes
4 answers
30k views

Android Low pass filter and High pass filter

I have a very basic question. What is Low Pass filter and High Pass filter in case of Android Accelerometer? When I see the output from the Accelerometer Sensor, I see If I don't use any filter, (...
Jeet's user avatar
  • 781
23 votes
3 answers
31k views

Rotate marker as per user direction on Google Maps V2 Android

I want to rotate marker as per bearing or sensor value received from Accelerometer to show the user where actually he is moving. I have set marker icon and flat value to true but its not working as ...
Scorpion's user avatar
  • 6,851
23 votes
1 answer
19k views

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's user avatar
22 votes
2 answers
47k views

What is the difference between "gravity" and "acceleration" sensors in Android?

What is the difference between gravity and acceleration sensors in Android? From my point of view the physical value is the same in both cases. Which one measures the force acting on unit mass inside ...
Suzan Cioc's user avatar
  • 29.7k
22 votes
1 answer
1k views

Can we Draw line in android canvas between two points given by gyroscope?

Is it possible to draw a line from Point A(where user touched first) and Point B(where user touched second) in android over a camera. The user can touch first point and rotate his camera in other ...
Dropkick54's user avatar
21 votes
4 answers
27k views

android remove gravity from accelerometer readings

I am developing an application for Android where I need to remove gravity from accelerometer readings. I have read multiple discussions on this problem, I have also found an algorithm here, but I didn'...
Gabriel's user avatar
  • 2,054
21 votes
4 answers
20k views

Getting displacement from accelerometer data with Core Motion

I am developing an augmented reality application that (at the moment) wants to display a simple cube on top of a surface, and be able to move in space (both rotating and displacing) to look at the ...
eugeniodepalo's user avatar
20 votes
4 answers
20k views

How to do Gesture Recognition using Accelerometers

My goal is to recognize simple gestures from accelerometers mounted on a sun spot. A gesture could be as simple as rotating the device or moving the device in several different motions. The device ...
smaclell's user avatar
  • 4,618
20 votes
5 answers
29k views

How to detect walking with Android accelerometer

I'm writing an application and my aim is to detect when a user is walking. I'm using a Kalman filter like this: float kFilteringFactor=0.6f; gravity[0] = (accelerometer_values[0] * ...
havanakoda's user avatar
20 votes
2 answers
33k views

How can I get the direction of movement using an accelerometer?

I'm developing a Android application and I would like to know if is possible detect the direction of movement with one axis fixed. For example, I want put my phone on the table and detect the ...
Marcos Passos's user avatar
19 votes
4 answers
11k views

Is there any way to access the accelerometer from the Apple Watch?

It doesn't look like WatchKit released today has such API included.
mobileideafactory's user avatar
19 votes
2 answers
36k views

Using accelerometer, gyroscope and compass to calculate device's movement in 3D world

I'm working on an android application which can calculate device's movement in 6 direction. I think I can use acceleration as; "x=a.t^2" but a is not a constant. And this is the problem. How can I ...
kubudi's user avatar
  • 658
19 votes
5 answers
24k views

How to determine absolute orientation

I have a xyz accelerometer and magnetometer. Now I want to determine the orientation of the device using both. The problem I see is that depending on the device orientation, I'd need to use the ...
Al.'s user avatar
  • 1,841
18 votes
7 answers
56k views

How to remove Gravity factor from Accelerometer readings in Android 3-axis accelerometer

Can anyone help on removing the g factor from accelerometer readings? I am using SensorEventListener with onSensorChanged() method for getting Sensor.TYPE_ACCELEROMETER data. I need only pure ...
Pritam's user avatar
  • 2,407
18 votes
6 answers
38k views

Access accelerometer via Javascript in Android?

Is there any way to access accelerometer data using Javascript on Android's browser? I know it supports "onorientationchange", but I'd like to get everything. Clarification: I'm asking how to do ...
Jeff Lamb's user avatar
  • 5,805
18 votes
1 answer
7k views

Continuous accelerometer updates while in the background on iOS

I have researched this topic thoroughly before asking the question but need to ensure that I have come to the right conclusions and, if so, I would like help on implementing this as efficiently as ...
BYZZav's user avatar
  • 1,438
17 votes
3 answers
14k views

Android Accelerometer Profiling

I have written a simple Activity which is a SensorEventListener for Sensor.TYPE_ACCELEROMETER. In my onSensorChanged(SensorEvent event) i just pick the values in X,Y,Z format and write them on to a ...
shridatt's user avatar
  • 926
17 votes
4 answers
26k views

Detect user activity (running, cycling, driving) using Android

Using my Android device how can I detect if the user is walking, cycling or driving? I have checked the Google Fit app. It differentiates between running, cycling and driving. I am puzzled about what ...
Mayur More's user avatar
17 votes
2 answers
36k views

Read x y z coordinates of android phone using accelerometer

I am going to develop Android application which needs to read x,y,z coordinates of phone on 3D space. I would like to write a simple code and test on the device.. I am using ginger bread on both the ...
Ruwantha's user avatar
  • 2,633
17 votes
2 answers
12k views

How do I detect if a device has a gyroscope in a web browser?

I am using THREE.js and creating a web-app where the user can rotate the device and the scene will move accordingly. Something similar to this. I am having a problem differentiating between devices ...
Parth's user avatar
  • 1,145
16 votes
4 answers
164k views

Rotate object in Unity 3D

I can use the following code to rotate object using accelerometer. transform.rotation = Quaternion.LookRotation(Input.acceleration.normalized, Vector3.up); But i would like to rotate object like for ...
Artur's user avatar
  • 163

1
2 3 4 5
52