Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

For this experiment, it is necessary to use your own laptop during the experiment. You also need the Arduino IDE. In case you do not have access to a laptop, please ask the WorkINGLab staff a couple of days in advance. They are able to provide you with a PC for the experiment.

1. Context of the Experiment

In this experiment, the concept of magnetic sensing is introduced. A magnetic sensor usually refers to a sensor that converts the magnitude or the change in the magnitude of a magnetic field to an electric signal.

The concept of magnetic sensing will be used in this experiment to measure displacement.

2. Learning Goals of this Experiment

Students are able to

  • read the data sheet of a Hall sensor and discuss the contents

  • answer questions about the data sheet and properties of the referenced sensor

  • connect a sensor to an Arduino on their own

  • upload the required code to the Arduino

  • read analog measurement values from the sensor

  • understand how the analog reference of an Arduino works and can independently convert the analog measured values into voltages

  • interpret the measured values and draw conclusions about the sensor

3. Literature

[1] ABLIC Inc., "What is a Magnetic Sensor?," [Online]. Available: https://www.ablic.com/en/semicon/products/sensor/magnetism-sensor-ic/intro3/ . [Accessed: 2024-01-03].

[2] M. Soltero, "What Is a Hall-effect Sensor? - SSZT164 Technical article" Texas Instruments, [Online]. Available: https://www.ti.com/document-viewer/lit/html/SSZT164. [Accessed: 2024-01-03].

[3] J. Lenz and S. Edelstein, "Magnetic sensors and their applications," in IEEE Sensors Journal, vol. 6, no. 3, pp. 631-649, June 2006, doi: 10.1109/JSEN.2006.874493.

[4] Measurement Technology lecture slides

4. Basics / Fundamentals

The term magnetic sensor refers to a sensor that converts the magnitude, or the change in magnitude of a magnetic field, into an electric signal. Sources of magnetic fields that you may encounter everyday are the earth’s natural magnetic field, permanent magnets and coils.

There are many types of magnetic sensors, that are classified upon, for example, different phenomena to sense the magnetic field and the different proximity ranges. One type which we will use in this experiment is the Hall sensor.

4.1 Hall sensor

The Hall effect sensor is a widely used, low-cost sensor. It exploits a physical phenomenon discovered by Edwin H. Hall in 1879. He discovered that a voltage difference appears across a thin rectangle of gold placed in a strong magnetic field perpendicular to the plane of the rectangle when an electric current is sent along its length. An electron moving through a magnetic field experiences a force, known as the Lorentz force, which is perpendicular both to its direction of motion and to the direction of the field. It is the response to this force that creates the Hall voltage [4]. Figure 1 shows an illustration of the Hall effect.

4.2 Types of Hall effect sensors

There are two main types of Hall sensors: linear and switch. Linear sensors provide a signal proportional to the strength of the magnetic field, while switch sensors measure and compare the field strength with a fixed threshold level and give the output in the form of only two states, ON or OFF.

4.3 Applications of Hall sensors

There is a wide range of applications of Hall sensors, including:

  • magnetometers, or Hall probes, measure the strength of magnetic fields

  • magnetic field detection

  • current or voltage sensing, for example in the TMCS1100 series Hall effect current sensors

  • position sensing

  • ignition timing in internal combustion engines

5. Technical Basics & Preparations

Before measuring, these aspects of measuring should be considered and thought through:

  • What is supposed to be measured? What values are necessary for the calculations?

  • What measuring devices are appropriate for the measurements? Do they provide the necessary accuracy?

  • How do you need to connect the sensor? How do you configure your measurement electronics?

  • What are the possible (systemic) errors and external limitations that exist in the setup?

Preparations

The following equipment and materials are needed for this experiment:

  • Arduino Uno with USB cable

  • a laptop or PC with the Arduino IDE installed

  • breadboard

  • jumper wires

  • Hall sensor (DRV5053CA)

  • 2x 200Ω resistors

  • 1x 220µF electrolytic capacitor

