Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
The Importance and Utility of Door Alarm Systems
Door alarm systems are essential for maintaining security and safety in various settings, such as homes, offices, and commercial buildings. These systems provide an effective way to monitor and protect entry points, alerting individuals to any unauthorized access or potential threats. By implementing a door alarm system, you can enhance the overall security of your premises and have peace of mind knowing that your property is well-protected.
Project: Creating a Door Alarm System
In this project, we will create a simple yet effective door alarm system using an Arduino board and a few components. The main objective of this project is to detect the opening and closing of a door and trigger an alarm whenever unauthorized access is detected. The system will be able to monitor the status of the door in real-time and provide immediate alerts when necessary.
List of Components:
Note: You can purchase these components from various online platforms or local electronics stores.
Examples:
Example 1: Door Status Monitoring
const int reedSwitchPin = 2;
const int buzzerPin = 3;
const int ledPin = 4;
void setup() {
pinMode(reedSwitchPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int doorStatus = digitalRead(reedSwitchPin);
if (doorStatus == HIGH) {
digitalWrite(buzzerPin, HIGH);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(buzzerPin, LOW);
digitalWrite(ledPin, LOW);
delay(500);
}
}
Explanation:
Example 2: Adding Delayed Alarm Activation
const int reedSwitchPin = 2;
const int buzzerPin = 3;
const int ledPin = 4;
void setup() {
pinMode(reedSwitchPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int doorStatus = digitalRead(reedSwitchPin);
if (doorStatus == HIGH) {
delay(5000); // Delay for 5 seconds before activating the alarm
int newDoorStatus = digitalRead(reedSwitchPin);
if (newDoorStatus == HIGH) {
digitalWrite(buzzerPin, HIGH);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(buzzerPin, LOW);
digitalWrite(ledPin, LOW);
delay(500);
}
}
}
Explanation: