0% found this document useful (0 votes)
24 views

SensLab M2 Shukla 5778101

The document discusses magnetic field sensors and measurements of Earth's magnetic field. It describes the theory behind magnetic fields, Hall sensors, and the BMM150 magnetic sensor. Methods describe using the BMM150 on a Nicla Sense ME board to take 1000 readings of the magnetic field and calculate mean intensities and distributions. Tests evaluated the sensor offset by taking readings in normal and flipped orientations.

Uploaded by

ananyashukla2110
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

SensLab M2 Shukla 5778101

The document discusses magnetic field sensors and measurements of Earth's magnetic field. It describes the theory behind magnetic fields, Hall sensors, and the BMM150 magnetic sensor. Methods describe using the BMM150 on a Nicla Sense ME board to take 1000 readings of the magnetic field and calculate mean intensities and distributions. Tests evaluated the sensor offset by taking readings in normal and flipped orientations.

Uploaded by

ananyashukla2110
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Laboratory for Electrical Instrumentation and Embedded Systems

IMTEK – Department of Microsystems Engineering


University of Freiburg

Sensors Lab Course


Winter Term 2023/24

Lab Report 2
Magnetic Sensors

Ananya Shukla (5778101)


January 10th, 2024

Data generated together with


• Daniela Karakuleva (5780327)
• Margarita Tashulova (5775077)
• Maria Paola Fonseca Paez (5772556)
1 Introduction
Magnetic fields, integral to Earth's natural forces, are imperceptible to humans. The
need for technology arises to interpret these invisible forces. In this module, we use the
BMM150 onboard the Nicla Sense ME to read and understand magnetic field intensity
of the Earth’s magnetic field. By unveiling the unseen, this sensor plays a pivotal role in
enhancing our understanding of Earth's magnetism and facilitating daily technological
interactions.

2 Theory
2.1 The Earth’s Magnetic Field
The Earth's magnetic field, shaped by the flow of liquid iron in the core, forms a resilient
protective shield around our planet. This dynamic shield undergoes gradual changes
and periodic polarity transitions, influencing the behavior of compass needles. The most
common theory is that the movement of the inner liquid core induces currents in the
outer solid core which induces a magnetic field.
Due to the inner core being liquid, it is affected by the earth’s rotation, among many
other factors. Hence, the magnetic axis deviates from the earth’s rotation axis. True
north, which is what a compass points to if there are not any deflections, is also subject
to change. There exist various regional anomalies as well which affect a location’s
magnetic field. In Germany, the deviation of the compass from true North, or Magnetic
North is up to 3°. [1]
Using the BMM150 onboard the Nicla Sense ME, the magnetic field intensities across
the x, y and z axes are calculated. The following formulae can be used to calculate
horizontal, vertical, and total magnetic field intensity: [1]

(1)

(2)

(3)
Where Bx is the Magnetic Field Intensity along the x-axis, By is the Magnetic Field
Intensity along the y-axis, Bz is the Magnetic Field Intensity along the z-axis, Bhor is the
Horizontal Magnetic Field Intensity, Bver is the Vertical Magnetic Field Intensity, and B
is the Total Magnetic Field Intensity. [1]
All this is under the assumption that the z-axis is perpendicular to the ground.

2.2 Hall Sensor


A Hall sensor is a semiconductor device that detects magnetic fields through the Hall
effect. When exposed to a magnetic field, the sensor produces a voltage proportional to
the field's strength and polarity. This voltage provides a reliable means for measuring
and sensing magnetic fields, making Hall sensors integral in applications such as
position detection, current measurement, and navigation systems.
The Hall Sensor has the shape of a thin plate, which has a quadratic footprint more
recently.

Figure 1: A pictorial representation of the Hall Effect. The Magnetic Field induces
deflections in the charge carriers which in turn induce a Hall Voltage across the width of
the conductor. Image: Spektrum [5]
Fig. 1 demonstrates the Hall Effect. The Magnetic Field (B) induces charge carriers in
the conductor which gives rise to a Current (I). This creates and Electric field (EH),
which in turn the Electric Force (FE) to balance the Lorentz Force (FL): [1]

