This DIY Electronic Device Will Protect Your Home

by Pro Maker_101 in Circuits > Electronics

974 Views, 5 Favorites, 0 Comments

This DIY Electronic Device Will Protect Your Home

Untitled design 9.PNG

In this project, I will show you how to build a DIY electronic security device using a DFPlayer Mini MP3 module and a reed switch. This simple circuit can be fixed on any door, and when the door is opened, it will instantly play a warning voice or alarm sound from the DFPlayer Mini.

It’s a low-cost, easy-to-build, and very effective anti-theft solution for homes, shops, and cupboards. With just a few common electronic parts and a 9V battery, you can protect your belongings and add an extra layer of security.

To make it professional and durable, I designed a custom PCB (ordered from PCBWay) and enclosed it in a 3mm acrylic case. The project is compact, portable, and completely customizable — you can even replace the sound file with your own voice or music!

Supplies


  1. DFPlayer Mini – MP3 voice module
  2. Reed Switch – Magnetic door sensor
  3. AMS1117 (5V) – Voltage regulator
  4. 9V Battery – Power supply
  5. BC547 Transistor – Switching transistor
  6. IN5822 Diode – Reverse polarity protection
  7. 100µF Capacitor – Power stabilization
  8. On/Off Switch – To control power
  9. Speaker – For voice/alarm output
  10. Jumper Wires – For circuit connections

Get the PCB

Screenshot 2025-08-19 at 1.24.51 PM.png
IMG_8997.PNG
IMG_8998.PNG

For this project, I designed a custom PCB to make the circuit neater, stronger, and reliable for real-world use. Instead of messy jumper wires, using a PCB ensures better durability and a professional finish.


Why I Chose PCBWay?

  1. High-precision manufacturing
  2. Fast delivery with worldwide shipping
  3. Low cost (great for students, makers, and pros)
  4. PCB Assembly service available
  5. Excellent support and instant online quoting

🧾 Simple Ordering Steps:

  1. Design your PCB in software (like KiCad, EasyEDA, or Eagle)
  2. Export your Gerber files
  3. Go to PCBWay.com
  4. Upload your Gerber files
  5. Get an instant quote and place your order

🚀 With PCBWay, your DIY project becomes more professional and reliable!

👉 Order your PCB now at PCBWay.com


📂 (Circuit Diagram and Gerber Files are attached below for easy ordering.)

Insert All Components on the PCB

IMG_8999.PNG
IMG_9001.PNG
IMG_9002.PNG
IMG_9004.PNG
IMG_9005.PNG
IMG_9007.PNG
IMG_9008.PNG

After receiving your PCB from PCBWay, start inserting the components into their respective positions as marked on the PCB.

🔧 Tips for Assembly:

  1. Begin with small parts first, then move to larger ones.
  2. Follow the silkscreen labels to avoid mistakes.
  3. Double-check polarity for parts like capacitors, diodes, and regulator.
  4. Once all components are placed, solder them securely.

Mount the DFPlayer Mini

IMG_9009.PNG
IMG_9010.PNG
IMG_9011.PNG

The DFPlayer Mini is the core of this project — it plays the alarm or voice files when triggered. To use it properly, make sure it is inserted in the correct orientation on the PCB.


📌 DFPlayer Mini Pinout (commonly used pins):


  1. VCC → +5V power
  2. GND → Ground
  3. TX/RX → Serial communication (if using Arduino)
  4. SPK_1 & SPK_2 → Speaker connection
  5. DAC_R & DAC_L → Audio out (for amplifier)
  6. IO1 & IO2 → Standalone trigger pins

👉 For this project, we use SPK_1 & SPK_2 to directly connect the speaker.

Soldering & Finishing the PCB

IMG_9021.PNG
IMG_9012.PNG
IMG_9013.PNG
IMG_9015.PNG
IMG_9016.PNG
IMG_9017.PNG
IMG_9018.PNG

