Skip to main content


Linear Hall Effect Sensor Arduino Compatible

Arduino Compatible ARD2 Linear Hall Effect Sensor


1 $5.95


This sensor is used to detect magnetic fields. The current, and thus the voltage, running through the sensor is changed in relation to the presence of a magnetic field. This sensor is designed so it can tell you the amount the voltage has changed as an analog output, and if the voltage has changed as a digital output. Since the sensor can provide digital and analog outputs, there is a surprising amount you can do with it. You can easily make a working sensor, or make a much more complicated one.

This sensor is built in such a way that the sensor itself has everything needed to operate, including an LED. As such, you can get a basic magnetic switch with nothing more than a 5V battery by connecting the magnet ports to the + and G pins. When a magnet is brought close to the sensor, the voltage will change and send a signal to the sensors integrated LED, telling it to light up.

Test Code

int Led = 13; // define LED Interface
int buttonpin = 3; // define the linear Hall magnetic sensor interface
int val; // define numeric variables val

void setup () {
pinMode(Led, OUTPUT); // define LED as output interface
pinMode(buttonpin, INPUT); // define linear Hall magnetic sensor output interface

void loop () {
val = digitalRead(buttonpin); // digital interface will be assigned a value of 3 to read val

// When the linear Hall sensor detects a magnetic signal, LED flashes
if (val == HIGH) {
digitalWrite(Led, HIGH);
else {
digitalWrite(Led, LOW);


  • Detects magnetic fields
  • Features everything needed to operate, including an LED


Board Colour





You Might Also Like

All prices are in Australian Dollars and include GST. GST will be removed from your order if you are ordering from outside Australia.
Products may differ from pictured.
All trademarks and trade names are the properties of their respective owners. Wiltronics disclaims any proprietary interest in trademarks and trade names other than its own.

Linear Hall Effect Sensor Arduino Compatible



We use cookies to ensure you have the best experience on our site. If you continue to use this site you consent to the use of these cookies. OK

Find out more in our Privacy Policy