KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

Rs.180.00
Skip to product information
KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

Buy the KY-021 Mini Magnetic Reed Switch Sensor Module online in Pakistan from Robostan.pk. This compact digital magnetic detection module is designed for Arduino, ESP32, Raspberry Pi, robotics, home automation, door security alarms, and DIY electronics projects.

The KY-021 Magnetic Reed Sensor contains a normally open reed switch that responds to a nearby magnetic field. When a suitable magnet approaches the sensor, its internal metal contacts close, producing a change in the digital output signal that can be detected by a compatible microcontroller.

Featuring a 3.3V to 5V operating voltage, three-pin interface, and compact PCB design, the KY-021 is an affordable solution for magnetic proximity detection, door and window monitoring, position sensing, and electronic switching experiments.

Key Features

  • KY-021 mini magnetic reed switch module
  • Normally open (NO) magnetic switch
  • Contactless magnetic activation
  • Operating voltage: 3.3V to 5V DC
  • Digital HIGH/LOW signal output
  • Three-pin interface: Signal, VCC and GND
  • Typical onboard 10kΩ pull-up resistor
  • Sealed glass reed switch construction
  • No external magnetic field sensor IC required
  • Compatible with Arduino digital input pins
  • Suitable for ESP32 and Raspberry Pi GPIO projects
  • Compact and lightweight PCB
  • Useful for door and window security alarms
  • Suitable for magnetic position detection
  • Easy integration into automation projects

Technical Specifications

  • Product Name: KY-021 Mini Magnetic Reed Switch Sensor Module
  • Model Number: KY-021
  • Alternative PCB Marking: HW-497 on some versions
  • Sensor Type: Magnetic Reed Switch
  • Switch Configuration: Normally Open (NO)
  • Detection Method: Magnetic Field Activated Contacts
  • Operating Voltage: 3.3V to 5V DC
  • Output Type: Digital
  • Typical Output When Magnet Is Detected: LOW
  • Typical Output Without Magnet: HIGH
  • Onboard Resistor: 10kΩ
  • Interface: Three-Pin Header
  • Connection Pins: S, + and -
  • Typical PCB Dimensions: Approximately 18.5 × 15mm
  • Compatible Platforms: Arduino, ESP32, Raspberry Pi and Other Compatible Controllers
  • Mounting: PCB Sensor Module

Applications

  • Arduino magnetic detection projects
  • Door and window security alarms
  • Magnetic proximity sensing
  • Smart home automation systems
  • Electronic door monitoring
  • Cabinet and drawer position detection
  • Robotics magnetic switching
  • Contactless position monitoring
  • DIY magnetic security systems
  • ESP32 IoT monitoring projects
  • Raspberry Pi GPIO applications
  • Educational electronics experiments
  • Mechanical movement detection using magnets

How Does the KY-021 Magnetic Reed Switch Work?

The KY-021 Magnetic Reed Switch contains two flexible metal contacts sealed inside a small glass capsule.

Under normal conditions, the contacts remain separated, creating an open circuit.

When a suitable magnet approaches, the magnetic field causes the contacts to attract each other and close the circuit.

When the magnet is removed, the contacts return to their original open state.

A connected Arduino or other microcontroller detects these changes through the module's digital output pin.

Important: The KY-021 is a basic magnetic switch. It does not measure magnetic field strength, magnet distance, or precise position.

KY-021 Sensor Pinout

  • S (Signal): Digital magnetic detection output
  • + (VCC): Positive power supply, 3.3V or 5V
  • - (GND): Ground connection

On a commonly documented KY-021 module, the output is HIGH when no magnet is detected and LOW when the reed contacts close.

Note: Verify the pin labels and switching behavior on your actual PCB before installation.

Arduino Compatibility

The KY-021 is compatible with Arduino UNO, Arduino Nano, Arduino Mega, and other microcontrollers with digital input pins.

A typical Arduino UNO connection is:

  • KY-021 S: Arduino digital pin D2
  • KY-021 +: Arduino 5V
  • KY-021 -: Arduino GND

The Arduino digitalRead() function can monitor the output and determine whether a magnet is close enough to activate the switch.

This makes the KY-021 suitable for simple magnetic detection and security alarm programming.

ESP32 and Raspberry Pi Compatibility

The KY-021 can also be used with ESP32 and Raspberry Pi GPIO inputs.

For these 3.3V systems, power the module from a suitable 3.3V supply so the output signal remains within the controller's permitted input voltage range.

The sensor can then be monitored through a digital GPIO input using appropriate software.

Door and Window Magnetic Alarm Projects

The KY-021 Magnetic Reed Switch Module is useful for building door and window monitoring systems.

A magnet can be mounted on a moving door or window, with the sensor positioned nearby on the fixed frame.

As the door opens or closes, the position of the magnet changes, causing the sensor to switch between its digital output states.

A microcontroller can use this information to activate a buzzer, control a status LED, or send a notification through a compatible wireless system.

KY-021 vs KY-003 Hall Effect Sensor

