2

Wrote a simple program that prints out accelerometer output.

mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);
mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);     

It turns out that:

  1. The accelerometer output is always set to "lowest" as determined by:

    public void onAccuracyChanged(Sensor sensor, int accuracy) {
      if (collectingData){  
         accelPrecision.setText("accelerometer accuracy: " + accuracy);
      }
    }
    
  2. The actual accelerometer readings are very inaccurate - about 2%-5% fluctuations even when it's resting on the table

as far as I can tell it's the same problem on Nexus S, Nexus One and G1

Any idea how it could be made mode accurate / what sets a

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
user564594
  • 29
  • 1
  • 2

1 Answers1

0

Use a filter. You are looking at raw data so of course its going to fluctuate. Something like a weighted average or a moving average will suffice.

smith324
  • 13,020
  • 9
  • 37
  • 58
  • 1
    Thanks. But why is my idle Nexus S always reports accuracy as "0" which is (according to the dev docs) "SENSOR_STATUS_UNRELIABLE" - The values returned by this sensor cannot be trusted, calibration is needed or the environment doesn't allow readings – user564594 Jan 13 '11 at 16:32