1. Introduction and Overview
The HUABAN KY-003 is a Hall Magnetic Sensor Module designed to detect the presence of magnetic fields. This module is commonly used in various electronic projects, including those based on microcontrollers like Arduino, for applications such as position sensing, speed detection, and security systems. This package includes three KY-003 modules.
The KY-003 module typically incorporates a 44E-402 Hall effect sensor, which is a digital sensor. This means it outputs a distinct HIGH or LOW signal when a magnetic field is detected, rather than a continuously varying analog voltage. While some descriptions may refer to 'analog magnetic sensor module', its primary function is digital detection.

Figure 1: HUABAN KY-003 Hall Magnetic Sensor Module
The module features three pins for easy connection: VCC (power supply), GND (ground), and Signal (output).
2. Product Features
- KY-003 Hall Magnetic Sensor Module
- Digital output for magnetic field detection
- Compact design for easy integration into projects
- Compatible with popular microcontrollers
3. Setup and Wiring
To set up the KY-003 Hall Magnetic Sensor Module, connect it to your microcontroller following the pin assignments:
- VCC: Connect to the 5V power supply pin of your microcontroller.
- GND: Connect to the Ground (GND) pin of your microcontroller.
- Signal: Connect to a digital input pin on your microcontroller (e.g., Digital Pin 2).

Figure 2: KY-003 Module Pinout
Example Wiring (Arduino):
Connect the module to an Arduino board as follows:
- KY-003 VCC → Arduino 5V
- KY-003 GND → Arduino GND
- KY-003 Signal → Arduino Digital Pin 2 (or any other digital input pin)
4. Operating Instructions
The KY-003 module detects magnetic fields. When a magnetic field of sufficient strength is brought near the sensor, its output signal changes state (e.g., from LOW to HIGH or vice-versa, depending on the sensor's orientation and magnetic pole). This change in state can be read by a microcontroller.
Standard Digital Usage Example (Arduino Sketch):
This code demonstrates how to read the digital state of the Hall sensor and turn an LED on or off accordingly.
int hallSensorPin = 2; // Digital pin connected to the KY-003 Signal pin
int ledPin = 13; // Built-in LED pin on most Arduino boards
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(hallSensorPin, INPUT); // Set the sensor pin as an input
Serial.begin(9600); // Initialize serial communication for debugging
}
void loop() {
int sensorState = digitalRead(hallSensorPin); // Read the state of the Hall sensor
if (sensorState == HIGH) {
digitalWrite(ledPin, HIGH); // Magnetic field detected, turn LED on
Serial.println("Magnetic field detected!");
} else {
digitalWrite(ledPin, LOW); // No magnetic field, turn LED off
Serial.println("No magnetic field.");
}
delay(100); // Small delay to prevent rapid readings
}Provided Example Code (Arduino Sketch):
The product description includes an example sketch that uses analogRead() and then uses the read value as a delay. While the KY-003 is primarily a digital sensor, this code demonstrates an unconventional way to interact with it, where the LED blink rate is influenced by the sensor's output when connected to an analog input pin.
int sensorPin = A5; // select the input pin (Analog Pin 5)
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup () {
pinMode (ledPin, OUTPUT);
Serial.begin (9600);
}
void loop () {
sensorValue = analogRead (sensorPin); // Read analog value from sensor pin
digitalWrite (ledPin, HIGH);
delay (sensorValue); // Delay based on sensor value
digitalWrite (ledPin, LOW);
delay (sensorValue); // Delay based on sensor value
}In this specific example, if the sensor outputs a digital HIGH (e.g., 5V), analogRead(A5) might return a high value (e.g., 1023 on a 10-bit ADC). This high value is then used as a delay in milliseconds, causing the LED to blink slowly. If the sensor outputs LOW (e.g., 0V), analogRead(A5) would return a low value (e.g., 0), resulting in a very fast or no visible blink.
5. Specifications
| Item Model Number | MW-Sensor-KY-003-3PCS |
| Package Dimensions | 3.46 x 2.32 x 0.35 inches |
| Item Weight | 0.176 ounces |
| Manufacturer | HUABAN |
6. Troubleshooting
- Sensor not responding:
- Verify all wiring connections (VCC, GND, Signal) are correct and secure.
- Ensure the microcontroller is powered on and the code is uploaded correctly.
- Test with a known strong magnet.
- Check if the correct digital input pin is specified in your code.
- Inconsistent readings:
- Ensure there are no other strong magnetic fields or electromagnetic interference nearby.
- Try reversing the magnet's polarity; Hall sensors can be sensitive to specific poles.
- LED not blinking (using provided example code):
- Confirm the LED is correctly wired to pin 13 and functioning.
- Check if the
sensorPinis correctly set to an analog input (e.g., A5). - The delay might be too short or too long to be noticeable. Monitor serial output if available.
7. Maintenance
The KY-003 Hall Magnetic Sensor Module requires minimal maintenance. Follow these guidelines to ensure its longevity:
- Handling: Handle the module by its edges to avoid touching the sensor component or solder joints directly.
- Storage: Store the modules in an anti-static bag in a dry, cool environment away from direct sunlight and strong magnetic fields.
- Cleaning: If necessary, gently clean the module with a soft, dry cloth. Avoid using liquids or abrasive materials.
- Power: Ensure the power supply voltage does not exceed the recommended operating voltage (typically 5V).
8. Warranty and Support
For warranty information or technical support regarding your HUABAN KY-003 Hall Magnetic Sensor Module, please refer to the seller's return policy or contact the manufacturer directly through their official channels. Keep your purchase receipt for any warranty claims.