title: Increase the Range of Android Accelerometer
body: <p>This question has been asked in a few ways but there has been no conclusive answer to it.</p>
  
  <p>I am trying to find out the maximum range of the accelerometer on Android phones.
  Some forums claim +-2Gs and some +-3.5Gs. </p>
  
  <p>The accelerometer hardware (of the LSM330 which is on the s4) has a higher range, up to 16Gs.
  <a href="http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00059856.pdf" rel="nofollow noreferrer">http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00059856.pdf</a></p>
  
  <p>I wrote an application to practically find this range and loaded it onto an S4. The following picture shows the readings.
  Clearly, the maximum range in each direction is 2Gs.</p>
  
  <p><img src="https://i.stack.imgur.com/ElnHn.png" alt="Application Readings"></p>
  
  <ol>
  <li>Is there a way to increase this range and if so, how?</li>
  <li>Has anyone found a larger default range on other Android phones?</li>
  </ol>
  
  <p>For those interested, here is the nb part of my code:</p>
  
  <pre><code>public class MainActivity extends Activity implements SensorEventListener{
  
  Sensor accelerometer;
  SensorManager sm;
  
  TextView maxValue;
  TextView realTimeValues;
  TextView realTimeResultant;
  TextView maxValues;
  TextView maxResultant;
  
  float x = 0;
  float y = 0;
  float z = 0;
  float res = 0;
  float xMax = 0;
  float yMax = 0;
  float zMax = 0;
  float resMax = 0;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      sm = (SensorManager)getSystemService(SENSOR_SERVICE);
      accelerometer = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
  
      sm.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_FASTEST);
  
      maxValue = (TextView)findViewById(R.id.MaxValue);
      realTimeValues = (TextView)findViewById(R.id.RealTimeValues);
      realTimeResultant = (TextView)findViewById(R.id.RealTimeResultant);
      maxValues = (TextView)findViewById(R.id.maxValues);
      maxResultant = (TextView)findViewById(R.id.maxResultant);
  
  
      float max = accelerometer.getMaximumRange();
      maxValue.setText("Max range: "+ max);           
  }
  
  @Override
  public void onSensorChanged(SensorEvent event) {
  
      if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
          return;
  
      x = event.values[0];
      y = event.values[1];
      z = event.values[2];
      res = (float) Math.sqrt( x*x + y*y + z*z);
  
      realTimeValues.setText("X: " + x + "\nY: " + y + "\nZ: " + z);
      realTimeResultant.setText(res + " m/s^2");
  
      if (Math.abs(x) &gt; Math.abs(xMax))
          xMax = x;
      if (Math.abs(y) &gt; Math.abs(yMax))
          yMax = y;
      if (Math.abs(z) &gt; Math.abs(zMax))
          zMax = z;
      if (res &gt; resMax)
          resMax = res;
  
      maxValues.setText("X: " + xMax + "\nY: " + yMax + "\nZ: " + zMax);
      maxResultant.setText(resMax + " m/s^2");    
  }
  }
  </code></pre>