Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android accelerometer: Sampling Rate?

I want to

[1] Increase Sampling Rate of my phone's accelerometer. (SENSOR_DELAY_FASTEST gives max. about 100Hz on Xperia/ 180Hz on Nexus4, I want delay to be about 1ms or less for my work.

[2] If [1] not possible can i make Rate constant.

mSensorManager.registerListener(this, mAccelerometer,10000);//10000 in microsec

Above code doesn't give me 10ms delay. I know it's only a suggestion to Android.

I know These accelerometers inside phones are capable of giving much smaller delay. It's mentioned in their datasheets. So is their any method or driver/ADC programming to do [1] or [2]. I'm using ADT tools. Any other tool to do this?

P.S: I've read

Android: How to increase Accelerometer Sampling Rate?

Impossibility to change the rate of the accelerometer

like image 558
pxm Avatar asked Jul 15 '13 20:07

pxm


People also ask

What is sampling rate of accelerometer?

By default, the accelerometer sample rate is 100Hz (100 times per second).

How accurate is accelerometer in phone?

Typical phone accelerometer chips resolve +/- 2g @ 12 bits providing 1024 bits over full range or 0.0643 ft/sec^2 lsb. The rate of sampling depends on clock speeds and overall configuration. Typical rates enable between one and 400 samples per second, with faster rates offering lower accuracy.

What is Android accelerometer?

The accelerometer is an in-built comment of a smartphone to measure its acceleration. It tracks the different motion like shaking, tilting, swinging, and rotating and accordingly change the orientation of your app.

How can I test my phone accelerometer?

Open the Phone app and tap Keypad, then type *#0*#. A diagnostic screen pops up with buttons for a variety of tests. Tap Red, Green, or Blue to test those pixel colors. Tap Receiver to check the audio, Vibration to try the vibrating feature, or Sensor to test the accelerometer and other sensors.


1 Answers

From developer.android.com :

The data delay (or sampling rate) controls the interval at which sensor events are sent to your application via the onSensorChanged() callback method. The default data delay is suitable for monitoring typical screen orientation changes and uses a delay of 200,000 microseconds. You can specify other data delays, such as SENSOR_DELAY_GAME (20,000 microsecond delay), SENSOR_DELAY_UI (60,000 microsecond delay), or SENSOR_DELAY_FASTEST (0 microsecond delay). As of Android 3.0 (API Level 11) you can also specify the delay as an absolute value (in microseconds).

But you should know the absolute value you specify in microseconds is only a suggestion to Android.

like image 175
user3248182 Avatar answered Oct 04 '22 12:10

user3248182