Description
- Wide operating voltage range from 3.5V to 24V
- Chopper stabilized amplifier stage
-
Optimized for BDC motor applications
-
High magnetic sensitivity – Multi-purpose
- Low current consumption
- Temperature compensation
-
CMOS Technology
Applications:
-
Solid state switch
-
Brushless DC motor commutation
-
Speed sensing
-
Linear position sensing
-
Angular position sensing
-
Current sensing
- Proximity detection
Getting started with the
This project uses a Hall effect sensor to detect the presence of a magnet. Whenever a magnet moves past this sensor, it can detect it. This sensor can be used to do a lot of different things. For instance, if we need to detect a door closing; then we simply have to attach a magnet to the door and a hall sensor to the frame of the door. Whenever the door closes, the magnet is placed near the hall effect sensor and we are able to detect that the door has been closed.
How Does It Work?
The Hall effect sensor works on the principle of the Hall effect, which states that whenever a magnetic field is applied in a direction perpendicular to the flow of electric current in a conductor, a potential difference is induced. This voltage can be used to detect whether the sensor is in the proximity of a magnet or not. The Arduino can detect this voltage change through its interrupt pin and determine whether the magnet is near the sensor or not. The basic working of the Arduino Hall effect sensor is shown in the picture below.
Hardware required
- Arduino Uno
- Breadboard
- U18/US1881
Hall effect sensors have three pins: VCC(5V), GND, and Vout(Signal). The pinout of a Hall effect sensor is as shown below
Connecting the Hardware
Interfacing the Hall effect sensor with Arduino is really simple. The VCC of the sensor is connected to Arduino’s 5V power pin. The GND of the sensor is connected to the GND pin on the Arduino. The Vout or signal pin of the Hall effect sensor is connected to the Arduino’s interrupt pin (digital pin 2). Furthermore, a 10K resistor is connected between the VCC and Vout pins of the Hall effect sensor. This is done to pull the output of the Hall effect sensor to 5V. The connections are done as shown below
Uploading the Code and Open the Serial monitor
After you finish hooking up the Hall effect sensor to your Arduino, you need to upload the code to the board and test it.
Download code here: Arduino Hall effect sensor
Whenever the Hall effect sensor detects a magnet, it outputs a HIGH (5V) voltage to its Vout pin. The interrupt pin of the Arduino that is connected to Vout detects this rising (HIGH) voltage through the function: magnet_detect. The serial monitor prints “detect” whenever a magnet is brought close to the sensor.
Reviews
There are no reviews yet.