For the experiment, you will use the test stand from experiment 3, which is additionally equipped with two magnets in plastic adapters (labeled #1 and #2). The magnets should stay with the test stand.

parts.png

You will be using the DRV5053CA Hall sensor for this experiment. Please familiarize yourself with the datasheet for this sensor:

Some of the questions in section 7 will cover information that you have to gather from the datasheet.

For further information on how to read the datasheet and apply the contained information, the following documentation may be helpful:

Additional information: ADC reference voltages

Sometimes, sensors have different voltage ranges regarding their output signal voltages. In the case of this experiment, the sensor has a voltage range that is different to the voltage range of our Arduino’s ADC (analog-to-digital converter). The Arduino’s ADC is able to discretize analog voltages between 0 and VCC (typically 5V) into 1024 steps (values 0 … 1023).

To accomodate this different scale, we can manually set the ADC reference voltage (marked AREF on the Arduino board) to an arbitrary value between 0V and VCC. For this experiment, you will be asked to set AREF to a voltage of VCC/2 using a very simple voltage divider consisting of two resistors with equal value.

Please keep in mind that because the voltage divider uses VCC, the analog reference voltage AREF depends on the voltage VCC. The Arduino generates VCC from the computer that it is connected to, which usually transmits 5V. However, this voltage can fluctuate as much as ±10%, even in a short amount of time! As such, you need to measure your analog reference voltage AREF together with every measurement of the sensor, as the ADC evaluates the sensor signal on a scale from 0 to 1023 relative to AREF.

An additional capacitor between 5V and GND can stabilize the fluctuations a bit.

6. Experiment Procedure

6.1 Connect the sensor to your Arduino

Connect the DRV5053CA sensor to your Arduino. Please refer to the sensor’s datasheet pin configuration (page 3) to connect the sensor correctly. Bend it in such a way that it lays flat on the breadboard with the text pointing away from the breadboard.

It is possible the sensor is already bent from the person that used your kit before. Please do not assume the person before you bent it the correct way! Always make sure the text on the sensor is pointing away from the breadboard!

Should your sensor’s legs break from being bent too often, please ask the tutors for a new one.

Please place a strip of clear adhesive tape (Tesafilm) over the sensor and the metallic legs to avoid a short-circuit (see Figure 3).

breadboard_sensor.jpg

For the second part of the experiment, it is very important that the sensor is placed in the specific place that is shown in Figure 3. Please follow this instruction!

Additionally, to set the ADC reference voltage to VCC/2, use two resistors and jumper wires to realize a voltage divider. An additional electrolytic capacitor between 5V and GND can help stabilize the analog reference voltage. Please make sure to connect it correctly: the capacitor has a white stripe on its cylindrical case. The wire on this side is the negative pole of the capacitor. When in doubt, please ask the tutors!

Please first try connecting the sensor, the resistors and the capacitor on your own. To check your circuit, you can expand the following tab and compare your circuit to Figure 4.

When wiring a circuit, it makes sense to use differently colored wires to connect the components. In order to get a better overview, it is usual to use certain colors for certain signals. This makes it easier to understand the circuit that another person has connected (e.g. when your tutor tries to check if your circuit is correct).

Usually, for low voltage circuits like the Arduino, the following color convention exists:

  • GND: black

  • VCC (+5V): red

If you are curious, you can find more information here.

Solution to 6.1 - only take a look after you tried it yourself!

Seriously, people - try it yourself first. Do not just copy the circuit from the picture below without giving it a try yourself.

If you work in the industry after you finished your studies, there will be no solution from which you can copy. Being able to work independently is a skill you have to learn, and setting up a simple schematic like this is a good way to start learning this!

 Expand this tab to see the solution ONLY AFTER YOU TRIED IT YOURSELF!
circuit.jpg

6.2 Upload your Arduino code

The following Arduino code reads the sensor and sends the raw reading back to your PC over a Serial port connection. Please make yourself familiar with the code:

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);

  // set the analog reference source to external (supplied by the voltage divider from 5V)
  analogReference(EXTERNAL);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);

  // send the analog value to the connected PC via Serial:
  Serial.println(sensorValue);

  // wait 100ms for stability of the loop
  delay(100);
}