After placing all the components correctly on the PCB:

  1. Solder Joints – Heat each pad and apply solder so it flows smoothly and makes a shiny joint.
  2. Cut Excess Leads – Trim the extra legs of components using a cutter. This keeps the PCB flat and neat.
  3. Clean the PCB – Use a PCB cleaning liquid (IPA – isopropyl alcohol) or flux remover with a small brush/cotton to clean off any flux residue. This prevents corrosion and ensures a professional finish.

⚡ A clean PCB not only looks good but also improves long-term reliability.

Add 9V Battery Connector

IMG_9023.PNG
IMG_9024.PNG


  1. Cut two short pieces of thick copper wire.
  2. Insert them into the marked battery input holes on the PCB (+ and –).
  3. Solder them firmly from the backside.
  4. Bend them slightly so the 9V battery clips on tightly.

Enclosure With Acrylic Sheet

IMG_9027.PNG
IMG_9028.PNG
IMG_9029.PNG
IMG_9031.PNG
IMG_9034.PNG


  1. Place the PCB on the acrylic sheet and mark its outline.
  2. Cut the acrylic sheet to the exact PCB size (use a cutter, hacksaw, or laser cutting if available).
  3. Make 4 pieces – one for the bottom, one for the top, and strips for the sides.
  4. Apply super glue/Fevikwik around the edges and fix the acrylic pieces together.
  5. Ensure all sides are sealed properly so the PCB stays secure inside.


✨ The acrylic cover not only protects the circuit from dust and damage but also gives it a professional and transparent look.

Make Holes in Acrylic for Connections

IMG_9037.PNG
IMG_9039.PNG
IMG_9040.PNG


  1. Mark the positions on the acrylic sheet where the speaker wires, power wires, and switch will come out.
  2. Use a 3mm–5mm drill bit (or a soldering iron tip carefully, if no drill is available) to make neat holes.
  3. Pass the speaker wires, 9V battery wires, and On/Off switch leads through these holes.
  4. After inserting the wires, fix the top acrylic sheet with glue.

⚡ This ensures your project is enclosed safely, while still allowing easy access to connections.

Prepare the Memory Card

IMG_9041.PNG
IMG_9042.PNG
IMG_9043.PNG
IMG_9046.PNG
IMG_9048.PNG
IMG_9054.PNG


  1. Insert the microSD card into a card reader and plug it into your PC.
  2. Format the card as FAT32 (quick format is fine).
  3. Choose any song, music, or alarm sound you want to play.
  4. Rename the file to 001.mp3 (the DFPlayer plays files in order).
  5. Copy and paste the file into the root directory of the memory card (not inside any folder).
  6. Safely eject the card and insert it into the DFPlayer Mini slot.
  7. Connect speaker +ve & -ve


⚡ Now, when the reed switch triggers, the DFPlayer will play your custom sound. You can change it anytime by replacing the file.

Power Up With 9V Battery

IMG_9055.PNG
IMG_9057.PNG
IMG_9058.PNG
IMG_9062.PNG


  1. Connect a 9V battery to the copper wire terminals (or connector) provided on the PCB.
  2. Use a good quality 9V rechargeable or branded battery – cheap ones get weak very quickly and won’t give proper backup.
  3. Turn the On/Off switch ON to power the circuit.
  4. The DFPlayer Mini will now be ready to play the audio whenever the reed switch is triggered.


⚡ Using a strong battery ensures longer backup and reliable performance for your alarm device.

Installation & Testing

IMG_9063.PNG
IMG_9064.PNG
IMG_9065.PNG
IMG_9067.PNG


🔧 Installation:


  1. Fix the PCB (inside acrylic case) on the door frame using screws.
  2. On the opposite side of the door, fix a small magnet aligned with the reed switch.
  3. When the door is closed, the reed switch stays OFF.
  4. When the door is opened, the reed switch activates and the DFPlayer Mini plays the alarm sound stored on the memory card.


🎥 Demo:

Switch ON the power and open the door to test — you’ll hear your custom voice or alarm sound (001.mp3) play instantly.


This DIY Electronic Device Will Protect Your Home