You are on page 1of 2

Hall-effect Sensor

1.Introduction
Hall-effect sensors are transducers, the device varies output voltage
in response to a magnetic field. They are widely used as non-physical
on-off switches. When a magnetic field is present near a hall effect
sensor, the output voltage tends to zero. They see application as
proximity switching, positioning, speed detection, and current
sensing applications.
2.Theory
How it works?
In a Hall-effect sensor, a thin strip of metal has a current applied to
it. In the presence of a magnetic field, the electrons in the metal strip
are deflected toward one edge, this increases the resistance and thus
leads to an output voltage drop.
https://en.wikipedia.org/wiki/Hall_effect
(for scientifically accurate explanation)

Inside look at the structure

1,2,3 are the leg numbers we see protruding out of the sensor…
CODE:
int hallSensorPin = 2;
int state = 0;

void setup() {
pinMode(hallSensorPin, INPUT);
}

void loop() {
state = digitalRead(hallSensorPin);
if (state == LOW)
Serial.println("ON");
else
Serial.println("OFF");
delay(250);
}

Schematic:

We will get a ‘LOW’ on input pin when magnetic field is present,


Otherwise, the pin will read high.

You might also like