You can download the file or copy and paste it and upload it onto your Arduino. When you open the Serial Monitor in your Arduino IDE, you will see the raw analog sensor value of the 10-bit ADC (0 … 1023):

6.3 Experiment at your workbench

Warning! Strong permanent magnets can interfere with electronic devices such as pacemakers and implanted defibrillators. As the wearer of such devices, ensure that you maintain a sufficient distance.

Magnets generate far-reaching, strong magnetic fields. They can damage electronic devices such as laptops, hard disks, credit and EC cards, data carriers, mechanical watches, hearing aids and loudspeakers.
Keep magnets away from all devices and objects that can be damaged by strong magnetic fields. Do not place any ferrous tools, knives, etc. near magnets.

Please do not let the magnet crash into another magnet or other ferrous material. The impact could potentially pinch your skin or shatter the magnets.

After you have connected the sensor and the voltage divider, please do some experiments at your own workbench and document your observations:

  1. sensor value without any magnet present (see Figure 6)

  2. sensor values with the flat side of the magnet close to the top side of the sensor (see Figure 7). Turn the magnet around and measure each flat side of the magnet.

  3. change in sensor value when you move the magnet sideways (with its cylindrical surface) over the sensor (see Figure 8)

6.4 Measurements at test stand for experiment 3

The rest of the experiment will take place at the same test stand that was already used for experiment 3.

Carefully attach the breadboard to the test stand like shown in Figure 9 and the following video:

Open the Matlab App, enter your information and select Experiment 9 from the drop down menu. You will be greeted by the following screen:

Screenshot 2024-01-19 075431.png

Follow these steps, as indicated in the Matlab App:

  1. Insert your breadboard with the sensor into the breadboard holder and connect your Arduino to a PC with the Arduino IDE.

  2. Connect the multimeter to the voltage divider for the analog reference of the Arduino and set it to measure the analog reference voltage.

  3. Set the position of the moving part of the test stand to 15mm.

  4. Select a magnet from the drop down menu. Attach it to the moving part of the test stand.

  5. Reset the position of the moving part of the test stand to 0mm.

  6. Select a point using the slider. The position in the app will automatically adjust. Move the test stand to the indicated position.

  7. Read the sensor value from the Arduino IDE. At the same time, measure the voltage of the analog reference. Enter the values and add them to the table with the "Add Measurement" button.

  8. Repeat steps 5-7 until you measured the sensor value and voltage for all measurement numbers of the slider. Repeat from step 3 for the other magnet.

To insert one of the magnets (white plastic 3d printed part with a magnet inside), just gently push it onto the T-shaped part of the test stand from above. Align it so the magnet and the sensor are in one line, both horizontally and vertically.

You will need these values later for the Vips questions. After you have done all measurements as requested in the Matlab App, please save the data.

You will get a copy of the data you entered as a .mat file which you have to use for your calculations. Please check that you received the file via email.

7. Evaluation of Experiment Results

Below, you find the list of questions that are asked in the Vips assignments. Please note that only 30 minutes are available for entering answers and completing the assignment! After 30 minutes, the assignment gets automatically submitted. The Vips assignment will only be used to submit the final answers, so be prepared and have all answers ready!

1. Matriculation Number

Please enter your matriculation number, so we can assign the results to you.

2. Minimum output pin voltage

What is the minimum output pin voltage of the sensor in V according to the datasheet? Please use the decimal point and give only numerical values in Volt [V].

3. Maximum output pin voltage

What is the maximum output pin voltage of the sensor in V according to the datasheet? Please use the decimal point and give only numerical values in Volt [V].

4. Typical sensitivity - value

What is the typical sensitivity of the sensor? Enter the numerical value only, the same way it is given in the datasheet.

5. Typical sensitivity - unit

What is the typical sensitivity of the sensor? Enter the unit only, the same way it is given in the datasheet.

6. Quiescent output - analog value

During the experiment at your booked workbench (see section 6.3), you measured the analog sensor value when no magnet was present. Please enter the measurement value!

7. Quiescent output - voltage

