Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to design a security system that sounds like a guard dog

By Ayush Jain March 3, 2024

It’s been said that one of the best home security systems is owning a dog. In this do-it-yourself (DIY) circuit, we’ll design a unique system that lets you take advantage of a guard dog for security without ever needing to walk or feed it.
This DIY system “barks” like a dog whenever motion is detected near your front door, employing a radar sensor and an audio amplifier.

All that’s needed is a small gadget, which uses a special sensor to detect motion outside your door. Whenever it senses movement, it plays a loud barking sound as if there’s a dog inside. It works like a home security alarm, but requires no wires or costly, high-tech monitoring devices. Plus, this “guard dog” is easy to set up.

Let’s design the prototype.

Prototype image

Components

  1. A microcontroller (preferably Arduino UNO)
  2. RCWL-0516 RADAR motion sensor
  3. Micro SD card reader module
  4. TPA3118 PBTL Audio amplifier circuit
  5. A 5-10W speaker driver
  6. A 9v power supply/rechargeable batteries
  7. Male-female jumper wires

Working principle
The primary goal of this project is to create a cost-effective and easy-to-use home security system. Instead of relying solely on conventional alarms or surveillance systems, the sound of a dog barking can create a more organic deterrent against potential intruders.

The main design components are a radar sensor and an audio amplifier. The working principle entails the following:

  • Motion detection. The RADAR sensor notices motion and is extremely sensitive. When something moves in its range of five to eight meters, it sends a signal.
  • Barking sound. We’ll attain the sound of a dog barking online, and save it on a memory card (Micro SD card). Whenever the RADAR senses motion, it signals Arduino, which then plays the stored barking sound from the SD card.
  • Increasing the volume. Typically, Arduino’s sound is not very loud — or, at least, not loud enough to serve as a deterrent. So, we’ll need to incorporate an audio amplifier, which connects to a speaker for ample volume.

Block diagram of the circuit.

Programming Arduino
Before beginning this project, ensure you have the necessary libraries installed, including SD, SPI, and TMRpcm. The code is short and simple. 

In the setup() function, we chose Pin 9 as the speaker output. Wait for the SD card to be detected with SD.begin() before setting the volume to 5 (this worked well for our audio amplifier). After a one-minute delay, the loop function begins, allowing time to get out of the sensor’s range.

In the loop() function, check if Pin 5 is receiving input (where the RADAR sensor connects). If there’s a signal, the TMRpcm library will play the audio file (bark.wav) from the SD card once. Afterward, there’s a vie-second delay to avoid continuous playback with every motion.

Preparing the audio file
Before Arduino can use the audio file, it requires processing as follows.

  1. Download the sound of a dog barking as an MP3.
  2. Used a tool to convert it to WAV.
  3. Make a few changes to the audio:
    • Bit resolution: 8
    • Audio frequency: 16000
    • Audio channels: Mono
    • PCM format: U8
  4. Save the file as ‘bark.wav.’ It’s a good idea to keep the file names short (within four characters). Some SD card readers do not work well with longer names.

Formatting the SD card
To use an SD card with the Arduino, it must be formatted to ‘FAT.’ To do so, we used the Resizer-free tool. It can be installed by running setup.exe.

Open the software, pick your drive, and click ‘format.’ Next, copy the ‘bark.wav’ audio file onto the SD card. You can use any tool to do so, but make sure to format the SD card to FAT.

Making the circuit connections

Circuit connections

Upload the code to Arduino UNO board before connecting the circuit. The steps are the same regardless of the microcontroller.

Refer to the image above for the correct Arduino GPIO pins. The circuit might appear complicated initially, but it’s easier to understand if you break it down into one part at a time. 

Connecting the SD card reader
Start by putting the Micro SD card into the card reader. Then, connect it to Arduino as follows:

  • CS to pin 10
  • SCK to pin 13
  • MOSI to pin 11
  • MISO to pin 12
  • VCC to the 5V pin
  • GND to the GND pin

This links the card reader to Arduino.

Micro SD card connections

Connecting the radar sensor

  • Connect VIN to Arduino’s 3.3V pin (Note: The circuit diagram might show 5V, but this is an error).
  • Connect OUT to Arduino’s pin 5.
  • Connect GND to Arduino’s GND pin.

This ensures the proper connections for the set-up.

RADAR sensor connections

Connecting the audio amplifier

  • Connect the audio input pins to pin 9 and GND on Arduino.
  • Power + and must be directly connected to the 9V power supply.
  • The audio output pins are linked to the 6W speaker.
  • These connections are standard for all audio amplifiers. If you have a stereo amplifier, you can use one channel and leave the others empty.

Audio amplifier connections

The power supply
For a portable, easy-to-move device, consider using rechargeable Li-ion batteries. Make sure to use a proper charging module for safe charging. Also, add a switch for turning it ON/OFF.

You’ll note for this prototype, we used a 9V power supply directly. It’s not ideal because an extra wire for the door was required, but it still worked.

The assembly
Use a cardboard box for the prototype housing, as it’s just a concept test. For the final version, you can design a 3D-printed case. We placed all the components inside except for the RADAR sensor and speaker. The RADAR sensor is attached to the back using double-sided foam tape with tiny holes for its pins. Avoid placing it inside to avoid adding thickness to the door.

Next, cut a hole in the front for the speaker, which must be secured with screws and extra layers of cardboard for strength. We added a black paper dog for fun!

The last step is attaching it to your front door using foam tape. Ensure the RADAR sensor sits flush against the door without gaps.

Assembled prototype

Final test and conclusion
This innovative project showcases how a combination of readily available components and creative thinking can enhance home security. By leveraging the power of technology — a simple RADAR sensor and an audio amplifier — it’s possible to create a convincing scenario… you own a guard dog!

An advanced project could integrate the Internet-of-things for remote control and smartphone notifications. For now, embrace the simplicity and effectiveness of a barking guardian at your doorstep.

https://www.engineersgarage.com/wp-content/uploads/2024/02/video-1.mp4

 

 

You may also like:


  • How to build a facial recognition system using ESP32-CAM

  • How to build an app-controlled alarm mat

  • How to design an IoT-based smart alarm

  • How to design a smartphone-operated door lock

  • How to build a WhatsApp-notifying home security system

Filed Under: Circuit Design, Video
Tagged With: Arduino, motiondetection, radar, securitysystem, sensor, video
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Right Half Plane Zero
  • dc-dc converter in series
  • Single ended measuring ports and balanced antenna
  • Thermal modelling of repetitive power pulse
  • Permittivity and Permealibility in CST

RSS Electro-Tech-Online.com Discussions

  • Fun with AI and swordfish basic
  • Microinverters and storeage batteries?
  • FFC connector white
  • Is AI making embedded software developers more productive?
  • Can I make two inputs from one??

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe