Smart devices using Arduino
The modern world has bestowed us with incredible technological advancements, but it has also brought about new challenges, and security is one of them. Urban areas, in particular, have witnessed a surge in burglary cases, . In this blog post, we'll delve into the creation of a Ultrasonic Burglar Alarm to fortify the security of your home.
Problem:
The primary challenge was the need for a reliable and affordable burglar alarm system. Traditional security systems can be prohibitively expensive and cumbersome to maintain. We set out to design a solution that would not only be effective but also accessible to anyone with a basic understanding of electronics.
Introduction
Our weapon of choice was the HC-SR04 Ultrasonic Sensor. This compact device utilizes ultrasonic waves to measure distance, much like the sonar systems used by ships to gauge ocean depths. By emitting ultrasonic waves and measuring the time it takes for them to bounce back, the sensor can accurately determine the distance to an object.
Technical Specifications:
- Power Supply − +5V DC
- Quiescent Current − <2mA
- Working Current − 15mA
- Effectual Angle − <15°
- Ranging Distance − 2cm – 400 cm/1″ – 13ft
- Resolution − 0.3 cm
- Measuring Angle − 30 degree
Coding:
#define trigPin 13
#define echoPin 12
#define led 11
void setup()
{ Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led, OUTPUT);
}
void loop()
{ long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance < 10)
{ digitalWrite(led,HIGH);
}
else {
digitalWrite(led,LOW);
}
Serial.print(distance);
Serial.println(" cm");
delay(500);
}
The Result:
The end result was a simple, yet highly effective, burglar alarm system. The device was capable of detecting unauthorized entry and triggering the alarm promptly.
Conclusion:
The Ultrasonic Burglar Alarm showcased here is just one example of how accessible solutions can be crafted to address real-world problems.
This project not only enhances the security of our homes but also serves as an invitation to explore the vast possibilities within the realm of electronics.
Youtube link: https://youtu.be/HiwwfMGa-3k
Creator: P.A.Hirushan Niluminda✌
Comments
Post a Comment