

The Keyestudio Reed Switch Sensor Magnetron Module (Part ID: KS0038) is a versatile sensor module designed to detect the presence of a magnetic field. It utilizes a reed switch, which is a mechanical switch that closes its contacts when exposed to a magnetic field. This module is widely used in Arduino projects for applications such as door/window sensors, security systems, and proximity detection.
The module is compact, easy to use, and highly reliable, making it an excellent choice for both beginners and experienced electronics enthusiasts.








Below are the key technical details of the Keyestudio Reed Switch Sensor Magnetron Module:
The module has a 3-pin interface, as described in the table below:
| Pin Name | Description | Connection Details |
|---|---|---|
| Signal | Digital output signal (High/Low) | Connect to Arduino digital pin |
| VCC | Power supply (3.3V to 5V) | Connect to Arduino 3.3V or 5V pin |
| GND | Ground | Connect to Arduino GND pin |
Wiring the Module:
Operation:
Onboard LED:
Below is an example Arduino sketch to demonstrate how to use the Keyestudio Reed Switch Sensor Magnetron Module:
// Define the pin connected to the reed switch module
const int reedSwitchPin = 2; // Digital pin 2
const int ledPin = 13; // Built-in LED pin 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 sensorState = digitalRead(reedSwitchPin); // Read the sensor state
if (sensorState == LOW) {
// 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(500); // Wait for 500ms before the next reading
}
The module does not detect the magnet:
The onboard LED does not light up:
False triggers or unstable readings:
Q: Can I use this module with a Raspberry Pi?
A: Yes, the module can be used with a Raspberry Pi. Connect the Signal pin to a GPIO pin, and ensure the module is powered with 3.3V to avoid damaging the Pi's GPIO pins.
Q: What type of magnet should I use?
A: Any small neodymium or ferrite magnet should work. Ensure the magnet's strength is sufficient to activate the reed switch.
Q: Is the module polarity-sensitive?
A: No, the reed switch is not polarity-sensitive. However, ensure proper wiring of the VCC and GND pins to avoid damage to the module.
Q: Can I use multiple modules in a single project?
A: Yes, you can use multiple modules by connecting their Signal pins to different digital input pins on your microcontroller.
This concludes the documentation for the Keyestudio Reed Switch Sensor Magnetron Module (KS0038).