U18 US1881 OH188 1881 Hall Effect Sensor Magnetic Detector
0.80€
100 or more 0.47€
1000 or more 0.17€
- Stock: In Stock
- Product Code: SNA001.US1881
- Weight: 0.30
U18 US1881 OH188 1881 Hall Effect Sensor Magnetic Detector
The US1881 Hall effect sensor is a digital output magnetic field detector. It can detect the presence and direction of magnetic fields. This sensor is commonly used in automotive, industrial, and consumer electronics applications. The US1881 provides a digital signal when a magnet is brought close to it.
Technical Specifications:
- Operating Voltage: 3.5V - 24V
- Output Type: Digital
- Sensing Distance: Depends on the strength of the magnet
- Operating Temperature: -40°C to 150°C
- Hysteresis: Typically 25 Gauss
Applications:
- Position detection
- Speed measurement
- Tachometers
- Magnetic switch applications
Using US1881 Hall Sensor with Arduino
The US1881 Hall sensor, when used with an Arduino, can detect the presence of a magnet and produce a digital signal. Here is an example code for using the US1881 sensor with an Arduino:
Required Components:
- Arduino Uno
- US1881 Hall Sensor
- Connecting wires
- Magnet
Connection Diagram:
- Connect the Vcc pin of the US1881 to the 5V pin on the Arduino.
- Connect the GND pin of the US1881 to the GND pin on the Arduino.
- Connect the OUT pin of the US1881 to the digital pin 2 on the Arduino.
const int hallPin = 2; // Pin where the Hall sensor output is connected
int hallState = 0; // Variable to store the state of the Hall sensor
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(hallPin, INPUT); // Set hallPin as an input
}
void loop() {
hallState = digitalRead(hallPin); // Read the state of the Hall sensor
if (hallState == HIGH) {
Serial.println("Magnet detected"); // Print message when magnet is detected
} else {
Serial.println("No magnet"); // Print message when no magnet is detected
}
delay(500); // Wait for 500 milliseconds
}
Explanation:
- In the setup() function, serial communication is initialized, and the Hall sensor output is set as an input.
- In the loop() function, the state of the Hall sensor is read. If the sensor detects a magnet, "Magnet detected" is printed to the serial monitor. Otherwise, "No magnet" is printed.
- The delay(500) function creates a 500-millisecond delay between sensor readings.
This simple project allows you to observe whether the US1881 Hall sensor detects a magnet using your Arduino.
Tags:
Hall Effect Sensor
, Magnetic Detector
, U18
, US1881
, OH188
, 1881
, Sensor Module
, Magnetic Field Sensor
,