Skip to product information
1 of 1

Blue PCB Electronics

2C21 KY-003 Hall Magneticfield-Sensor module

2C21 KY-003 Hall Magneticfield-Sensor module

Regular price Dhs. 15.00
Regular price Sale price Dhs. 15.00
Sale Sold out
View full details


The KY-003 Hall Magnetic Sensor module is a switch that reacts to the presence of a magnetic field, turning itself on or off. Compatible with popular microcontrolers like Arduino, Raspberry Pi and ESP32.

This module offers a digital output, it looks similar to the KY-035 analog hall magnetic sensor, and it is functionally similar to the KY-024, a digital/analog magnetic sensor.


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

Operating Voltage 4.5V to 24V
Operating Temperature Range -40°C to 85°C [-40°F to 185°F]
Board Dimensions 18.5mm x 15mm [0.728in x 0.591in]


Connection Diagram

Connect the board power line (middle) and ground (-) to +5 and GND on the Arduino respectively.

Connect signal (S) to pin 3 on the Arduino.

KY-003 Arduino
S Pin 3
middle +5V

Arduino KY-003 connection diagram

Arduino Code

The following Arduino sketch will turn on the LED on pin 13 when you put a magnet near the module.

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);