How to Measure Magnetic Fields with Arduino and 49E Linear Hall Sensor

Introduction

In this Post we learn How to Measure Magnetic Fields with Arduino and 49E Linear Hall Sensor, It provides a reliable method for measuring magnetic fields in diverse applications. This project utilizes an Arduino UNO microcontroller, a popular development board known for its versatility, along with the 49E Hall Sensor. By using jumper wires and a breadboard, this setup enables the remote measurement of magnetic fields, offering a contactless and enduring solution. Hall sensors, like the 49E, play a crucial role in various industries, from automotive applications such as seat belt activation to fluid velocity measurement. This project focuses on the analog type 49E sensor, capable of generating an output proportional to the magnetic field’s intensity, making it versatile for detecting objects with magnets or creating tachometers.

Hardware Required

You will require the following Hardware Components for how to interface the 49E Linear Hall Sensor with Arduino.

Components#Buy From Amazon
Arduino UNO1Buy Link
49E Linear Hall Sensor1Buy Link
9v DC Adapter (Optional)1Buy Link
Jumper Wires3Buy Link
Breadboard1Buy Link

What is the Module?

A Hall sensor is a device designed for the measurement of magnetic fields. Employed in diverse applications, from automotive functionalities like seat belt activation to fluid velocity measurement and metal detection, Hall sensors offer the advantage of remote measurement without the need for physical contact. Their range, typically a few centimeters, minimizes mechanical wear, and they prove resilient to noise and dust. Hall sensors are categorized into analog and digital types. The 49E Hall sensor, featured in this project, is of the analog type, providing an output proportional to the magnetic field’s intensity.

How does a Hall sensor work?

Its operational principle is based on the Hall effect, named after its discoverer Edwin Herbery Hall in 1849.

When an electric current flows through a semiconductor in the presence of a magnetic field, the electrons are redirected due to the influence of the magnetic field. This redirection results in a voltage that is perpendicular to both the current and the magnetic field.

How-does-a-49E-linear-Hall-sensor-work

Through measuring the voltage induced by the Hall effect, we can create magnetic field sensors and meters.

The Hall sensors in the 49E family are equipped with the essential electronics to deliver a linear voltage response within the range of -100 to 100 mT. The circuitry is specifically designed to minimize signal noise, eliminating the need for external filtering.

arduino-sensor-hall-49e-funcionamiento

The operational temperature range spans from -40 to 85ºC, with minimal impact on the measurements. The typical sensitivity at 25ºC is 18 mV/mT.

arduino-sensor-hall-49e-curva

By interpolating the preceding graph, we derive the following expression for the voltage response concerning the magnetic flux measured by the Hall 49E sensor.

V = 0.0188 . B+2.5

Alternatively, by inverting the equation, we reach the necessary formula to calculate the magnetic flux density from the sensor response.

B = 53.33 . V-133.3

Pinout of Hall Sensor

49E-linear-Hall-sensor-Pinout

Pin Configuration of Hall Sensor

No:Pin NameDescription
1+5V (Vcc)Used to power the hall sensor, typically +5V is used
2GroundConnect to the ground of the circuit
3OutputThis pin goes high if a magnet is detected. Output voltage is equal to Operating voltage.

Features of Hall Sensor

  1. Analog Output: Generates an output proportional to the intensity of the magnetic field.
  2. Contactless Measurement: Operates remotely without the need for physical contact, minimizing mechanical wear.
  3. Noise Immunity: Exhibits immunity to noise and dust, enhancing reliability.
  4. Durable Design: Hall sensors, in general, have a long lifespan due to their contactless nature.

Specifications of Hall Sensor

  • Digital Output Hall-effect sensor
  • Operating voltage: 4.5V to 28V (typically 5V)
  • Output Current: 25mA
  • Can be used to detect both poles of a magnet
  • The output voltage is equal to an operating voltage
  • Operating temperature: -40°C to 85°C
  • Turn on and Turn off time is 2uS each
  • Inbuilt reverse polarity protection
  • Suitable for Automotive and Industrial Applications

Circuit Diagram

The following circuit shows you the connection of the How to Measure Magnetic Fields with Arduino and 49E Linear Hall Sensor, Please make the connection carefully

Measure-magnetic-fields-with-Arduino-and-49E-linear-Hall-sensor-Circuit-Diagram

Circuit Connections

ArduinoLinear Hall Sensor
+5V+V Pin
GNDGND Pin
A0A0 Pin

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Code

To determine the magnetic field from the measurement, we initially measure the voltage using an Arduino analog input. Subsequently, we convert the voltage to magnetic flux density using the previously interpolated formula.

//For more Projects: www.arduinocircuit.com

const int pinHall = A0;

void setup() {
  pinMode(pinHall, INPUT);
  Serial.begin(9600);
}

void loop() {

  //average of 10 measurements to filter noise
  long measure = 0;
  for(int i = 0; i < 10; i++){
      int value = 
      measure += analogRead(pinHall);
  }
  measure /= 10;
  
 //calculation of voltage in mV
  float outputV = measure * 5000.0 / 1023;
  Serial.print("Output Voltage = ");
  Serial.print(outputV);
  Serial.print(" mV   ");
  
  //interpolation to magnetic flux density
  float magneticFlux =  outputV * 53.33 - 133.3;
  Serial.print("Magnetic Flux Density = ");
  Serial.print(magneticFlux);
  Serial.print(" mT");
  
  delay(2000);
}

Applications

  1. Object Detection: Used to detect the presence of objects by placing a small magnet on the object.
  2. Tachometers: Applied to create revolution counters by attaching a small neodymium magnet to a rotating shaft.
  3. Automotive Industry: Utilized for various functions, such as activating seat belts or measuring the position of the camshaft.
  4. Fluid Velocity Measurement: Employed in applications requiring the measurement of fluid velocities.
  5. Metal Detection: Used in metal detection applications, including security systems and industrial processes.

Leave a Comment


error: