Acquiring accelerometer data
In this recipe, we will develop an application to read the accelerometer measurements from the MPU-6050 IMU with a frequency of 50 Hz and send them over the serial monitor.
The data transmitted serially will be acquired in the following recipe to build the training dataset.
Getting ready
The accelerometer is a sensor that measures accelerations on one, two, or three spatial axes, denoted as X, Y, and Z.
In this project, we will use the three-axis accelerometer integrated into the MPU-6050 IMU to recognize three hand gestures.
However, how does the accelerometer work, and how can we take the measurements from the sensor?
Let’s answer these questions in the following subsection.
The basic principles of the accelerometer
Consider the following system, which consists of a mass attached to one end of a spring:
Figure 9.8: Mass-spring system
The preceding...