e.EH = -e v × B (4)

e represents Elementary Charge. Across the width b, the Hall Voltage w.r.t to the charge
carrier velocity is as follows:

UH = -bvB (5)

Coming to the current I, if we use the charge carrier density and the thickness d of the
Hall Plates:

𝐼𝐵
UH = 𝑒𝑛𝑤 (6)

2.3 FlipCore Element


Bosch Sensortec's exclusive FlipCore technology uses a fluxgate sensor with a sender
coil driving a core through saturation magnetization and a receiver coil catching the
signal that is created. A second harmonic signal is produced by an external magnetic
field that represents the intensity that must be measured. Using a thin-film core
composed of an iron-nickel alloy, the FlipCore element simplifies the setup by producing
magnetization alternation by periodic excitation. In comparison to the fluxgate sensor
principle, the technology makes time measurement easier and has advantages over Hall
sensors in terms of noise and power consumption. [1]

2.4 The BMM150


The BMM150 is onboard the Nicla Sense ME, and it contains 2 FlipCore elements to
measure the magnetic field intensity along the x and the y axis, and a Hall sensor to
measure the magnetic field intensity along the z axis. They have their own circuits but
utilize the same ADC. [1][2]

Figure 2: A block diagram of the BMM150. Source: BMM150 Datasheet. [3]

3 Methods
All measurements were performed using the Arduino Nicla Sense Board ME, specifically
the embedded BMM150 Magnetometer which contains 2 FlipCore Elements and a Hall
Sensor. The board was connected via USB to a battery-powered ASUS Vivobook Pro 14X
OLED, which was used both as the power supplier of the board, and the data logger. The
board was programmed using the windows application for Arduino IDE 2.2.1 with the
Arduino_BHY2 public library version 1.0.6 from Arduino, which provides the APIs for
Nicla Sense ME board to make a DFU or configure/read BMM150 sensors. [1][2]
The Arduino program read the sensors using the virtual sensors
SENSOR_ID_MAG_PASS for the FlipCore and Hall Sensors. Readings were performed
each 100 ms, resulting in an acquisition rate of 10 Hz. [1][2]
For the magnetic field intensity measurements, virtual sensor PASSTHROUGH which
provides the values from the physical driver directly was used: “SensorXYZ
magn(SENSOR_ID_MAG_PASS);”. Since the magnetic field intensity sensor’s default
configuration has a sensitivity of 16 LSB/g , to obtain the final values, all raw values
were divided by 16. Tasks 1 and 2 were conducted in the University Bibliotek, Task 3
was conducted outside the University Bibliotek. Task 5 was conducted at the Technical
Faculty where the street is aligned to true North.
4 Results and Discussion
Task 1: Magnetic Sensor
In this task, the performance of the BMM150 is examined. A sample size of 1000
readings is registered and then the mean magnetic field intensity and an offset value
along all 3 axes is calculated. The Nicla Sense ME was placed in a stable position on a
desk, undisturbed, while the magnetic field intensity readings were recorded. The figure
below shows an overview of the 1000 readings.

Figure 3: Magnetic Field Intensity readings at rest along the X, Y and the Z axes (at a
stable position on a desk). Measurement rate is 10Hz.
From Figure 3 we conclude that there is no significant drift.
Next, we calculate the mean magnetic field intensity value along all 3 axes. The values
are in the table below.
Table 1: Mean Magnetic Field Intensity for all axes
Mean B along X-Axis in µT Mean B along Y-Axis in µT Mean B along Z-Axis in µT
13.15733 µT -133.13227 µT 252.79953 µT

The Mean value was subtracted from the array of a 100 values and plotted histograms
to observe the distribution:

Figure 4: The distribution of the Mean Magnetic Field Intensity subtracted from the set
of readings for all 3 axes.