Both the KY-021 and KY-003 detect magnetic fields, but they use different sensing methods.

  • KY-021: Uses physical metal reed contacts that open and close in response to a magnetic field.
  • KY-003: Uses a solid-state Hall Effect sensor IC to produce a digital magnetic detection signal.

The KY-021 is useful for simple magnetic switching, while the KY-003 is suited to applications requiring solid-state magnetic sensing without mechanical contacts.

Advantages of the KY-021

Simple Magnetic Detection: Provides a digital switching signal when a suitable magnet approaches.

Low-Voltage Operation: Compatible with commonly used 3.3V and 5V microcontroller systems.

Compact Design: Easy to incorporate into small electronic monitoring projects.

Simple Interface: Uses standard digital input connections without complex communication protocols.

Versatile Applications: Useful for door alarms, contactless switching, magnetic position sensing, and educational electronics.

Important Usage Notes

  • The KY-021 uses a mechanical reed switch, not a Hall Effect sensor.
  • Magnetic detection distance depends on magnet strength, orientation, and installation position.
  • Do not assume a fixed detection distance for every magnet.
  • Mechanical contact bouncing may occur during switching.
  • Software debouncing may be required for stable readings.
  • The glass reed switch is fragile and should not be bent or crushed.
  • Verify the actual module pinout before applying power.
  • Use a regulated 3.3V or 5V supply as appropriate.
  • Do not connect high-current electrical loads directly to the digital signal output.
  • Use a separate suitable relay or driver circuit when switching external loads.
  • The module should not be used as the sole protective device in safety-critical systems.

Package Contents

  • 1 × KY-021 Mini Magnetic Reed Switch Sensor Module

Magnet, Arduino board, and connecting wires are not included unless specified separately.

Buy KY-021 Magnetic Reed Switch Module in Pakistan

Looking for a KY-021 Mini Magnetic Reed Switch Sensor Module in Pakistan? Shop online at Robostan.pk for magnetic sensors, reed switches, Arduino modules, ESP32 boards, Raspberry Pi accessories, robotics components, and DIY electronics supplies.

The KY-021 is suitable for students, engineers, robotics enthusiasts, and electronics developers building magnetic proximity detection and automation projects.

Order your KY-021 Magnetic Reed Sensor from Robostan.pk with nationwide delivery across Pakistan, including Lahore, Karachi, Islamabad, Rawalpindi, Faisalabad, Multan, Peshawar, and other cities.

Robostan.pk – Build. Innovate. Create.

Rs.180.00

Pickup available at Robostan

Usually ready in 24 hours

View store information

KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

Robostan

Pickup available, usually ready in 24 hours

Shop No.6 Ground Floor, Al-Khalil Center, Hall Rd, Garhi Shahu, Lahore, 54700
Lahore 54700
Pakistan

+923324249540

KY-021 Mini Magnetic Reed Switch Sensor Module for Arduino

Buy the KY-021 Mini Magnetic Reed Switch Sensor Module online in Pakistan from Robostan.pk. This compact digital magnetic detection module is designed for Arduino, ESP32, Raspberry Pi, robotics, home automation, door security alarms, and DIY electronics projects.

The KY-021 Magnetic Reed Sensor contains a normally open reed switch that responds to a nearby magnetic field. When a suitable magnet approaches the sensor, its internal metal contacts close, producing a change in the digital output signal that can be detected by a compatible microcontroller.

Featuring a 3.3V to 5V operating voltage, three-pin interface, and compact PCB design, the KY-021 is an affordable solution for magnetic proximity detection, door and window monitoring, position sensing, and electronic switching experiments.

Key Features

  • KY-021 mini magnetic reed switch module
  • Normally open (NO) magnetic switch
  • Contactless magnetic activation
  • Operating voltage: 3.3V to 5V DC
  • Digital HIGH/LOW signal output
  • Three-pin interface: Signal, VCC and GND
  • Typical onboard 10kΩ pull-up resistor
  • Sealed glass reed switch construction
  • No external magnetic field sensor IC required
  • Compatible with Arduino digital input pins
  • Suitable for ESP32 and Raspberry Pi GPIO projects
  • Compact and lightweight PCB
  • Useful for door and window security alarms
  • Suitable for magnetic position detection
  • Easy integration into automation projects

Technical Specifications

  • Product Name: KY-021 Mini Magnetic Reed Switch Sensor Module
  • Model Number: KY-021
  • Alternative PCB Marking: HW-497 on some versions
  • Sensor Type: Magnetic Reed Switch
  • Switch Configuration: Normally Open (NO)
  • Detection Method: Magnetic Field Activated Contacts
  • Operating Voltage: 3.3V to 5V DC
  • Output Type: Digital
  • Typical Output When Magnet Is Detected: LOW
  • Typical Output Without Magnet: HIGH
  • Onboard Resistor: 10kΩ
  • Interface: Three-Pin Header
  • Connection Pins: S, + and -
  • Typical PCB Dimensions: Approximately 18.5 × 15mm
  • Compatible Platforms: Arduino, ESP32, Raspberry Pi and Other Compatible Controllers
  • Mounting: PCB Sensor Module