In the previous question, you were asked to give the analog output value of the sensor when no magnet was present. What is the sensor voltage corresponding to this measurement? Assume that the analog reference was set to exactly 2.5V by the voltage divider! Please use the decimal point and give only numerical values in Volt [V].

8. Maximum analog output value at test stand

What is the maximum analog output value of the sensor that you measured during the experiment at the test stand?

9. Maximum output voltage at test stand

In the previous question, you were asked to give the maximum analog output value of the sensor during the experiment. What is the sensor voltage corresponding to this value, considering the actual voltage at the analog reference pin?

Please use the decimal point and give only numerical values in Volt [V].

10. Minimum analog output value at test stand

What is the minimum analog output value of the sensor that you measured during the experiment at the test stand?

11. Minimum output voltage at test stand

In the previous question, you were asked to give the minimum analog output value of the sensor during the experiment. What is the sensor voltage corresponding to this value, considering the actual voltage at the analog reference pin?

Please use the decimal point and give only numerical values in Volt [V].

12. Magnetic flux density

The following circumstances are given for a measurement with the sensor:

  • the Arduino measures an analog output value of 584

  • the Arduino is powered with a USB cable from a computer, resulting in a voltage at the “5V” pin of 5.38V

  • the resistors for the voltage divider have perfectly equal resistance values

What is the magnetic flux density that the sensor senses? Please use the decimal point and give only numerical values in the unit mT.

13. Real sensitivity of sensor

For the calculation of this answer, you need the results that you entered in questions 8 - 11.

Due to influences during the manufacturing process of the sensor as well as usage conditions such as the ambient temperature, the sensor has characteristics that differ from those stated in the datasheet. This is particularly relevant for the sensitivity, which is given with a broad range of 10 … 35 mV/mT (refer to datasheet page 6).

You already calculated the minimum and maximum voltages that you encountered during your experiment time at the test stand (questions 9 and 11). Assume that at these voltages, the typical input saturation field (given in the datasheet) was present. Assume a linear behavior between the minimum and maximum saturation field.

What is the real sensitivity of the sensor? Please use the decimal point and give only numerical values in the unit mV/mT.

14. Change in magnetic flux density for one ADC step

Again, assume that the typical input saturation field given in the datasheet was present at the minimum and maximum voltages that you calculated previously. Assume a linear behavior between the minimum and maximum saturation field.

For a change in the analog output value of 1 (e.g. from 500 to 501), what is the change in the magnetic flux density? Please use the decimal point and give only numerical values in the unit mT.

15. Plateaus in measurement graph

You are given the following plot of two measurements that were recorded using the test stand. Please note that the scales and offsets of the x- and y-axes are arbitrary and not important for the answer.

What are the plateaus (circled in red) called?

grafik-20240118-211111.png

select one from:

  • saturation

  • remanent flux density

  • hysteresis

  • Hall effect region

16. Negative slope

Consider the following measurement plot that was recorded using two magnets at the test stand. Please note that the scales and offsets of the x- and y-axes are arbitrary and not important for the answer.

Why is the measurement of magnet B flipped (in comparison to magnet A), showing a negative slope instead of a positive slope with increasing position?

grafik-20240118-211339.png

select one from:

  • For the second measurement, magnet B has twice the remanent flux density ("is twice as strong") as magnet A

  • For the second measurement, magnet B has the opposite polarity of magnet A, but the same remanent flux density

  • For the second measurement, the direction of movement of the magnet was opposite (away from the sensor instead of closer to the sensor)

  • For the second measurement, the polarity of the voltage to the sensor was reversed (-5V instead of +5V)

17. Magnet polarity

During your experiment, you measured the magnetic flux density of two magnets. When you attached them to the test stand, which poles faced the sensor during the measurements? Hint: Refer to the datasheet for help.

select one from:

  • Magnet 1 and magnet 2 both had their respective south poles facing the sensor.

  • Magnet 1 had its south pole facing the sensor. Magnet 2 is actually not magnetized.

  • Both magnets were magnetic monopoles; they do not have a north and south pole.

  • Magnet 1 had its south pole facing the sensor and magnet 2 had its north pole facing the sensor.

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.