Introduction: Arduino Door Alarm With Keypad
In this project we gonna make a door alarm in the second part I added a keypad to disable the alarm.
Step 1: Watch My Video
Step 2: Parts You Need
- Buzzer
- Reed switch
- Magnet
- Arduino
Optional:
- Keypad
Step 3: First Code (without Keypad)
This code is just a modified version of the button example sketch:
const int buttonPin = 2; // the number of the reedswitch
const int ledPin = 13; // the number of the buzzer
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
delay(5000);
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH); }
}
Step 4: Second Code
Step 5: Subscribe
If you want to view more off my projects you can subscribe to my YouTube channel! Just click on this link: http://bit.ly/1WIMuNx
2 Comments
5 years ago
Hi. Could you post a scheme? Thank you!
5 years ago
how you make the reed switch stick to the other?