MicTesting

加速度センサーテスト

スマホの X、Y、Z の動きと振り検出を可視化します。

瞬時に読み込み
  • Open on a phone or tablet
  • On iOS, tap Enable when prompted
  • Lay the device flat to start with zeroed values
  • Try the gravity toggle to compare raw vs gravity-excluded data

使い方

01

Open on Mobile

Requires a phone or tablet sensor.

02

Grant Permission

iOS asks for motion access: tap Allow.

03

Move or Shake

Watch X, Y, Z values change in real time.

Troubleshooting

  1. Tap Enable on iOS to grant motion permission
  2. Verify device has an accelerometer (most do)
  3. Try a different browser

機能

Live X / Y / Z

Acceleration in m/s².

Shake Detection

Counts shake events.

Motion History

Live graph of recent motion.

Gravity Toggle

Include or exclude gravity.

完全ガイド

What Does the Accelerometer Measure?

The accelerometer measures linear acceleration on three axes: X (left/right), Y (up/down), Z (forward/back relative to the device). Values are in meters per second squared (m/s²). At rest on a flat surface, Earth's gravity (~9.81 m/s²) appears on the Z axis pointing down. Other axes read near zero. Tilt the phone and the gravity vector redistributes across X, Y, and Z based on orientation. During motion, the accelerometer measures the change in velocity. Shaking the phone produces rapid back-and-forth swings on whichever axis matches the shake direction. Steady walking produces a consistent oscillation pattern visible in our motion history graph. Modern smartphone accelerometers are MEMS devices similar to gyroscopes. They're accurate to ~0.01 m/s² and update at hundreds of samples per second internally, though the browser typically delivers samples at 60 Hz.

Gravity vs Linear Acceleration

Raw accelerometer data includes both gravity and motion-induced acceleration. accelerationIncludingGravity reports the combined value. acceleration reports just the linear (motion) part, with gravity mathematically subtracted by the OS. For most uses, the gravity-excluded acceleration is more useful: it tells you how the phone is being moved, independent of how it's oriented. Step counting, shake detection, and game motion controls all use this. Gravity-included data is useful for orientation detection. By measuring which axis points down (toward gravity), the OS knows how to rotate the screen. Toggle the 'Include gravity' option in our tester to see both modes. Notice how the gravity-included version shows ~9.8 on whichever axis is down, while the gravity-excluded version reads near zero at rest.

Shake Detection Algorithm

Shake detection works by measuring the magnitude of acceleration vector: the combined intensity of motion across all three axes. When this magnitude exceeds a threshold (typically ~15 m/s²) and rapidly reverses direction, a shake event is registered. Our tester implements this with a simple threshold. More sophisticated apps look for repeated reversals within a time window, which prevents single jolts (like dropping the phone) from registering as a shake. Shake-to-undo on iPhone uses a similar algorithm. Some Android phones use shake gestures to launch the camera or flashlight. For robust shake detection, low-pass filter the raw data first to remove high-frequency noise. Then compute magnitude and look for crossings above a threshold.

Use Cases for the Accelerometer

Step counting: every step produces a characteristic vertical bounce pattern. Pedometer apps count these patterns over time. The iPhone's M-series motion coprocessors do this in dedicated low-power hardware. Screen rotation: detect which way is down and rotate the UI accordingly. Combined with the gyroscope for smooth rotation animations. Shake-to-undo, shake-to-shuffle, shake-to-refresh: gestures triggered by shake detection. Fall detection: smartwatches use accelerometer + gyroscope to detect falls and offer to call emergency services. Apple Watch and Fitbit both implement this. Gaming: tilt-to-steer racing games, gravity-based puzzle games, motion-controlled platformers. The accelerometer measures the phone's tilt as input. Seismic monitoring: networked phone accelerometers have been used to crowdsource earthquake detection. The MyShake app from Berkeley uses millions of phones as a distributed seismic network.

Sensor Calibration and Accuracy

Accelerometer drift is far less common than gyroscope drift: the sensor measures instantaneous acceleration without time-integrating, so small errors don't accumulate. If your accelerometer reports non-zero values when the phone is perfectly flat, that's calibration error. Most phones don't expose user-facing calibration, but a hard reset of motion sensors can sometimes fix it. For scientific applications, consumer accelerometers are accurate enough for motion gestures and step counting but not precision measurement. Lab-grade accelerometers are 100x more accurate. Magnetic interference doesn't affect the accelerometer directly (it affects the magnetometer). But strong vibration sources (motors, speakers playing bass) can produce false readings if held near the phone.

対応状況

主要なすべてのプラットフォームとブラウザで動作します

デバイス / OSChromeFirefoxSafariEdge
Windows 10/11:
macOS Ventura+
Android 8+:
iPhone / iPad (iOS 14+): :
Chromebook: : :
Linux (Ubuntu):

よくある質問

Tap Enable on iOS to grant motion permission.

このツールは役に立ちましたか?

このツールを評価

5 段階中 4.4 ・ 814 件の評価