An accelerometer is a sensor that is designed to measure acceleration or rate of change of speed due to motion,…