Accelerometer Test
Test your device accelerometer in real-time. View X, Y, Z axis data, measure g-force magnitude, track peaks, and export sensor readings to CSV.
About
Modern smartphones and tablets contain MEMS accelerometers that measure proper acceleration along three orthogonal axes. Proper acceleration differs from coordinate acceleration: a device at rest reports 1g (≈ 9.81 m/s2) on the vertical axis due to gravitational force. This tool reads raw sensor data via the DeviceMotionEvent API and computes the total magnitude a = √x2 + y2 + z2 in real time. An optional low-pass filter with configurable smoothing factor α isolates gravitational vs. linear components. Sensor accuracy varies by hardware: consumer-grade MEMS accelerometers typically exhibit noise floors of 0.01 - 0.05 m/s2 and update at 60 - 200 Hz depending on the chipset and browser throttling.
Incorrect accelerometer readings can cause failures in step-counting algorithms, screen rotation logic, gaming controls, and structural vibration monitoring. This tool exposes the raw data stream so you can verify calibration, detect dead axes, and identify bias drift before relying on sensor output in production applications. Note: desktop browsers without physical sensors will report zero on all axes. iOS 13+ requires an explicit user permission grant before motion data is accessible.
Formulas
The total acceleration magnitude is the Euclidean norm of the three-axis vector:
where ax, ay, az are acceleration values along each device axis in m/s2.
The exponential moving average low-pass filter separates gravity from linear acceleration:
where α ∈ [0, 1] is the smoothing factor. Smaller α values produce heavier smoothing. A common default is α = 0.8. Linear acceleration is then: ln = an − gn.
Tilt angles derived from static acceleration readings:
where θx is pitch and θy is roll in degrees.
Sampling frequency estimation from event timestamps:
where Δt is the average interval between consecutive DeviceMotionEvent timestamps in milliseconds.
Reference Data
| Parameter | Typical Range | Unit | Notes |
|---|---|---|---|
| Measurement Range | ±2 to ±16 | g | Configurable in hardware; most phones default to ±8g |
| Sensitivity | 0.001 - 0.004 | g/LSB | 14-bit or 16-bit ADC resolution |
| Noise Density | 99 - 300 | μg/√Hz | Lower is better; affects static precision |
| Update Rate (Browser) | 10 - 200 | Hz | Chrome ~60 Hz, Safari ~60 Hz, Firefox ~60 Hz |
| Earth Gravity (g) | 9.7803 - 9.8322 | m/s2 | Varies by latitude and altitude |
| Standard Gravity | 9.80665 | m/s2 | ISO 80000-3 defined constant |
| Zero-g Offset (Bias) | ±20 - 80 | mg | Factory calibration residual |
| Cross-Axis Sensitivity | ±1 - 2 | % | Leakage between orthogonal axes |
| Temperature Drift (TCS) | ±0.01 - 0.02 | mg/°C | Significant for long-term monitoring |
| Power Consumption | 6 - 200 | μA | Depends on ODR and operating mode |
| Common Chipsets | Bosch BMA456, STMicro LIS2DH12, InvenSense ICM-42688, Analog ADXL345 | ||
| Free-Fall Threshold | < 0.3 | g | Used for drop detection in phones |
| Shock Survival | 10000 | g | Mechanical shock tolerance (non-operating) |
| Tilt Accuracy (derived) | ±0.5 - 1.0 | ° | From arctan of axis ratios at rest |
| Bandwidth (3dB) | 1 - 1000 | Hz | Hardware low-pass filter cutoff |
| FIFO Buffer | 32 - 1024 | samples | On-chip buffering reduces CPU wakeups |