# Instrumentation & Measurement Magazine 23-2 - 25

```setup is powered by a coin-type battery and can be attached on
people or on small vehicles.
An MEMS often includes a gyroscope and an accelerometer. The gyroscope output is a voltage that depends on the
angular rate of the package. The angular position (angle) can
then be computed by integrating the angular rate [12]-[14].
The output voltage is affected by both offset and gain errors,
which should be compensated to achieve accurate measurements. The accelerometer output depends on both the linear
acceleration of the package and the gravitational field. Each
of the above sensors generates three output voltages corresponding to the axes x, y, and z. The positions and the signs of
these axes are shown in Fig. 4a. The roll, pitch, and yaw angles
can be computed by integrating the angular rate on x, y, and
z axes of the gyroscope. The first two angles can also be computed as [15]:

 ay
roll = atan 
 az



 ,	(1)




ax
pitch = atan 
 2 2
 a y + az



 ,	(2)




where ax, ay, and az represent the outputs of the accelerometer
corresponding to the axes x, y, and z.
It should be noted that the above equations hold true when
the z axis of the accelerometer is aligned with the gravitational
force and there is not any linear acceleration.

Fig. 4. (a) The axes on the sensor MPU-9250 [12]; (b) The experimental setup.
April 2020

The goal of this application is to familiarize our fourth-year AE
students with MEMS, specifically the accelerometer and the
gyroscope. It was developed during the first semester as a project in the Software for Applied Electronics discipline.
In the fourth year AE specialization there are about 100 students divided into seven groups. The above project is given to
two to three students from each group. They work on an individual MEMS educational kit. The students involved in this
project should have good knowledge in physics, radio communications, measurement fundamentals, and MATLAB
programming. At the end of the project the following skills
were achieved:
◗◗ Ability to acquire and interpret data achieved from a
MEMS via serial interface;
◗◗ Understanding the basics of BLE;
◗◗ Development of Graphical User Interfaces (GUIs) in
MATLAB environment.

Description of the Application

and

Educational Objectives

The setup contains the following hardware components: a
CC2540 BLE USB Dongle, a CC2650 Sensor Tag, and a PC (Fig.
4b). As a software tool, we have used the BLE Device Monitor [13].
The CC2650 Sensor Tag is based on a complex System-on
Chip (SoC) having two ARM processors and a sensor controller engine. One of the ARM processor controls a radio module
that allows receiving and sending data according to BLE technology. The CC2650 Sensor Tag also contains an MPU 9250
movement sensor which includes a gyroscope, an accelerometer, and a magnetometer. All of these components have three
axes. The raw data achieved by the above sensor component
are shown through the BLE Device Monitor tool.
In the performed wireless communication the CC2540
BLE USB Dongle is configured as Master, while the CC2650
Sensor Tag as Slave. In this case, the raw data generated by
the sensors can be acquired and displayed in numeric format (in hexadecimal) by means of the BLE Device Monitor
tool. Unfortunately, the physical measurement results are not
given and the data are not visualized versus time. Therefore,
the goal of this application is to ensure an online visualization
versus time of the physical measurement results achieved by
the MPU 9250 sensor. This task was performed by means of
the MATLAB environment. The CC2540 BLE USB Dongle
is detected as an UART over USB port (COMx). It was accessed from MATLAB to configure the sensors and to acquire
data. Further computations to transform raw data in physical measurements and to compute pitch and roll angles were
performed. For different sensor movements the achieved results are online visualized versus time. A GUI in MATLAB
environment was designed for this purpose. By using that
GUI, the following operations were performed: initialization
of the serial port COMx, configuration of the CC2540 BLE
USB Dongle, scanning for and connection to BLE devices,
configuration of the device's parameters, enabling notification to receive raw data, processing of those data to obtain the

IEEE Instrumentation & Measurement Magazine	25

```

# Instrumentation & Measurement Magazine 23-2

