Interfacing KY-003 Hall Magnetic Sensor module with Arduino


In this Tutorial, we are going to Interfacing KY-003 Hall Magnetic Sensor module with Arduino, The KY-003 Hall Magnetic Sensor module is a switch that responds to the existence of a magnetic field, when the sensor is near the magnetic field then it turns on or off itself.

This module is able to interface with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. It gives a signal when near the magnetic field. this is equivalent to KY-024 Linear Magnetic Hall Sensor Module


Hardware Required

You will require the following Hardware Components for the Interfacing KY-003 Hall Magnetic Sensor module with Arduino

Components#Buy From Amazon
Arduino UNO1Buy Link
KY-003 Hall Magnetic Sensor module1Buy Link
LED ( Red )1Buy Link
Jumper WiresBuy Link
Breadboard1Buy Link


This module contains an LED, a 680Ω resistor, a 3144EUA-S Hall-effect switch, and 3 male header pins.

Operating Voltage4.5V to 24V
Operating Temperature Range-40°C to 85°C [-40°F to 185°F]
Board Dimensions18.5mm x 15mm [0.728in x 0.591in]

Technical Data

Measuring range-40°C to +150°C
Sensor TypeHall Effect Transistor/Switch
Function range5V (Due to the LED)



Pin Configuration

Pin NamePin Type
SSignal Pin
middle PinVcc (+5)
( – )Ground

Circuit Diagram

The following circuit shows you the connection of the Interfacing KY-003 Hall Magnetic Sensor module with Arduino Please make the connection carefully


Circuit Connections

Place the module on the Breadboard and connect the power line (middle) and ground (-) of the module to +5 and GND of the Arduino respectively. and Lastly, connect the (S) signal pin to pin 3 of the Arduino.

ArduinoKY-003 ModuleLED
Pin 3Signal
Pin 13LED +Ve

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow


The following Arduino code will switch on the LED placed on pin 13 of arduino when the KY-003 Hall Magnetic Sensor nears the magnetic field.

int led = 13;//LED pin
int sensor = 3; //sensor pin
int val; //numeric variable
void setup()
	pinMode(led, OUTPUT); //set LED pin as output
	pinMode(sensor, INPUT); //set sensor pin as input
void loop()
	val = digitalRead(sensor); //Read the sensor
	if(val == LOW) //when magnetic field is detected, turn led on
		digitalWrite(Led, HIGH);
		digitalWrite(Led, LOW);

Downloads Files

  • KY-003 Hall Magnetic Sensor Module Fritzing Part:
  • 3144EUA-S Hall-effect switch Datasheet:

Leave a Comment