Skip to content
Free Delivery on Orders Above Rs 999/- Pan-India
Cash on Delivery Available for Orders above Rs.500/- and Upto Rs 3000/-
SAVE more when you BUY more. Upto 30% Off on BULK PURCHASE
GST Invoices for Your Business
Dedicated Technical Support Team
Safely Delivering Genuine Products PAN INDIA

DIY Home Security System Using Arduino: Parts and Code

DIY Home Security System Using Arduino: Parts and Code
-
Written By - Robocraze -
📅 Updated on 24 Aug 2026
Summarize with AI
✅ Prompt copied

Summary

Home security systems are no longer limited to expensive commercial solutions. With a few readily available electronic components and an Arduino board, you can build a reliable system capable of detecting unauthorized entry, triggering alarms, and monitoring your home environment.

This project is an excellent introduction to embedded systems because it combines sensors, actuators, and programming into a practical real-world application. Along the way, you'll learn how different sensors work together, how to process input from multiple devices, and how to automate responses using a microcontroller.

In this guide, we'll build a DIY home security system Arduino project using simple, beginner-friendly components that can later be expanded into a complete smart home security solution.

I Built a Home Security System Using Just These Components - Cover Image

What You Need

Before starting, gather the following components:

  • Arduino Uno
  • PIR Motion Sensor
  • Magnetic Reed Door Sensor
  • Active Buzzer
  • LEDs (Red and Green)
  • 220Ω Resistors
  • Breadboard
  • Jumper Wires
  • USB Cable
  • Optional LCD Display
  • Optional Wi-Fi Module (ESP8266 or ESP32) for remote monitoring

These components provide everything needed to create a basic yet functional home security prototype.

Parts Required

Component Purpose
Arduino Uno Main controller for the security system
PIR Motion Sensor Detects human movement
Magnetic Reed Switch Detects door or window opening
Active Buzzer Sounds the alarm
LEDs Visual status indicators
Breadboard Circuit prototyping
Jumper Wires Electrical connections
USB Cable Programming and power
LCD Display (Optional) Displays system status
ESP8266/ESP32 (Optional) Enables IoT notifications

Components and Supplies

