
The reed switch, along with modules such as the A3144 and the KY-025, are setting trends in DIY projects, home automation, security systems, and even industrial applications. Their ability to detect magnetic fields and transform that information into useful electrical signals has made these devices essential components for those seeking practical, reliable, and affordable solutions. You've probably seen one in door and window alarms, but their uses go far beyond that.
In this article I am going to tell you All about reed switches and related modules, from their operating principle to how to use them with Arduino-type microcontrollers, including their construction details, advantages, disadvantages, and practical examples. In addition, I will explain how devices like the KY-025 and the A3144, and how to get the most out of them when designing your own projects. So if you're looking for a comprehensive, accessible guide packed with useful and accurate information, keep reading because this is for you.
What is a reed switch?
El reed switch It is a special type of switch activated by magnetic field. Its operation is simple but very effective: it consists of two ferromagnetic metal sheets hermetically sealed inside a glass capsule. These sheets, normally composed of nickel and iron, are aligned so that, in the presence of a sufficient magnetic field, they attract each other and close the circuit.
Depending on the configuration of the reeds, the reed switch can be normally open (NO) or normally closed (NC). In the former, the contacts close when a magnet is brought close; in the latter, they open. This system was developed in 1936 by WB Elwood at Bell Labs, and its use has continued to expand since then thanks to its simplicity and reliability.
How exactly does a reed switch work?

