

A Hall effect sensor is a device that detects the presence and strength of a magnetic field. It operates based on the Hall effect principle, which generates a voltage proportional to the magnetic field when current flows through a conductor. These sensors are widely used in various applications due to their ability to provide contactless and reliable magnetic field detection.








Below are the general technical specifications for a typical Hall effect sensor. Note that specific values may vary depending on the model and manufacturer.
The pinout for a common 3-pin Hall effect sensor is as follows:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5V) |
| 2 | GND | Ground connection |
| 3 | OUT | Output signal (digital or analog, depending on the sensor) |
Below is an example of how to connect and use a digital Hall effect sensor with an Arduino UNO.
// Define the pin connected to the Hall effect sensor's output
const int hallSensorPin = 2;
// Variable to store the sensor's state
int sensorState = 0;
void setup() {
// Initialize the serial monitor for debugging
Serial.begin(9600);
// Set the Hall sensor pin as an input
pinMode(hallSensorPin, INPUT);
}
void loop() {
// Read the state of the Hall effect sensor
sensorState = digitalRead(hallSensorPin);
// Check if a magnetic field is detected
if (sensorState == HIGH) {
Serial.println("Magnetic field detected!");
} else {
Serial.println("No magnetic field detected.");
}
// Add a small delay to avoid flooding the serial monitor
delay(500);
}
No Output Signal:
Unstable Output:
Sensor Not Detecting Magnetic Field:
Output Always HIGH or LOW:
Q: Can I use a Hall effect sensor to measure current?
Q: What type of magnet should I use with a Hall effect sensor?
Q: Can I use a Hall effect sensor with a 3.3V microcontroller?
Q: How do I know if my Hall effect sensor is analog or digital?