How to make Home Security system by using PIR sensor and DF player mini for audio integration

Things used in this project
Hardware components
HARDWARE LIST
1 Arduino UNO
1 Df player mini
1 5 volt audio amplifier
1 Jumper wires (generic)
1 PIR Sensor, 7 m
1 Speaker: 3W, 4 ohms
Story
Ā
In this Project, we will learn, how we can make security alarm by using PIR sensor and DF player Mini. This system detect motion in room and play audio, Security Alert ! some one entered in the room. You can use this as welcome audio player for guests.
Ā
For making this project, I am using:-
Ā
-Arduino UNO
Ā
-DF player Mini
Ā
-Alarm Speaker
Ā
-SD Card
Ā
-PIR sensor (Motion sensor)
Ā
-5 Volt Audio Amplifier
Ā
CODE
#include "DFRobotDFPlayerMini.h"
const int buttonPin = 7;
int buttonState = 0;
DFRobotDFPlayerMini player;
void setup() {
pinMode(buttonPin, INPUT);
// Init USB serial port for debugging
Serial.begin(9600);
// Init serial port for DFPlayer Mini
//softwareSerial.begin(9600);
// Start communication with DFPlayer Mini
if (player.begin(Serial)) {
Serial.println("OK");
// Set volume to maximum (0 to 30).
player.volume(30);
// Play the first MP3 file on the SD card
//player.play(1);
} else {
Serial.println("Connecting to DFPlayer Mini failed!");
}
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
player.play(1);
}
}
The article was first published in hackster, October 2, 2021
cr: https://www.hackster.io/munir03125344286/how-to-make-home-security-system-31953e
author:Ā Muhammad_Munir
License 
All Rights
Reserved

0
More from this category