Each smartphone has a small sensor, without which modern phones would be much stupid. This is an accelerometer – a sensor responsible for the detection of motion and orientation of the device.
Source link
What does an accelerometer do on the phone? Is responsible for more things than you think
