The sensor API only works on devices which have the sensors and provide access to them, and when served via HTTPS.