

The KY-003 Hall Effect Sensor is a compact and versatile device designed to detect the presence of a magnetic field. It operates by converting magnetic field strength into a digital signal, which can be easily interpreted by microcontrollers or other digital systems. This sensor is widely used in applications such as proximity sensing, speed detection, and position sensing. Its small size and ease of use make it a popular choice for hobbyists and professionals alike.








The KY-003 Hall Effect Sensor has three pins, as described in the table below:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | Signal (S) | Outputs a digital HIGH (1) when a magnetic field is detected. |
| 2 | VCC | Connects to the positive power supply (3.3V to 5V). |
| 3 | GND | Connects to the ground of the power supply. |
The following code demonstrates how to use the KY-003 Hall Effect Sensor with an Arduino UNO. The onboard LED (connected to pin 13) will light up when a magnetic field is detected.
// Define the pin connected to the KY-003 Signal pin
const int hallSensorPin = 2; // Digital pin 2
const int ledPin = 13; // Onboard LED pin
void setup() {
pinMode(hallSensorPin, INPUT); // Set the sensor pin as input
pinMode(ledPin, OUTPUT); // Set the LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int sensorState = digitalRead(hallSensorPin); // Read the sensor state
if (sensorState == HIGH) {
// Magnetic field detected
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Magnetic field detected!");
} else {
// No magnetic field detected
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("No magnetic field detected.");
}
delay(100); // Small delay for stability
}
The sensor does not detect the magnetic field.
The output signal is unstable or noisy.
The sensor gets hot or stops working.
Q: Can the KY-003 detect both poles of a magnet?
A: Yes, the KY-003 can detect both the North and South poles of a magnet.
Q: Can I use the KY-003 with a 3.3V microcontroller?
A: Yes, the KY-003 operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V systems.
Q: What is the maximum distance at which the sensor can detect a magnet?
A: The detection range depends on the strength of the magnet. Typically, small magnets need to be within a few millimeters of the sensor.
Q: Can I use multiple KY-003 sensors in the same circuit?
A: Yes, you can use multiple sensors, but ensure each sensor has its own pull-down resistor if needed, and avoid interference between sensors.
This documentation provides a comprehensive guide to understanding and using the KY-003 Hall Effect Sensor effectively.