Applications

  • Arduino magnetic detection projects
  • Door and window security alarms
  • Magnetic proximity sensing
  • Smart home automation systems
  • Electronic door monitoring
  • Cabinet and drawer position detection
  • Robotics magnetic switching
  • Contactless position monitoring
  • DIY magnetic security systems
  • ESP32 IoT monitoring projects
  • Raspberry Pi GPIO applications
  • Educational electronics experiments
  • Mechanical movement detection using magnets

How Does the KY-021 Magnetic Reed Switch Work?

The KY-021 Magnetic Reed Switch contains two flexible metal contacts sealed inside a small glass capsule.

Under normal conditions, the contacts remain separated, creating an open circuit.

When a suitable magnet approaches, the magnetic field causes the contacts to attract each other and close the circuit.

When the magnet is removed, the contacts return to their original open state.

A connected Arduino or other microcontroller detects these changes through the module's digital output pin.

Important: The KY-021 is a basic magnetic switch. It does not measure magnetic field strength, magnet distance, or precise position.

KY-021 Sensor Pinout

  • S (Signal): Digital magnetic detection output
  • + (VCC): Positive power supply, 3.3V or 5V
  • - (GND): Ground connection

On a commonly documented KY-021 module, the output is HIGH when no magnet is detected and LOW when the reed contacts close.

Note: Verify the pin labels and switching behavior on your actual PCB before installation.

Arduino Compatibility

The KY-021 is compatible with Arduino UNO, Arduino Nano, Arduino Mega, and other microcontrollers with digital input pins.

A typical Arduino UNO connection is:

  • KY-021 S: Arduino digital pin D2
  • KY-021 +: Arduino 5V
  • KY-021 -: Arduino GND

The Arduino digitalRead() function can monitor the output and determine whether a magnet is close enough to activate the switch.

This makes the KY-021 suitable for simple magnetic detection and security alarm programming.

ESP32 and Raspberry Pi Compatibility

The KY-021 can also be used with ESP32 and Raspberry Pi GPIO inputs.

For these 3.3V systems, power the module from a suitable 3.3V supply so the output signal remains within the controller's permitted input voltage range.

The sensor can then be monitored through a digital GPIO input using appropriate software.

Door and Window Magnetic Alarm Projects

The KY-021 Magnetic Reed Switch Module is useful for building door and window monitoring systems.

A magnet can be mounted on a moving door or window, with the sensor positioned nearby on the fixed frame.

As the door opens or closes, the position of the magnet changes, causing the sensor to switch between its digital output states.

A microcontroller can use this information to activate a buzzer, control a status LED, or send a notification through a compatible wireless system.

KY-021 vs KY-003 Hall Effect Sensor

Both the KY-021 and KY-003 detect magnetic fields, but they use different sensing methods.

  • KY-021: Uses physical metal reed contacts that open and close in response to a magnetic field.
  • KY-003: Uses a solid-state Hall Effect sensor IC to produce a digital magnetic detection signal.

The KY-021 is useful for simple magnetic switching, while the KY-003 is suited to applications requiring solid-state magnetic sensing without mechanical contacts.

Advantages of the KY-021

Simple Magnetic Detection: Provides a digital switching signal when a suitable magnet approaches.

Low-Voltage Operation: Compatible with commonly used 3.3V and 5V microcontroller systems.

Compact Design: Easy to incorporate into small electronic monitoring projects.

Simple Interface: Uses standard digital input connections without complex communication protocols.

Versatile Applications: Useful for door alarms, contactless switching, magnetic position sensing, and educational electronics.

Important Usage Notes

  • The KY-021 uses a mechanical reed switch, not a Hall Effect sensor.
  • Magnetic detection distance depends on magnet strength, orientation, and installation position.
  • Do not assume a fixed detection distance for every magnet.
  • Mechanical contact bouncing may occur during switching.
  • Software debouncing may be required for stable readings.
  • The glass reed switch is fragile and should not be bent or crushed.
  • Verify the actual module pinout before applying power.
  • Use a regulated 3.3V or 5V supply as appropriate.
  • Do not connect high-current electrical loads directly to the digital signal output.
  • Use a separate suitable relay or driver circuit when switching external loads.
  • The module should not be used as the sole protective device in safety-critical systems.

Package Contents

  • 1 × KY-021 Mini Magnetic Reed Switch Sensor Module

Magnet, Arduino board, and connecting wires are not included unless specified separately.

Buy KY-021 Magnetic Reed Switch Module in Pakistan

Looking for a KY-021 Mini Magnetic Reed Switch Sensor Module in Pakistan? Shop online at Robostan.pk for magnetic sensors, reed switches, Arduino modules, ESP32 boards, Raspberry Pi accessories, robotics components, and DIY electronics supplies.

The KY-021 is suitable for students, engineers, robotics enthusiasts, and electronics developers building magnetic proximity detection and automation projects.

Order your KY-021 Magnetic Reed Sensor from Robostan.pk with nationwide delivery across Pakistan, including Lahore, Karachi, Islamabad, Rawalpindi, Faisalabad, Multan, Peshawar, and other cities.

Robostan.pk – Build. Innovate. Create.

You may also like