Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Maximum accelerometer reading

scotopiascotopia Posts: 2,074Registered Users
edited December 2011 in iPhone SDK Development
Hello All,

Does anyone know the maximum accelerometer reading the iPhone is capable of. I made a simple app to test this and it seems like I can't get anything higher than 2.307 on the x-axis no matter how fast I swing it...I hope this isn't the limit. Thanks.
Post edited by scotopia on
<div align="center"><br />
<br />
<a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
<br />
<a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi

Replies

  • scotopiascotopia Posts: 2,074Registered Users
    edited October 2008
    I looked at the manufacturer page of the accelerometer the iPhone employ's and it looks like it capable of detecting several thousand G...anyone know why it is capping my output at slightly more than 2G? Thanks.
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
  • jeff_lamarchejeff_lamarche Posts: 420Registered Users
    edited October 2008
    Know? No. Suspect? Yes.

    They're using a double to store the value. By limiting the range of the acceleration to a range of -2.3 to +2.3, they ensure a very fine level of precision, allowing them to inform you of even tiny fractional changes. The bigger the range they covered, the less precise the information would be. They probably assumed that most sane people wouldn't be subjecting their several hundred dollar devices to several thousand Gs, but that for many purposes, a high level of precision would be important.

    That's my guess. I noticed the same thing, by the way, on the 1G phone and the 2G Touch - it's not a hardware thing, it's definitely done that way in the software on purpose.
    <a href="http://iphonedevelopment.blogspot.com/" target="_blank"><font color="red">Check out my iPhone Dev Blog</font></a><br />
    You can send me e-mail at my forum username at mac dot com.
  • scotopiascotopia Posts: 2,074Registered Users
    edited October 2008
    Thanks for responding Jeff,

    That's pretty much what I expected, which stinks. I don't need a much wider range... 5g would be good for my purposes; do you think there might be any way to bypass this limit via overriding the UIAccelerometer class or some such? Thanks.
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
  • jeff_lamarchejeff_lamarche Posts: 420Registered Users
    edited October 2008
    I'm sure it's possible, but not without using private APIs and undocumented methods, and if Apple discovers you're doing that in your app, they'll likely ban it from the app store.

    I'd start by opening an enhancement request using the bug reporter:

    https://bugreport.apple.com/cgi-bin/WebObjects/RadarWeb.woa/wa/signIn
    <a href="http://iphonedevelopment.blogspot.com/" target="_blank"><font color="red">Check out my iPhone Dev Blog</font></a><br />
    You can send me e-mail at my forum username at mac dot com.
  • scotopiascotopia Posts: 2,074Registered Users
    edited October 2008
    Ironically I am getting an error when I try to log in to the bug reporter; lol.
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
  • jeff_lamarchejeff_lamarche Posts: 420Registered Users
    edited October 2008
    Try using https://bugreport.apple.com/ instead, and see if that works.
    <a href="http://iphonedevelopment.blogspot.com/" target="_blank"><font color="red">Check out my iPhone Dev Blog</font></a><br />
    You can send me e-mail at my forum username at mac dot com.
  • scotopiascotopia Posts: 2,074Registered Users
    edited October 2008
    Same Deal. I have javascript and cookies enabled etc so I don't think the error is on my end.
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
  • TwoBitsTwoBits Posts: 13Registered Users
    edited October 2008
    scotopia wrote: »
    Hello All,

    Does anyone know the maximum accelerometer reading the iPhone is capable of. I made a simple app to test this and it seems like I can't get anything higher than 2.307 on the x-axis no matter how fast I swing it...I hope this isn't the limit. Thanks.


    The accelerometers used in the first and second generation iPhones (and I assume also the iPod touches) operate in two modes: +/- 2 g, and +/- 8 g. (Actually, as you observed, they report accelerations somewhat outside the nominal range. Accuracy is not spec'ed outside that range, though.)

    Apple operates them in the +/- 2 g mode. There is a tradeoff: The current resolution is nominally 0.018 g, according to the datasheet (though my first generation iPhone uses 0.018168604, according to a modified version of AccelerometerGraph). In the +/- 8 g mode, the resolution would be four times cruder.

    I assume Apple decided that the finer resolution would be more useful than the wider range. (I'd rather see finer resolution than 0.018 g. So neither of us is fully satisfied.)

    You cannot change the mode with any published feature of the APIs. Since they are passing acceleration as a double, they could theoretically allow a change in mode, and simply look at the mode when rescaling the A/D value, before reporting acceleration. (The obvious place to set the mode would be in the call which sets up the application to receive accelerometer information.) However, for backward compatibility, the OS would have to set the accelerometer mode to +/- 2 g at the beginning of the application. And none of the background processes could be allowed to set the accelerometer mode.
  • scotopiascotopia Posts: 2,074Registered Users
    edited October 2008
    Extremely informative post; thank you very much.
    <div align="center"><br />
    <br />
    <a href="http://bit.ly/c4r7uo" target="_blank">omegasoftIconBanner.png</a><br />
    <br />
    <a href="http://bit.ly/9EGiHD" target="_blank">Aura Trainer</a> | <a href="http://bi
  • JustinJMJustinJM Posts: 1New Users
    edited October 2008
    THanks for the info. Where did you find this valuable information? Can you share the accelerometer part # or datasheet?
  • TwoBitsTwoBits Posts: 13Registered Users
    edited October 2008
    According to published dissection reports, the original iPhone uses the LIS302DL, and the iPhone 3G uses the similar LIS331DL, both manufactured by STMicroelectronics.

    The first generation iPod touch is also reported to use an STMicroelectronics accelerometer (I suspect the LIS302DL). The second generation iPod touch uses the LIS331DL.

    Go to Welcome to STMicroelectronics, click on "Sensors and MEMS", then "Accelerometers", and so forth, to arrive eventually at the datasheets.
  • izalduaizaldua Posts: 8New Users
    edited December 2008
    did you succeded changing the accelerometer mode already? i´m going to need this on one of my future projects, when i start working on it i´ll let you know and maybe we can help each other.
  • TwoBitsTwoBits Posts: 13Registered Users
    edited December 2008
    izaldua wrote: »
    did you succeded changing the accelerometer mode already? i´m going to need this on one of my future projects, when i start working on it i´ll let you know and maybe we can help each other.

    I have no plans to try to widen the accelerometer range (by changing to the +/- 8 g mode). I don't even plan to request that Apple put in such a change. I would be interested in hearing the results of anyone else's attempts, though, just as a matter of curiosity.

    Similarly, I would be interested in hearing about any attempts to operate the accelerometer in the 400 Hz mode, rather than the nominally 100 Hz mode which I assume Apple is using. Again, though, I have no plans to make such a change myself.
  • mech-emech-e Posts: 1New Users
    edited December 2011
    Hello,

    This thread has gone cold, but I'm wondering if the world has changed and apple has allowed access to the +/-8g output of the accelerometer? If not, any who are experienced in the world of apple are invited to weigh in on whether this is likely to ever happen?

    Thanks,
    Mech-e
  • TwoBitsTwoBits Posts: 13Registered Users
    edited December 2011
    mech-e wrote: »
    This thread has gone cold, but I'm wondering if the world has changed and apple has allowed access to the +/-8g output of the accelerometer? If not, any who are experienced in the world of apple are invited to weigh in on whether this is likely to ever happen?

    I have no inside knowledge about Apple's intentions for the accelerometer. If I were highly motivated to conjecture, I would probably look at current trends in gaming. Competition with other game hardware manufacturers is (I would guess) the most likely source of any competitive pressure to make changes in the accelerometer.

    The big news about the accelerometer in the recent past is the addition of the gyros. This has (according to Apple) substantially improved the performance of iOS devices in sensing acceleration (even linear acceleration). [Note that Nintendo, and perhaps others, have also added gyros, presumably for the same reason.]

    Will Apple ever widen the range of the accelerometer? I would guess not. I am unaware of any significant applications which would be facilitated by such a change. But if you are a developer, and have some reason to want +/- 8 g, I encourage you to submit an enhancement request. They have other APIs which handle variable precision, such as the location API, so there is precedent of a sort.

    Improved resolution is more likely, but the current performance is good enough that I would not bet on even that change, until such time as their supplier introduces more bits of output at no increased cost (and I have no reason to believe that will happen in the foreseeable future).

    Sorry I can't offer you more definite information.
Sign In or Register to comment.