Android accelerometer max values

偶尔善良 提交于 2019-11-30 17:17:28

问题


So I have been searching for about 3 hours and I have not come up with a good answer/solution.

My Question is: Why am I getting a max acceleration value of only about 34 m/s^2 or about 3.5 Gs (34/9.81).

Is it because hardware restrictions or software restrictions? If it is hardware I know I can't do nothing about it(or at least not easily). If it is software restriction then how can I remove that restriction, is there any way of doing that? Like an API or something?

I would appreciate any help, Thanks.

Note: I am using a Galaxy S, if that makes a difference. I have also taking a look at this question but that does not helps me: What is android accelerometer min and max range


回答1:


Take a look at this: https://electronics.stackexchange.com/questions/11372/samsung-galaxy-s-accelerometer-details The question includes what appears to be the datasheet for the accelerometer used in the Galaxy S. Apparently there are three possible ranges +/-2g, +/-4g, and +/-8g. I'm not an electronics expert so won't provide any more interpretation than that.

According to developer.android.com, the accelerometer readings are hardware-dependent only: developer.android.com/guide/topics/sensors/sensors_motion.html Thus, you'd probably have a better shot at getting an expert answer on the Electrical Engineering stackexchange forum already referenced above: electronics.stackexchange.com.

Good luck with your project!

EDIT: In reference to comments on original question: I see, because it says on the page you reference -

"My understanding is that the default for Android accelerometers is to operate in a predefined range of +-2g. How can I programmatically change this range via a public API? There is a getMaximumRange() method, but no corresponding setMaximumRange() method."

You are wondering if there is a software-based method for changing the pre-selected range. Again, I would think that Android API docs would mention that. Try asking on electronics.stackexchange.com what "dynamically selectable ranges" are and if they are set by physical hardware switches (or something like that) or if they can be changed programmatically.

SECOND EDIT: I read the page I referred you to more thoroughly, and notice that the original questioner checked the Google API and concluded that it is not possible to change the range through it:

API dosen't allow to change them. I think that i can find this data in the api source, but it is not simple. Now i'll try. – MarcoBiagi Mar 13 '11 at 10:36




回答2:


Given the max acceleration magnitude you are reading from your Galaxy S is 3.5 g, your Galaxy S accelerometer appears to be setup to have a per axis accelerometer range of +/- 2g (i.e., sqrt(2.0*2.0 + 2.0*2.0 + 2.0*2.0) = 3.5). For reference, here are the per axis accelerometer ranges of your Galaxy S, the Moto G, and the Nexus Android devices:

Galaxy S: +/- 2g
Moto G: +/- 2g
Nexus 1: +/- 2g
Nexus S: +/- 2g
Nexus 4: +/- 4g
Nexus 5: +/- 2g

The per axis accelerometer range is typically not given in a phone's specification sheet. Therefore, if other readers happen to know the max range of their phone's accelerometer, please feel free to add it to this list.

Unfortunately, the accelerometer Sensor.getMaximumRange() API is inconsistent: returns "zero to peak" values on most devices but "peak to peak" on some (e.g., the Moto G) as described in this tracked Android OS issue. One approach to knowing whether a particular device returns Sensor.getMaximumRange() as "zero to peak" or "peak to peak" is to run a free sensor data plot application like ftNote and vigorously shake the device to see where the accelerometer readings clip in the plotted sensor values.



来源:https://stackoverflow.com/questions/12739143/android-accelerometer-max-values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!