Stufin
Home Quick Cart Profile

Hall Effect Sensor

Buy Now

Sensitivity

Typically ranges from 1 mV/G to 10 mV/G

Operating Frequency

Typically ranges from DC to 100 kHz

Output Signal

Digital ( logic level) or Analog (voltage or current)

Supply Voltage

Typically ranges from 3.3V to 24V

Package Types

SOP, DIP, SOT, and others

Conclusion

The Hall Effect sensor is a versatile and widely used component in various applications. Its non-invasive nature, high sensitivity, and linear output make it an ideal choice for measuring magnetic fields, currents, and positions. With its low power consumption and robustness, the Hall Effect sensor is suitable for use in a wide range of environments and applications.

Pin Configuration

  • Hall Effect Sensor Documentation
  • Pinout Explanation
  • A typical Hall Effect sensor has three pins, which are:
  • ### Pin 1: VCC (Power Supply)
  • Function: Provides power supply to the Hall Effect sensor
  • Voltage Range: Typically 4.5V to 24V, but may vary depending on the specific sensor model
  • Connection: Connect to a stable power source, such as a battery or a voltage regulator output
  • ### Pin 2: GND (Ground)
  • Function: Provides a reference ground connection for the sensor
  • Connection: Connect to the system's ground (GND) or negative terminal of the power source
  • ### Pin 3: VOUT (Output)
  • Function: Provides a digital output signal indicating the presence or absence of a magnetic field
  • Signal: Typically an open-drain output, which means it can sink current when the output is low, but cannot source current when the output is high
  • Logic Level: Usually compatible with standard CMOS logic levels (e.g., 0V to 5V)
  • Connection: Connect to a microcontroller or other logic circuitry to read the sensor's output state
  • Connection Structure:
  • To connect a Hall Effect sensor, follow this structure:
  • 1. VCC to Power Source:
  • Connect Pin 1 (VCC) to a stable power source, such as a battery or a voltage regulator output.
  • 2. GND to System Ground:
  • Connect Pin 2 (GND) to the system's ground (GND) or the negative terminal of the power source.
  • 3. VOUT to Microcontroller or Logic Circuitry:
  • Connect Pin 3 (VOUT) to a microcontroller or other logic circuitry to read the sensor's output state.
  • Example Connection Diagram:
  • ```
  • +-----------+
  • | Hall |
  • | Effect |
  • | Sensor |
  • +-----------+
  • | |
  • | VCC |
  • | (Pin 1)
  • |
  • | |
  • v v
  • +-----------+ +-----------+
  • | Power | | System |
  • | Source | | Ground |
  • +-----------+ +-----------+
  • | |
  • | GND (Pin 2) |
  • |
  • | |
  • v v
  • +-----------+ +-----------+
  • | Micro- | | Logic |
  • | controller| | Circuitry |
  • +-----------+ +-----------+
  • | |
  • | VOUT (Pin 3) |
  • |
  • ```
  • Remember to check the specific datasheet for your Hall Effect sensor model, as pinout and voltage requirements may vary.

Code Examples

Hall Effect Sensor Documentation
Overview
A Hall Effect Sensor is a type of sensor that detects the presence or absence of a magnetic field. It is commonly used in IoT applications such as proximity detection, rotation detection, and magnetic field measurement.
Technical Specifications
Operating Voltage: 5V
 Operating Current: 10mA
 Sensitivity: 100mV/Gauss
 Output: Digital (High/Low)
Code Examples
### Example 1: Simple Hall Effect Sensor with Arduino
In this example, we will use an Arduino Uno board and a Hall Effect Sensor to detect the presence of a magnetic field.
Hardware Requirements
Arduino Uno board
 Hall Effect Sensor (e.g. A1302)
 Breadboard and jumper wires
 Magnet (for testing)
Code
```c
const int hallPin = 2;  // Hall Effect Sensor pin
void setup() {
  pinMode(hallPin, INPUT);
  Serial.begin(9600);
}
void loop() {
  int sensorState = digitalRead(hallPin);
  if (sensorState == HIGH) {
    Serial.println("Magnetic field detected!");
  } else {
    Serial.println("No magnetic field detected.");
  }
  delay(100);
}
```
In this example, we connect the Hall Effect Sensor to digital pin 2 of the Arduino Uno board. The sensor output is read using the `digitalRead()` function, and the result is printed to the serial monitor. When a magnetic field is detected, the sensor output is HIGH, and when no magnetic field is present, the output is LOW.
### Example 2: Hall Effect Sensor with Raspberry Pi for Rotation Detection
In this example, we will use a Raspberry Pi and a Hall Effect Sensor to detect the rotation of a magnet attached to a shaft.
Hardware Requirements
Raspberry Pi board
 Hall Effect Sensor (e.g. A1302)
 Breadboard and jumper wires
 Magnet attached to a shaft (for testing)
Code
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define the Hall Effect Sensor pin
hall_pin = 17
# Set up the Hall Effect Sensor pin as an input
GPIO.setup(hall_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
    # Read the Hall Effect Sensor output
    sensor_state = GPIO.input(hall_pin)
    if sensor_state == GPIO.HIGH:
        print("Rotation detected!")
    else:
        print("No rotation detected.")
    time.sleep(0.1)
```
In this example, we use the RPi.GPIO library to set up the Hall Effect Sensor pin as an input with a pull-up resistor. The sensor output is read using the `GPIO.input()` function, and the result is printed to the console. When the magnet attached to the shaft passes the Hall Effect Sensor, the sensor output is HIGH, and when it is not present, the output is LOW.