4.5V to 5.5V
4.5V to 5.5V
10mA (typical)
Digital (TTL)
High (3.3V) or Low (0V)
Adjustable (on some modules) or fixed (on others)
1ms (typical)
-20C to 80C
-40C to 125C
Applications
Pinout
Power supply pin (5V)
Ground pin
Digital output pin (TTL)
Sensitivity adjustment pin (on some modules)
Dimensions
20mm
15mm
5mm
Mounting
The Hall Effect Sensor Module can be mounted using a PCB or a breadboard. It is recommended to use a sturdy adhesive or mechanical fastener to secure the module to a PCB or a robotic platform.
Hall Effect Sensor Module DocumentationThe Hall Effect Sensor Module is a popular IoT component used to detect the presence of magnets or changes in magnetic fields. It's commonly used in applications such as motor control, proximity sensing, and position sensing.Technical Specifications:Operating Voltage: 5V
Operating Current: 10mA
Detection Range: 3-5 mm
Output Signal: Digital (HIGH/LOW)
Pinout:
+ VCC: Power supply pin (5V)
+ GND: Ground pin
+ OUT: Output pin (digital)Example 1: Simple Magnetic Detection using ArduinoIn this example, we'll use the Hall Effect Sensor Module to detect the presence of a magnet using an Arduino board.Hardware Requirements:Arduino Board (e.g., Arduino Uno)
Hall Effect Sensor Module
Breadboard and jumper wires
MagnetSoftware Requirements:Arduino IDE (version 1.8.x or later)Code:
```c++
const int hallPin = 2; // Hall Effect Sensor output pin
const int ledPin = 13; // LED pin for indicationvoid setup() {
pinMode(hallPin, INPUT);
pinMode(ledPin, OUTPUT);
}void loop() {
int sensorState = digitalRead(hallPin);
if (sensorState == HIGH) {
digitalWrite(ledPin, HIGH); // LED turns on when magnet is detected
} else {
digitalWrite(ledPin, LOW); // LED turns off when magnet is not detected
}
delay(50);
}
```
In this example, we connect the Hall Effect Sensor Module's output pin to Arduino's digital pin 2. When a magnet is brought close to the sensor, the output pin goes HIGH, and we turn on the LED connected to pin 13. When the magnet is removed, the output pin goes LOW, and the LED turns off.Example 2: Motor Control using Raspberry Pi and PythonIn this example, we'll use the Hall Effect Sensor Module to control a DC motor using a Raspberry Pi and Python.Hardware Requirements:Raspberry Pi (e.g., Raspberry Pi 4)
Hall Effect Sensor Module
Breadboard and jumper wires
DC Motor (e.g., 6V)
Motor Driver (e.g., L293D)Software Requirements:Raspbian OS (latest version)
Python 3.xCode:
```python
import RPi.GPIO as GPIO
import time# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
hall_pin = 17 # Hall Effect Sensor output pin
motor_pin = 18 # Motor control pinGPIO.setup(hall_pin, GPIO.IN)
GPIO.setup(motor_pin, GPIO.OUT)while True:
sensor_state = GPIO.input(hall_pin)
if sensor_state:
# Turn on the motor when magnet is detected
GPIO.output(motor_pin, GPIO.HIGH)
else:
# Turn off the motor when magnet is not detected
GPIO.output(motor_pin, GPIO.LOW)
time.sleep(0.1)
```
In this example, we connect the Hall Effect Sensor Module's output pin to Raspberry Pi's GPIO pin 17. When a magnet is detected, we turn on the DC motor using the motor driver connected to GPIO pin 18. When the magnet is removed, we turn off the motor.These examples demonstrate how to use the Hall Effect Sensor Module in different contexts. You can adapt these examples to suit your specific IoT project requirements.