Description
What is it The Magnetic Reed Module KY-025 is a magnetic sensor compatible with Arduino. This device is used to detect the presence of a magnetic field, making it suitable for security and home automation projects. Features Magnetic sensor compatible with Arduino; Ideal for monitoring the opening or closing of doors, windows, or safes; What is it used for The Magnetic Reed Module KY-025 can be used to create simple home security systems. It is compatible with Arduino and can be integrated into projects that require the detection of the presence or absence of a magnetic field. Tutorial: How to use Magnetic Reed KY-025 The Magnetic Reed KY-025 is a simple magnetic sensor that can be used to detect the presence of a magnetic field. Ideal for projects such as doors and windows, home security systems, or any application where it is necessary to monitor the opening or closing of a door or a safe. What is needed Arduino Uno Magnetic Field (magnetic bar) Jumper Cable Steps Connect the VCC pin of the KY-025 module to the 5V of the Arduino. Connect the GND pin of the KY-025 module to the ground of the Arduino. Connect the OUT pin of the KY-025 module to a digital pin of the Arduino (e.g., pin 2). Test the connection with a multimeter or an LED to check the logic output. Write and upload the following Arduino sketch to your microcontroller. Position the Magnetic Reed module near the magnetic field (magnetic bar) that moves when you open or close a door. Test the functionality of the sensor by monitoring the logic output with an LED connected to the digital pin of the Arduino. Example code: const int reedPin = 2; // input pin for the Reed module void setup() { pinMode(reedPin, INPUT); } void loop() { if (digitalRead(reedPin) == HIGH) { Serial.println(







Reviews
There are no reviews yet.