Inside the glass capsule, the two ferromagnetic sheets overlap leaving a small gap. When a external magnetic field —provided by a magnet or a field-generating coil—acts on the switch, the plates acquire opposite poles and attract each other, closing the contact and allowing current to flow. If the field is removed, the elasticity of the plates separates them again and the circuit opens.
El design is optimized to extend contact lifeThe contact area is usually coated with hard metals such as rhodium or ruthenium to resist abrasion from repeated closures. In addition, the capsule's internal gas (usually nitrogen or inert gases, or even vacuum in high-voltage versions) prevents oxidation and electric arcing, contributing to the long term reliability.
Real-life applications of the reed switch
The reed switches They are used in a multitude of contexts thanks to their high reliability and low cost. You'll see them in door and window security systems, opening and closing detectors, electronic weighing systems, level and flow meters, and even in washing machines, photocopiers, and home alarms. widespread application is position detection non-contact in motors or rotating mechanisms, for example in bicycle speedometers or cycle detectors in industrial automation.
Differences between reed switches, Hall effect switches, and modules like the A3144 and KY-025
[amazon box=”B07ZDJSZSG, B08R3VZCK2″ items=”2″ grid=”2″ image_size=”large” description_items=”0″ template=”widget”]
It is easy to confuse the reed switches with Hall effect sensors such as the A3144 or with integrated modules such as the KY-025Let's see how they differ:
- Reed switch: An mechanical switch Magnetically activated. It does not require a power supply to operate; it is activated only under the influence of a magnetic field and can switch small voltages and currents In a direct way.
- Hall effect sensor (e.g. A3144): uses a different physical principle: the Hall effect. When a magnetic field acts perpendicular to the current flowing in a semiconductor material, a transverse voltage is generated. Hall-type sensors A3144 turn this tension into a digital output signal, perfect for reading with a microcontroller. Requires electrical power supply (usually 3.3V or 5V).
- KY-025: An module that integrates a reed switch along with other electronic components (comparator, potentiometer, LEDs, resistors). It allows you to adjust the sensitivity and provides analog and digital outputs, facilitating integration with systems such as Arduino.
Internal components and features of the KY-025 module
El KY-025 It is one of the most popular magnetic switch modules among makers and electronics enthusiasts. It consists of:
- A reed switch 2x14 mm, normally open
- Un LM393 dual differential comparator
- Un trimmer potentiometer (model 3296W-104) to adjust the sensitivity
- Several resistors and two indicator LEDs
- Four connection pins: power, ground, analog output and digital output
The Technical specifications Typical features of the KY-025 are:
- Operating voltage: 3.3V to 5V
- Comparator output current: up to 16 mA
- Outputs: analog (A0) and digital (D0)
- Size: 15 x 35.2 x 1.1 mm
- Weight: 3 grams
How does the KY-025 work with a microcontroller like Arduino?
Thanks to its design, the KY-025 is very easy to connect and use with boards like Arduino:
- Power pin (+) to 5V of Arduino
- Ground pin (G) to GND of the Arduino
- Analog output (A0) from the module to the analog pin A0 of the Arduino
- Digital output (D0) to digital pin 3 of the Arduino
La digital output (D0) is activated (goes high) when the reed switch detects a sufficient magnetic field. This allows an LED to be turned on, an alarm to be triggered, an event to be logged, etc. For its part, the analog output (A0) provides a proportional value that can be used to adjust sensitivity or detect variations in magnetic field strength.
An example of code for Arduino could be:
int led = 13; int digitalPin = 3; int analogPin = A0; int digitalVal; int analogVal; void setup(){ pinMode(led, OUTPUT); pinMode(digitalPin, INPUT); Serial.begin(9600); } void loop(){ digitalVal = digitalRead(digitalPin); if(digitalVal == HIGH){ digitalWrite(led, HIGH); } else { digitalWrite(led, LOW); } analogVal = analogRead(analogPin); Serial.println(analogVal); delay(100); }
This code allows you to verify the operation of the KY-025, turning on an LED when a magnet is detected and reading analog values to adjust the sensitivity thanks to the integrated potentiometer.
Sensor A3144: Digital Hall Effect Sensor
El A3144 It is a three-terminal Hall effect sensor chip with digital output. It is designed to detect the presence of magnetic fields, but unlike the reed switch, it has no moving mechanical parts. Its operation is based on detecting potential differences generated in a semiconductor when a current flows and a perpendicular magnetic field is applied.
Its main features are:
- Power supply from 3.3V to 5V
- Very low consumption (in the order of milliamps)
- Digital output compatible with microcontrollers (0V for insufficient field, Vcc for sufficient field)
- very fast response
- High durability due to being “contactless”
It is ideal for applications where magnetic fields must be detected accurately and without mechanical wear, such as in revolution counters, proximity sensors, or as a replacement for conventional mechanical switches. To learn about other related components, you can consult this Article on Hall effect sensors in HWLibre.
Where are these modules used in practice?
We are not exaggerating if we say that the reed switch And Hall effect sensors are found in many devices. Their most common uses include:
- Door and window opening sensors: In security and alarm systems, separating the magnet from the sensor detects the opening of the access door.
- Revolution and cycle counters: Using a magnet on a wheel that passes in front of the sensor, revolutions can be counted or speed measured.
- Industrial applications: position detection in machinery, process automation, limit switches in robotic arms, etc.
- Home appliances: control of the presence of closed doors in washing machines, refrigerators, photocopiers, etc.
- Flow and level meters: They detect the passage of magnetic floats in liquids or the position of moving parts inside tanks.
Advantages and limitations of reed switches and KY-025/A3144 modules
Advantages of reed switches and derivative modules
- Simplicity: They do not require complex circuitry for basic switching tasks.
- Reliability: Its sealed construction protects against dust, moisture and oxidation.
- Low cost: They are inexpensive and easy to replace components.
- Electrical isolation: Ideal for separating low and high voltage circuits.
Reed switch limitations and how to mitigate them
- limited service life compared to Hall effect sensors — although a good coating and suitable internal gas can significantly extend it.
- Slower response than electronic sensors — not recommended for very high frequencies or ultra-fast applications.
- Mechanical wear If switching is frequent, in these cases a Hall effect sensor (such as the A3144) is a better choice.
- Sensitivity to intensity and distance of the magnetic field — adjusting the sensitivity on modules like the KY-025 helps overcome this limitation.
How to choose between reed switches, Hall effect switches, and integrated modules
The appropriate selection depends on particular needs:
- To economical and simple solutions, detect whether a magnet is present or not, the reed switch or the KY-025 module are suitable.
- In applications of high speeds and no mechanical wear, the A3144 it is more convenient.
- To obtain both adjustable analog and digital outputs, the KY-025 provides greater versatility.
Practical example of using a reed switch and a KY-025 module with Arduino
To illustrate how to get the most out of these components, let's see how to build a window opening detection system with Arduino and a KY-025 module:
- Connecting the KY-025: Pin + to 5V, GND to ground, D0 (digital) to a digital pin, and A0 (analog) to an analog pin if you want proportional readings.
- Placing the magnet: Stick the magnet to the moving part (door/window) and the module to the frame, aligned so that, when the window is closed, the magnetic field acts on the reed switch.
- Programming: Use a code similar to the one above to activate an alarm, turn on an LED, or send a notification when the sensor detects opening.
- Adjusting the sensitivity: Turn the potentiometer on the KY-025 module until the sensor responds correctly only when the door/window is actually opened or closed.