The Modulo Reed Switch (KY-025), manufactured by Keys, is an electromechanical switch that operates in the presence of a magnetic field. It consists of two ferromagnetic contacts enclosed in a sealed glass tube. When a magnetic field is applied, the contacts close, allowing current to flow through the circuit. This component is widely used in applications requiring non-contact switching, such as proximity sensing, security systems, and magnetic field detection.
The following table outlines the key technical details of the KY-025 Modulo Reed Switch:
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5V |
Operating Current | 15mA (typical) |
Output Type | Digital (High/Low) |
Sensitivity Range | Adjustable via potentiometer |
Dimensions | 32mm x 14mm x 8mm |
Operating Temperature | -40°C to +85°C |
The KY-025 Modulo Reed Switch has a 3-pin interface. The pinout is as follows:
Pin | Name | Description |
---|---|---|
1 | Signal (S) | Digital output signal (High when magnetic field detected) |
2 | VCC | Power supply input (3.3V to 5V) |
3 | GND | Ground connection |
Connect the Pins:
Adjust Sensitivity:
Place a Magnet:
Below is an example of how to use the KY-025 with an Arduino UNO to detect a magnetic field:
// KY-025 Reed Switch Example with Arduino UNO
// Connect KY-025 Signal pin to Arduino digital pin 2
// Connect KY-025 VCC to 5V and GND to GND
const int reedSwitchPin = 2; // Pin connected to KY-025 Signal pin
const int ledPin = 13; // Built-in LED on Arduino
void setup() {
pinMode(reedSwitchPin, INPUT); // Set reed switch pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int reedState = digitalRead(reedSwitchPin); // Read reed switch state
if (reedState == HIGH) {
// Magnetic field detected
digitalWrite(ledPin, HIGH); // Turn on LED
Serial.println("Magnetic field detected!");
} else {
// No magnetic field
digitalWrite(ledPin, LOW); // Turn off LED
Serial.println("No magnetic field.");
}
delay(100); // Small delay for stability
}
Reed Switch Not Responding:
Erratic Output:
No Output Signal:
Potentiometer Not Adjusting Sensitivity:
Q1: Can the KY-025 detect all types of magnets?
A1: The KY-025 is sensitive to most common magnets, but the detection range and response depend on the strength of the magnetic field.
Q2: Can I use the KY-025 with a 3.3V microcontroller?
A2: Yes, the KY-025 operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V microcontrollers like the ESP32.
Q3: How do I know if the reed switch is working?
A3: When a magnetic field is detected, the Signal (S) pin outputs a HIGH signal, which can be verified using an LED or a multimeter.
Q4: Is the KY-025 suitable for outdoor use?
A4: The KY-025 is not weatherproof. For outdoor applications, ensure it is enclosed in a protective casing to prevent damage from moisture or dust.