Introduction
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
![KY-003-Hall-Magnetic-Sensor-Module](http://arduinocircuit.com/wp-content/uploads/2023/01/KY-003-Hall-Magnetic-Sensor-Module.webp)
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 UNO | 1 | Buy Link |
KY-003 Hall Magnetic Sensor module | 1 | Buy Link |
LED ( Red ) | 1 | Buy Link |
Jumper Wires | – | Buy Link |
Breadboard | 1 | Buy Link |
Specifications
This module contains an LED, a 680Ω resistor, a 3144EUA-S Hall-effect switch, 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] |
Technical Data
Chipset | A3144 |
Measuring range | -40°C to +150°C |
Sensor Type | Hall Effect Transistor/Switch |
Function range | 5V (Due to the LED) |
Pinout
![KY-003-Hall-Magnetic-Sensor-Module-Pinout](http://arduinocircuit.com/wp-content/uploads/2023/01/KY-003-Hall-Magnetic-Sensor-Module-Pinout.webp)
Pin Configuration
Pin Name | Pin Type |
---|---|
S | Signal Pin |
middle Pin | Vcc (+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
![KY-003-Hall-Magnetic-Sensor-Module-with-Arduino-circuit-diagram](http://arduinocircuit.com/wp-content/uploads/2023/01/KY-003-Hall-Magnetic-Sensor-Module-with-Arduino-circuit-diagram-1024x597.webp)
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.
Arduino | KY-003 Module | LED |
---|---|---|
+5v | Middle | |
GND | GND | LED -Ve |
Pin 3 | Signal | |
Pin 13 | LED +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
Code
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);
}
else
{
digitalWrite(Led, LOW);
}
}
Downloads Files
- KY-003 Hall Magnetic Sensor Module Fritzing Part:
- 3144EUA-S Hall-effect switch Datasheet: