KY-003 Hall Magnetic Sensor Module

Description

KEYES KY-003 Arduino Hall Magnetic Sensor Module is a switch that will turn on/off in the presence of a magnetic field.

Specification

The KY-003 Hall Magnetic Sensor consists of a 3144EUA-S sensitive Hall-effect switch for high-temperature operation, a 680Ω resistor and a LED. Compatible with popular electronics platforms like Arduino and Raspberry Pi.

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

Connection Diagram

Connect the Power line (middle) and ground (-) to +5 and GND respectively. Connect signal (s) to pin 3 on the Arduino.

KY-003Arduino
SPin 3
middle+5V
-GND
Arduino KY-003 connection diagramclick to enlarge

Example Code

The KY-003 Arduino sketch will light up the LED on pin 13 when a magnetic field is detected.

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 == HIGH) //when magnetic field is detected, turn led on
	{
		digitalWrite(Led, HIGH);
	}
	else
	{
		digitalWrite(Led, LOW);
	}
}

Leave a Reply

1 Comment on "KY-003 Hall Magnetic Sensor Module"

avatar
Jeffrey
Jeffrey

Amazing dood