Products
Technology
SMS solutions
Databases
Modbus
M-Bus
PBX systems
Robotics
Building robot hardware
Building electronics
Ozeki Matrix
Arduino
Getting started
Arduino sensors
DHT11
NFC
Soil moisture
TMP36
US1881
BMP085
TSL2561
YL-83
Wind Sensor
SI1145
Infrared Remote
Connecting Arduino to devices
Connecting Arduino
Robot electronics with Arduino
Prototyping
Cases and covers
Building your projects
Electronics
Building robot software
Robot training
Upload Arduino code
Company


Arduino
TMP36 TMP36 | BMP085 BMP085

How to connect a US1881 hall sensor to Arduino


Contents

  1. Introduction
  2. Specification
  3. Applications to use hall sensor
  4. PIN Assignment
  5. Example code
  6. Reference

Introduction


A hall-effect sensor is a device that reacts to a magnetic field. The reaction known by everyone is that the sensor acting as a digital switch "turns on" in the presence of a strong enough magnetic field.

The US1881 is an integrated Hall effect latched sensor. It means that once it is triggered it latches and will not unlatch until a magnetic force of reverse polarity and strength is sensed. So if the north pole of a magnet turned it on, the south pole of a magnet is then needed to turn it off.

Holding a magnet near the sensor will cause the output pin to toggle. This makes for a robust presence sensor. If a magnetic flux density larger than threshold Bop, Digital Output is turned on (low). The output state is held until a magnetic flux density reversal falls below Brp causing Digital Output to be turned off (high).

Playing with magnetic field is one of the most interesting topic in Arduino building.


Interesting facts


Specification


  • 3.5V to 24V DC operation voltage
  • Low current consumption
  • Temperature compensation
  • Wide operating voltage range
  • Open-Collector pre-driver
  • 50mA maximum sinking output current
  • Reverse polarity protection
  • Lead Free Package: TO-92


US1881 hall effect sensor

Applications to use hall sensor


  • Automotive, consumer and industrial
  • Solid state switch
  • Brushless DC motor commutation
  • Speed detection
  • Linear position detection
  • Angular position detection
  • Proximity detection

PIN Assignment


  • Connect pin 1 of the switch to the Arduino 5V supply
  • Connect pin 2 to Ground (GND)
  • Connect pin 3 to Arduino Digital pin 2


How to connect hall sensor to Arudino


US1881 hall sensor pin

Example code


int hallPin=2;
int statePin=LOW; 
void setup()
{
pinMode(hallPin,INPUT);
Serial.begin(9600);
}

void loop()
{
statePin=digitalRead(hallPin);
if (Serial.available())
{
if( statePin==HIGH)
{
Serial.println("North"); 
}
else if(statePin==LOW)
{
Serial.println("South"); 
}
}
delay(500);
} 

Reference



Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Technology > Robotics > Building electronics > Arduino > Arduino sensors > US1881
Legal | Privacy policy | Terms of use
Page: 1154 | Login | 18.206.241.26