Here it can be observed that the values follow a normal distribution for all the magnetic
field intensity along all 3 axes. The X and Y directions are behaving similarly but the Z
axis, although still normally distributed, is behaving slightly differently. This is due to
the FlipCore Element being used for measurement along the X and Y directions and a
Hall Sensor being used to measure along the Z axis. The Hall Sensor has values which
deviate to a ±2 µT, whereas the FlipCore Element values have a maximum deviation of
±1.5 µT.
Task 2: Evaluate the Offset on all 3 Axes
In this task, the offset of the sensor along all the 3 axes is evaluated.
It was made sure that the sensor was in a stable position, not near any metals or
magnets, that could potentially harm our experiment. The first set of 100 readings were
taken in an arbitrary direction, and the second set of 100 readings were taken after
flipping the sensor along the X axis and then the Y axis.
It was made sure that the position of the board was not altered, and that no external
factors were affecting the magnetic field intensity.
The mean of the magnetic field intensity along each axes for both readings can be seen
in the table below.
Table 2: Mean Magnetic Field Intensities for all Axes in both directions (Original and
Flipped).
Mean Values X-Axis (in µT) Y-Axis (in µT) Z-Axis (in µT)
Original Direction -25.09027 µT 174.58432 µT 145.88288 µT
Flipped - 8.50449 µT 258.56048 µT 148.85540 µT

The values for the Magnetic Field Intensities for all 3 axes for both directions are
plotted below.

Figure 5: Line plots of the magnetic field intensities along all 3 axes in both directions
on their respective graphs.
Using these values, the offset value was calculated for each Axis. After the subtraction, a
mean value is taken.

Table 3: Offset values for the magnetic field intensity along all 3 axes.
Offset along X-Axis in µT Offset along Y-Axis in µT Offset along Z-Axis in µT
8.29289 µT 41.98807 µT 1.񈘦 µT

After observing the values above, it can be concluded that they are within the specified
range given in the datasheet. The X and Y axis readings behave similarly whereas the
reading along the Z axis has more irregularities.
It is concluded that since the X and Y axis readings are being taken using the FlipCore
Element, and the Z axis readings are being taken by the Hall Sensor, the differences are
valid. Even with the irregularities, they are within range as specified in the datasheet.

Task 3: Earth’s Magnetic Field


In this task, the Nicla Sense ME (along with a laptop as a power source) was placed in
an outdoor location. 100 readings were taken of the magnetic field intensity along all 3
axes. The mean values of these readings can be found in the table below.

Table 4: Magnetic Field Intensities along all 3 axes for task 3


B along X-Axis in µT B along Y-Axis in µT B along Z-Axis in µT
29.00470 µT 46.15448 µT -5.18597 µT

Considering the offset values calculated in Task 2, the offset was subtracted from the
new readings and then the mean was taken again. The new values can be found in the
table below.
Table 5: Magnetic Field Intensities (Adjusted for offset) along all the axes for task 3.
B(adj. offset) along X-Axis B(adj. offset) along Y-Axis B(adj. offset) along Z-Axis
in µT in µT in µT
20.71181 µT 4.16641 µT 6.67223 µT

Next, the standard deviation was calculated using the adjusted mean. Results are in the
table below.

Table 6: The calculated Standard Deviation for the Adjusted Magnetic Field Intensities
along all 3 axes.
Std. Deviation along X-Axis Std. Deviation along Y-Axis Std. Deviation along Z-Axis
in µT in µT in µT
0.59429 µT 0.50276 µT 0.52884 µT
Task 4: Evaluating Horizontal and Vertical Magnetic Field Intensity
For this task, the given formulae were used to calculate the Horizontal Magnetic Field
Intensity (Bhor), the Vertical Magnetic Field Intensity (Bhor) and the Total Magnetic Field
Intensity (B). Formulae (1), (2) and (3) were used to perform this calculation. The
readings from Task 3 were used since they were outdoors, away from metals and other
magnetic objects. The values can be seen in the table below.

