ESP32 KY-025 Reed Switch Module

KY-025 Reed Switch Module image

KY-025

Protocol: Analog,Digital

Overview

The KY-025 is a reed switch module that provides both analog and digital outputs. It is equipped with a potentiometer to adjust sensitivity and is suitable for detecting magnetic fields in various applications.

About KY-025 Reed Switch Module

The KY-025 Reed Switch Module is a magnetic sensor that detects the presence of a magnetic field. It features both analog and digital outputs: the analog output provides a voltage corresponding to the magnetic field strength, while the digital output activates when the magnetic field exceeds a user-defined threshold, adjustable via an onboard potentiometer. This module is commonly used in applications such as proximity sensing, position detection, and security systems.

Where to Buy

KY-025 Reed Switch Module

Starting from

$2 per unit

Amazon com
Amazon.com Ships worldwide
View Price
Amazon de
Amazon.de Ships to EU
View Price
Aliexpress
AliExpress Best value
View Price

Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.

Technical Specifications

Operating Voltage 3.3V to 5V
Dimensions 36 x 15 x 14 mm
Weight 2 g

Pinout Configuration

The VCC pin is used to supply power to the sensor, and it typically requires 3.3V or 5V (refer to the datasheet for specific voltage requirements). The GND pin is the ground connection and must be connected to the ground of your ESP32.

  • GND: Connects to ground.
  • +V: Connects to 3.3V or 5V power supply.
  • D0: Digital output; goes high when the magnetic field exceeds the set threshold.
  • A0: Analog output; provides a voltage proportional to the magnetic field strength.

Wiring with ESP32

  • GND: Connect to ESP32 GND.
  • +V: Connect to ESP32 3.3V or 5V.
  • D0: Connect to a digital input pin on ESP32 (e.g., GPIO17).
  • A0: Connect to an analog input pin on ESP32 (e.g., GPIO36).

Troubleshooting Guide

Common Issues

❌ No Response from Sensor

⚠️ Unstable Analog Readings

Debugging Tips

🔍 Serial Monitor

⚡ Voltage Checks

Code Examples

Arduino Example

C++
🔧

ESP-IDF Example

C++
🏠

ESPHome Example

YAML
🛠️

PlatformIO Example

C++
🐍

MicroPython Example

Python

Conclusion

The ESP32 KY-025 Reed Switch Module is a powerful KY-0xx module sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.

For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.

Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.