Skip to product information
1 of 7

vendor-unknown

Make a magnetic door sensor interfacing with Arduino uno - KT735

Make a magnetic door sensor interfacing with Arduino uno - KT735

SKU:KT735

1000 in stock

Regular price Rs. 800.00
Regular price Sale price Rs. 800.00
Sale Sold out
Shipping calculated at checkout.

For refund/return/replacement, call us at +91 95995 94524 For bulk and B2B enquiries kindly mail us at support@rees52.com

  • Fast Shipping
  • Affordable Price
  • Support
View full details

KIT INCLUDES:


HARDWARE REQUIRED

SOFTWARE REQUIRED

Arduino IDE 1.8.5 (programmable platform for Arduino)

Click To Download :https://www.arduino.cc/en/Main/Software



PIN DESCRIPTION

LED



.



CIRCUIT CONNECTION

  • Connect the positive pin (The Longer Lead) of the LED to pin 13 of the Arduino.
  • Connect the negative pin (The Shorter Pin) of the LED to pin GND (Ground) of the Arduino. 13 and GND should be next to each other.

Magnetic Door Sensor (Reed Switch):

  • Since the switch is non polar, you can plug in the wires any way.
  • Connect one wire of the switch to a jumper wire and plug the jumper wire pin to pin GND on the POWER side of the Arduino
  • Connect the other switch wire to another jumper wire, and plug that jumper wire into pin 2 of the Arduino.

CODE

const int switchPin = 2;
const int ledPin = 13;

void setup() {

pinMode(switchPin, INPUT);

pinMode(ledPin, OUTPUT);

digitalWrite(switchPin, HIGH);

}

void loop() {

if(digitalRead(switchPin) == LOW){

digitalWrite(ledPin, LOW);

}

else{

digitalWrite(ledPin, HIGH);

}

}

WORKING

In this project we are making a magnetic door Sensor in which we connect a magnetic door sensor to the door, to log basically if anyone came into the room when nobody’s there or if we entered the room from outside, it will some play some cool welcoming sound and it will blink.

Upload the code and move a magnet away and closer to the sensor and watch how the LED reacts!