Table 7: The calculated Horizontal, Vertical and Total Magnetic Field Intensities for the
data from Task 3
Bhor in µT Bhor in µT B in µT
21.12671 µT - 6.67223 µT 22.15528 µT

The table below gives the expected values from the geomagnetic model for the exact
location of our experiment. [4]

Table 8: The expected values for the Horizontal, Vertical and Total Magnetic Field
Intensities according to the Geomagnetic Model.
Bhor (Expected) in µT Bhor (Expected) in µT B (Expected) in µT
21.254 µT 43.526 µT 48.438 µT

The values for the Horizontal Magnetic Field Intensity are very close to the expected
value from the Geomagnetic model. However, the Vertical Intensity is not entirely
accurate. As mentioned in the theory, the intensity along the X and Y axis is measured
by the FlipCore Element, which is better at detecting magnetic fields as compared to the
Hall Sensor, which is what was employed to detect the Magnetic Field Intensity along
the Z axis. The experiment was conducted 5 times, in the same location, with 4 different
devices and the results were similar. It is assumed that since the recording device was a
laptop, which contains a lot of metal and magnetic parts. It was impossible to omit the
laptop from the experiment since it is the device that powers the sensor as well as
records the data.
Regarding the resolution, the datasheet says that the resolution of the sensor is 0.3 µT.
From our readings it can be concluded that the sensor’s resolution is correct. [3]
Regarding the accuracy, from the above values, it can be seen that the sensor may not be
entirely accurate. It could also be affected by the metals and the magnetic components of
the laptop. [3]
Regarding the offset, the only thing mentioned in the datasheet is a Zero-B offset, which
is an offset value when there is no magnetic field. Since that is not true for our case, it
cannot be realistically determined what range should our offset lie in. Still, if we
consider the Zero-B offset, which is ±40 µT, our offset values are either inside the range
or very close to the boundary. [3]
Task 5: Calculating True North
For this task, the sensor was placed in a secure position with the X-Axis pointing
towards north, which was determined using a compass and then verified using Google
Maps. This part of the experiment was conducted near the road pointing north in the
Technical Faculty of the University of Freiburg.
The table below gives mean values for BX and By.

Table 9: The table gives mean values of Magnetic Field Intensities along the X and Y
axis.
Mean BX in µT Mean By in µT
- 1.95975 µT 204.42554 µT

After calculating these values, trigonometric calculations were used to calculate how
much are the readings deviating from True North. The angle came out to be - 3.61157 °.
It is also mentioned in the theory that Germany has a declination angle of up to 3 °.
Factoring that into our value, we get the angle of declination as -0.61157 °,
approximately.
This value is close to the actual ideal value, which should be 0°. After observing the
results, it can be confidently said that the results are accurate enough to relate possible
deviations to the inclination.

5 Summary
After conducting the experiment, it was learned that the FlipCore elements are better at
reading magnetic field intensities than the Hall Sensor, as seen in Task 3 and 4. The X
and Y axis values were close to the ideal values, but the Z-axis values deviated from the
ideal.
Using the BMM150 onboard the Nicla Sense ME, we also accurately calculated True
North, since the calculated angle of declination was very close to 0 °.

References
[1] J. Kieninger, S. J. Rupitsch, Sensors Lab Course. University of Freiburg. Winter
term 2023/24.
[2] Arduino® Nicla Sense ME, https://docs.arduino.cc/resources/datasheets/ABX0005
0 - datasheet.pdf. Arduino (last updated Nov. 21, 2023).
[3] Bosch Sensortech BMM150 Datasheet, https://www.bosch-
sensortec.com/products/motion-sensors/magnetometers/bmm150/. Bosch
Sensortec GmbH 2023.
[4] Geomatrix Earth Science, Regional Magnetic Field Calculator,
https://www.geomatrix.co.uk/tools/magnetic-field-calculator/. Geomatrix Earth
Science Ltd 2024.
[5] Spektrum, Lexicon of Physics, Hall Effect,
https://www.spektrum.de/lexikon/physik/hall-effekt/6336. Spektrum 2024.

You might also like