Muhammad_Munir
Published © GPL3+

How to make Home Security system

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

IntermediateFull instructions provided1,884
How to make Home Security system

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Df player mini
×1
5 volt audio amplifier
×1
Jumper wires (generic)
Jumper wires (generic)
×1
PIR Sensor, 7 m
PIR Sensor, 7 m
×1
Speaker: 3W, 4 ohms
Speaker: 3W, 4 ohms
×1

Story

Read more

Code

Code

Arduino
#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);
  }
}

Credits

Muhammad_Munir

Muhammad_Munir

77 projects • 48 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.

Comments