1660 Tie-Point Solderless Breadboard – Large breadboard for circuit prototyping. Electronic Components - Robocraze1660 Tie-Point Solderless Breadboard – Large breadboard for circuit prototyping. Electronic Components - Robocraze

    1660 tie-point Solderless Breadboard

    1660 tie-point Solderless Breadboard The 1660 Points Solderless Breadboard is an excellent size with more than enough room for more advanced prototyping. There are two terminal strips with 1260 tie-points and 4 distribution strips with 400 tie-points.  The breadboards accept a variety of wire sizes from 20 to...
    Rs 411/-
    Rs 411/-
    Rs 699/-
    Save Rs 288/-
    400 Tie Points Solderless Breadboard – Medium-sized breadboard for Arduino & projects. Electronic Components - Robocraze400 Tie Points Solderless Breadboard – Medium-sized breadboard for Arduino & projects. Electronic Components - Robocraze

      400 Tie Points Solderless Breadboard

      400 Tie Points Solderless Breadboard The 400 Tie Point solderless breadboard is perfect for building and testing electronics, especially with Arduino projects. It’s made of strong plastic with metal clips that hold wires securely. With 400 points, you can quickly set up circuits without...
      Rs 35/-
      Rs 35/-
      Rs 69/-
      Save Rs 34/-
      Active Buzzer Module 3.3V-5V – Self-driving buzzer for Arduino & electronics. -Electronic Components - RobocrazeActive Buzzer Module 3.3V-5V – Self-driving buzzer for Arduino & electronics. -Electronic Components - Robocraze

      Active Buzzer Module 3.3V-5V

      Active Buzzer Module 3.3V-5V An Active Buzzer Alarm Module for Arduino is an audio signaling device, which may be mechanical, electromechanical, or piezoelectric. Just like what you are viewing now, it is a 3.3V-5V DC Electronic Part Active Buzzer Module. Using top-quality material, it...
      Rs 27/-
      Rs 27/-
      Rs 40/-
      Save Rs 13/-
      SmartElex LHI778 PIR Motion Sensor Module - robocrazeSmartElex LHI778 PIR Motion Sensor Module - robocraze

        SmartElex LHI778 PIR Motion Sensor Module

        SmartElex LHI778 PIR Motion Sensor Module The SmartElex LHI778 PIR Motion Sensor Module is a passive infrared motion detection solution designed to sense human movement by detecting changes in infrared radiation. It helps solve the problem of automatic motion detection without continuous monitoring, making...
        Rs 212/-
        Rs 212/-
        Rs 279/-
        Save Rs 67/-
        37 in 1 Sensors Kit for Arduino – Ultimate Arduino sensor kit with 37 modules for IoT. -DIY Sensor Kit -Robocraze37 in 1 Sensors Kit for Arduino – Ultimate Arduino sensor kit with 37 modules for IoT. -DIY Sensor Kit -Robocraze

          37 in 1 Sensors Kit Compatible with Arduino for Robotics & IoT Projects

          37 in 1 Sensors Kit Compatible with Arduino The 37 in 1 Sensors Kit Compatible with Arduino is a complete learning kit designed for students, beginners, makers, educators, and robotics enthusiasts who want hands-on experience with electronics, programming, and embedded systems. Featuring 37 commonly...
          Rs 909/-
          Rs 909/-
          Rs 1,499/-
          Save Rs 590/-
          Original Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -RobocrazeOriginal Arduino Uno R3 microcontroller board with ATmega328P and USB port - Arduino Uno Board -Robocraze

            Arduino Uno R3 Original

            Arduino UNO R3 Original The Arduino Uno R3 is a microcontroller board based on the ATmega328P chip and is widely recognized as the best original Arduino Uno board for beginners and projects. This board has 14 digital I/O pins (6 support PWM), 6 analog...
            Rs 2,880/-
            Rs 2,880/-
            Rs 3,499/-
            Save Rs 619/-

            Arduino Board Project

            How the Security System Works

            The system continuously monitors multiple sensors for unusual activity.

            The workflow is simple:

            1. Arduino reads the motion sensor.
            2. It monitors the magnetic door sensor.
            3. If movement or unauthorized entry is detected, the buzzer activates.
            4. LEDs indicate the current system status.
            5. Optional IoT modules can send alerts to a mobile phone or cloud dashboard.

            This modular design makes it easy to add additional sensors as your project grows.


            Why Build This Project?

            Building a DIY home security system Arduino project introduces several important embedded systems concepts.

            You'll learn how to:

            • Interface multiple sensors.
            • Read digital inputs.
            • Control alarms and indicators.
            • Write conditional logic.
            • Combine multiple hardware modules.
            • Build practical automation systems.

            These skills apply to robotics, smart home automation, industrial monitoring, and IoT development.


            Circuit Connections

            PIR Motion Sensor

            PIR Pin Arduino Pin
            VCC 5V
            GND GND
            OUT D2

            Magnetic Reed Switch

            Reed Switch Arduino
            One Terminal D3
            Other Terminal GND

            Enable the Arduino's internal pull-up resistor in software for reliable readings.


            Buzzer

            Buzzer Pin Arduino
            Positive D8
            Negative GND

            Status LEDs

            LED Arduino Pin
            Green LED D6
            Red LED D7

            Use a 220Ω resistor in series with each LED.

            Arduino Board

            Building the System

            Step 1: Assemble the Circuit

            Begin by placing the Arduino on the workbench and connecting the PIR sensor, magnetic reed switch, LEDs, and buzzer according to the wiring tables above.

            Double-check every connection before powering the circuit.


            Step 2: Upload the Arduino Program

            Write or upload the Arduino sketch that:

            • Initializes all sensors.
            • Reads motion detection.
            • Detects door status.
            • Activates LEDs.
            • Sounds the buzzer whenever an intrusion is detected.

            Upload the program through the Arduino IDE.


            Step 3: Test Individual Sensors

            Before combining everything, verify that each sensor works independently.

            • Walk in front of the PIR sensor.
            • Open and close the reed switch.
            • Confirm that LEDs change state.
            • Ensure the buzzer activates correctly.

            Testing components individually makes troubleshooting much easier later.


            Step 4: Integrate the Alarm Logic

            Once each sensor works correctly, combine them into a single program.

            For example:

            • Motion detected → Trigger alarm.
            • Door opens while system is armed → Trigger alarm.
            • No activity → Keep system in monitoring mode.

            At this stage, your DIY home security system Arduino project becomes a complete security prototype capable of responding automatically to different events.

            Step 5: Test the Complete System

            Once all the components are connected and the program has been uploaded, it's time to test the complete security system.

            Run the following tests:

            • Walk in front of the PIR sensor to verify motion detection.
            • Open the monitored door or window to activate the reed switch.
            • Confirm that the buzzer sounds immediately.
            • Check that the status LEDs indicate the correct system state.

            Repeat each test several times to ensure the system responds consistently and there are no false alarms caused by loose wiring or unstable sensor readings.


            Step 6: Install the System

            After successfully testing the prototype on a breadboard, you can move toward a more permanent installation.

            Mount the sensors in suitable locations:

            • Install the PIR sensor facing entry points such as doors or hallways.
            • Position the magnetic reed switch on the door or window frame.
            • Place the Arduino and wiring inside a protective enclosure.
            • Ensure the buzzer is loud enough to be heard throughout the protected area.

            For permanent installations, replacing the breadboard with a perfboard or custom PCB improves durability and minimizes loose electrical connections.


            Step 7: Add Smart Features

            The basic project works as a standalone alarm system, but it can easily be expanded with additional features.

            Some useful upgrades include:

            • ESP32 or ESP8266 for Wi-Fi connectivity
            • GSM module for SMS alerts
            • OLED or LCD display for system status
            • Keypad for arming and disarming
            • RFID authentication
            • Fingerprint sensor
            • Battery backup for uninterrupted operation
            • Mobile app notifications

            These additions transform the project from a basic alarm into a more complete DIY home security system Arduino suitable for smart home applications.

            Troubleshooting Common Issues

            If the project doesn't behave as expected, the following table can help identify common problems.

            Problem Possible Cause Solution
            PIR sensor triggers randomly Incorrect sensitivity settings Adjust the sensitivity and delay potentiometers
            Reed switch not detecting door movement Misaligned magnet Reposition the magnet closer to the switch
            Buzzer remains ON continuously Logic error in code Verify the alarm conditions in the Arduino sketch
            LEDs do not light Incorrect wiring or resistor placement Check polarity and wiring connections
            Arduino keeps restarting Insufficient power supply Use a regulated external power source if multiple modules are connected

            Most issues are caused by wiring mistakes or incorrect sensor placement rather than faulty components.

            Best Practices for a Reliable Security System

            Small improvements can significantly increase the reliability of your project.

            Some recommended practices include:

            • Mount sensors securely to prevent false triggers.
            • Keep wiring organized and protected.
            • Use an external power supply for larger systems.
            • Test the alarm regularly.
            • Label wires to simplify future maintenance.
            • Install the electronics inside a durable enclosure.

            These practices become increasingly important as your projects grow from prototypes into real-world installations.


            Expanding Your Arduino Skills

            Building a security system introduces many concepts that appear in larger IoT and automation projects.

            If you'd like to take this project further, our guide on Smart Security System Using IoT and Sensors explores how cloud connectivity, remote monitoring, and smart notifications can enhance traditional security systems using IoT technologies.

            You can also combine RFID-based authentication with your alarm by exploring our tutorial on Build Your Own Smart Door Lock Using Arduino. Together, these projects demonstrate how Arduino can be used to build integrated access control and home security solutions.


             

            Final Thoughts

            Building a DIY home security system Arduino is an excellent way to apply programming and electronics to a practical, real-world problem. By combining motion detection, door monitoring, visual indicators, and audible alarms, you'll gain experience working with multiple sensors while understanding how embedded systems respond to different events.

            More importantly, this project serves as a foundation for larger smart home and IoT applications. As your skills develop, you can expand this DIY home security system Arduino with wireless communication, cloud monitoring, biometric authentication, and automation features to create a more capable and intelligent security solution.

            Excerpt

            Build a working home security system using Arduino, a PIR sensor and a buzzer. See the exact parts used, wiring steps and code for your own build.
            Prev Post
            Next Post

            Leave a comment

            Please note, comments need to be approved before they are published.

            Thanks for subscribing!

            This email has been registered!

            Shop the look

            Choose Options

            Edit Option
            Back In Stock Notification
            Compare
            Product SKU Description Collection Availability Product Type Other Details

            Choose Options

            this is just a warning
            Login
            Shopping Cart
            0 items
            FREE SHIPPING!
            ₹100 OFF
            ₹200 OFF
            ₹999
            ₹2500
            ₹4900
            WhatsApp Chat Chat