No label
Instrumentation & Measurement Magazine 23-2 - No label
Instrumentation & Measurement Magazine 23-2 - Cover2
Instrumentation & Measurement Magazine 23-2 - 1
Instrumentation & Measurement Magazine 23-2 - 2
Instrumentation & Measurement Magazine 23-2 - 3
Instrumentation & Measurement Magazine 23-2 - 4
Instrumentation & Measurement Magazine 23-2 - 5
Instrumentation & Measurement Magazine 23-2 - 6
Instrumentation & Measurement Magazine 23-2 - 7
Instrumentation & Measurement Magazine 23-2 - 8
Instrumentation & Measurement Magazine 23-2 - 9
Instrumentation & Measurement Magazine 23-2 - 10
Instrumentation & Measurement Magazine 23-2 - 11
Instrumentation & Measurement Magazine 23-2 - 12
Instrumentation & Measurement Magazine 23-2 - 13
Instrumentation & Measurement Magazine 23-2 - 14
Instrumentation & Measurement Magazine 23-2 - 15
Instrumentation & Measurement Magazine 23-2 - 16
Instrumentation & Measurement Magazine 23-2 - 17
Instrumentation & Measurement Magazine 23-2 - 18
Instrumentation & Measurement Magazine 23-2 - 19
Instrumentation & Measurement Magazine 23-2 - 20
Instrumentation & Measurement Magazine 23-2 - 21
Instrumentation & Measurement Magazine 23-2 - 22
Instrumentation & Measurement Magazine 23-2 - 23
Instrumentation & Measurement Magazine 23-2 - 24
Instrumentation & Measurement Magazine 23-2 - 25
Instrumentation & Measurement Magazine 23-2 - 26
Instrumentation & Measurement Magazine 23-2 - 27
Instrumentation & Measurement Magazine 23-2 - 28
Instrumentation & Measurement Magazine 23-2 - 29
Instrumentation & Measurement Magazine 23-2 - 30
Instrumentation & Measurement Magazine 23-2 - 31
Instrumentation & Measurement Magazine 23-2 - 32
Instrumentation & Measurement Magazine 23-2 - 33
Instrumentation & Measurement Magazine 23-2 - 34
Instrumentation & Measurement Magazine 23-2 - 35
Instrumentation & Measurement Magazine 23-2 - 36
Instrumentation & Measurement Magazine 23-2 - 37
Instrumentation & Measurement Magazine 23-2 - 38
Instrumentation & Measurement Magazine 23-2 - 39
Instrumentation & Measurement Magazine 23-2 - 40
Instrumentation & Measurement Magazine 23-2 - 41
Instrumentation & Measurement Magazine 23-2 - 42
Instrumentation & Measurement Magazine 23-2 - 43
Instrumentation & Measurement Magazine 23-2 - 44
Instrumentation & Measurement Magazine 23-2 - 45
Instrumentation & Measurement Magazine 23-2 - 46
Instrumentation & Measurement Magazine 23-2 - 47
Instrumentation & Measurement Magazine 23-2 - 48
Instrumentation & Measurement Magazine 23-2 - 49
Instrumentation & Measurement Magazine 23-2 - 50
Instrumentation & Measurement Magazine 23-2 - 51
Instrumentation & Measurement Magazine 23-2 - 52
Instrumentation & Measurement Magazine 23-2 - 53
Instrumentation & Measurement Magazine 23-2 - 54
Instrumentation & Measurement Magazine 23-2 - 55
Instrumentation & Measurement Magazine 23-2 - 56
Instrumentation & Measurement Magazine 23-2 - 57
Instrumentation & Measurement Magazine 23-2 - 58
Instrumentation & Measurement Magazine 23-2 - 59
Instrumentation & Measurement Magazine 23-2 - 60
Instrumentation & Measurement Magazine 23-2 - 61
Instrumentation & Measurement Magazine 23-2 - 62
Instrumentation & Measurement Magazine 23-2 - 63
Instrumentation & Measurement Magazine 23-2 - 64
Instrumentation & Measurement Magazine 23-2 - 65
Instrumentation & Measurement Magazine 23-2 - 66
Instrumentation & Measurement Magazine 23-2 - 67
Instrumentation & Measurement Magazine 23-2 - 68
Instrumentation & Measurement Magazine 23-2 - 69
Instrumentation & Measurement Magazine 23-2 - 70
Instrumentation & Measurement Magazine 23-2 - 71
Instrumentation & Measurement Magazine 23-2 - 72
Instrumentation & Measurement Magazine 23-2 - 73
Instrumentation & Measurement Magazine 23-2 - 74
Instrumentation & Measurement Magazine 23-2 - 75
Instrumentation & Measurement Magazine 23-2 - 76
Instrumentation & Measurement Magazine 23-2 - 77
Instrumentation & Measurement Magazine 23-2 - 78
Instrumentation & Measurement Magazine 23-2 - 79
Instrumentation & Measurement Magazine 23-2 - 80
Instrumentation & Measurement Magazine 23-2 - 81
Instrumentation & Measurement Magazine 23-2 - 82
Instrumentation & Measurement Magazine 23-2 - 83
Instrumentation & Measurement Magazine 23-2 - 84
Instrumentation & Measurement Magazine 23-2 - 85
Instrumentation & Measurement Magazine 23-2 - 86
Instrumentation & Measurement Magazine 23-2 - 87
Instrumentation & Measurement Magazine 23-2 - 88
Instrumentation & Measurement Magazine 23-2 - 89
Instrumentation & Measurement Magazine 23-2 - 90
Instrumentation & Measurement Magazine 23-2 - 91
Instrumentation & Measurement Magazine 23-2 - 92
Instrumentation & Measurement Magazine 23-2 - 93
Instrumentation & Measurement Magazine 23-2 - 94
Instrumentation & Measurement Magazine 23-2 - 95
Instrumentation & Measurement Magazine 23-2 - 96
Instrumentation & Measurement Magazine 23-2 - 97
Instrumentation & Measurement Magazine 23-2 - 98
Instrumentation & Measurement Magazine 23-2 - 99
Instrumentation & Measurement Magazine 23-2 - 100
Instrumentation & Measurement Magazine 23-2 - 101
Instrumentation & Measurement Magazine 23-2 - 102
Instrumentation & Measurement Magazine 23-2 - 103
Instrumentation & Measurement Magazine 23-2 - 104
Instrumentation & Measurement Magazine 23-2 - 105
Instrumentation & Measurement Magazine 23-2 - 106
Instrumentation & Measurement Magazine 23-2 - 107
Instrumentation & Measurement Magazine 23-2 - 108
Instrumentation & Measurement Magazine 23-2 - 109
Instrumentation & Measurement Magazine 23-2 - 110
Instrumentation & Measurement Magazine 23-2 - 111
Instrumentation & Measurement Magazine 23-2 - 112
Instrumentation & Measurement Magazine 23-2 - 113
Instrumentation & Measurement Magazine 23-2 - 114
Instrumentation & Measurement Magazine 23-2 - 115
Instrumentation & Measurement Magazine 23-2 - 116
Instrumentation & Measurement Magazine 23-2 - 117
Instrumentation & Measurement Magazine 23-2 - 118
Instrumentation & Measurement Magazine 23-2 - 119
Instrumentation & Measurement Magazine 23-2 - 120
Instrumentation & Measurement Magazine 23-2 - Cover3
Instrumentation & Measurement Magazine 23-2 - Cover4
https://www.nxtbook.com/allen/iamm/24-6
https://www.nxtbook.com/allen/iamm/24-5
https://www.nxtbook.com/allen/iamm/24-4
https://www.nxtbook.com/allen/iamm/24-3
https://www.nxtbook.com/allen/iamm/24-2
https://www.nxtbook.com/allen/iamm/24-1
https://www.nxtbook.com/allen/iamm/23-9
https://www.nxtbook.com/allen/iamm/23-8
https://www.nxtbook.com/allen/iamm/23-6
https://www.nxtbook.com/allen/iamm/23-5
https://www.nxtbook.com/allen/iamm/23-2
https://www.nxtbook.com/allen/iamm/23-3
https://www.nxtbook.com/allen/iamm/23-4
https://www.nxtbookmedia.com