RunTheTests
/

Accelerometer / Shake Test

Check the accelerometer responds, and see the peak force in g as you move.

X

0.00

Y

0.00

Z

0.00

Shake or tilt the device. Peak so far: 0.00 g.

Result

No motion events arriving

Nothing is being delivered. On a desktop machine that is expected — there is no accelerometer. On a phone it usually means the page is not on a secure connection, since motion data is restricted to HTTPS.

Diagnostic telemetry
Peak acceleration
0.00 g
Events received
0
X · Y · Z
0.0 · 0.0 · 0.0 m/s²
Reading sourceGyroscope and accelerometer are combined and filtered before a page sees anything. The raw sensor is not exposed.
OS-fused

What this cannot tell you

  • What a browser receives is the operating system's fused estimate rather than the raw sensor. Gyroscope and accelerometer data are combined and filtered before any page sees them.
  • iOS requires an explicit permission grant, and the request must come from a tap. Without it no motion data arrives at all.
  • Motion events are restricted to secure connections. On an insecure page nothing is delivered and it looks identical to a broken sensor.
  • Desktop machines have no accelerometer, so no events is the correct result there rather than a fault.
  • Only reports what the platform exposes. Browsers receive an operating-system estimate rather than a raw sensor reading, and the raw sensor is not available to any web page.
  • Nothing is stored or sent anywhere. Readings are rendered in the page and gone when you leave.

Take this with you

How this test works

DeviceMotion events are read and the magnitude of the acceleration vector is converted to multiples of standard gravity. Where acceleration excluding gravity is available it is used directly; where only the gravity-inclusive reading exists, one g is subtracted so a stationary device reads near zero rather than near one. On iOS the permission model is handled explicitly rather than silently failing: the platform requires a grant that must originate from a tap, so a button is shown rather than the page appearing to have a dead sensor. Whatever arrives is the operating system's fused estimate — raw accelerometer output is not available to web pages on any platform.

What the results mean

Peak acceleration
The largest force seen, in multiples of gravity. A firm shake reaches two to three g.
Events received
Whether data is arriving at all. Zero on desktop is correct, not a fault.
X · Y · Z
Instantaneous acceleration on each axis in metres per second squared.
OS-fused
The reading is filtered and combined by the platform. No browser exposes the raw sensor.

Common problems and fixes

No events on my phone
Check the page is on HTTPS — motion data is restricted to secure connections, and an insecure page looks exactly like a broken sensor. On iOS, tap the permission button first.
Nothing happens on my laptop
Correct behaviour. Laptops and desktops have no accelerometer, so there is nothing to report.
The values look noisy when the phone is still
Some noise is normal and the platform's filtering does not remove all of it. A stationary device reading a few hundredths of a g is healthy.

Frequently asked questions

Why does iOS ask permission for motion data?

Because motion and orientation streams can be used to infer things like typing on a nearby keyboard, and they were being read silently by pages that had no reason to. Apple put them behind an explicit grant that must come from a user gesture.

Can a website read the raw accelerometer?

No. Every platform hands browsers a fused, filtered estimate produced by combining the accelerometer and gyroscope. The raw chip output is not exposed.

What is a normal peak reading?

A stationary device sits near zero. Ordinary handling is a few tenths of a g, and a deliberate shake reaches two to three. Anything much higher is a drop.

More in Device