Skip to main content

Magnetic Door Alarm System

A simple security device

info

Author: Băluțoiu Ana-Maria
GitHub Project Link: https://github.com/UPB-FILS-MA/project-arshiii16

Description

The magnetic door alarm is a simple security device that alerts you when a door is opened. It works by using a Hall Effect sensor to detect the presence of a magnet (usually attached to the door) and triggers an alarm (such as a buzzer) when the magnetic field changes (i.e., when the door opens). The alarm serves as a warning or deterrent against unauthorized access.

Motivation

I chose this project because it is straightforward and doesn’t require complex components or intricate circuitry. The Hall Effect sensor, 555 timer IC, and a few other basic components are affordable and readily available. Also, I think everybody wants to know when someone opens the doors around the house, whether it’s for security reasons or just to keep track of household activity. This alarm serves that purpose efficiently. Finally, it’s a great way to learn about basic electronics, sensors, and timers.

Architecture

Architecture Here’s a description of the system components and their interactions:

  1. Hall Effect Sensor: The Hall Effect sensor is the input component that detects changes in magnetic fields. When a magnet (such as the door magnet) approaches or moves away from the sensor, it generates a signal. The sensor’s output is a digital signal (high or low) indicating whether the door is open or closed.
  2. Raspberry Pi Pico (Microcontroller): The Raspberry Pi Pico serves as the central processing unit (CPU) for the system. It reads the output from the Hall Effect sensor. Based on the sensor input, the Pico decides whether to trigger the alarm or keep it silent. The Pico can also control other components, such as the buzzer and LED.
  3. Alarm Logic: The Pico runs a simple program (written in Rust) that monitors the Hall Effect sensor. If the sensor detects the door opening (magnet moving away), the Pico activates the alarm. If the sensor detects the door closing (magnet approaching), the Pico deactivates the alarm. The alarm logic ensures that the system responds appropriately to door movements.
  4. Buzzer and LED: The buzzer and LED are output components. When the alarm is triggered (door opens), the Pico activates the buzzer to produce an audible sound. Simultaneously, the LED lights up to provide a visual indication of the alarm state. When the door closes, the Pico turns off the buzzer and LED. Connections: The Hall Effect sensor connects to a GPIO pin on the Pico. The buzzer and LED connect to other GPIO pins. The Pico’s Rust program reads the sensor input, controls the buzzer and LED, and manages the alarm state.

Log

Week 6 - 12 May

Hardware Design: I selected necessary components, including the Hall Effect sensor, a 555 timer IC, a buzzer, resistors, two LEDs, a capacitor, a transistor. Circuit Design: Created a circuit diagram connecting the components.

Week 7 - 19 May

Software Setup: Opened KiCad and created a new project. Component Placement: Added components from the hardware design to the schematic and connected them according to the circuit diagram.

Week 20 - 26 May

Hardware

The magnetic door alarm project uses the following hardware components:

  1. Hall Effect Sensor (3144): Detects the presence of a magnet (door open).
  2. 555 Timer IC: Generates an adjustable alarm tone.
  3. Buzzer: Produces the alarm sound.
  4. LED: Provides visual indication.
  5. Transistor (BC547): Controls the 555 timer.
  6. Magnet: Attached to the door frame.
  7. Reed Switch: Mounted on the door itself.
  8. Raspberry Pi: It will serve as the brain of this project, allowing the user to control the alarm system, read sensor data, and execute the alarm logic. These components work together to create a simple yet effective door alarm system.

Schematics

This is the Kicad Schematic: KiCad Schematics Here are some photos of the hardware: Hardware1 Hardware2

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico WThe microcontroller35 RON
LED 5 mmProvides visual indication.0.39 RON
Hall Effect Sensor (3144)Detects the presence of a magnet(door open).3.21 RON
555 Timer ICGenerates an adjustable alarm tone.2.41 RON
BuzzerProduces the alarm sound.3.33 RON
Transistor (BC547)Controls the 555 timer.1.68 RON
Reed SwitchMounted on the door itself.1.49 RON
10uF Capacitor (C1)Connected to pin 2 of the 555 timer.4.41 RON
50k Potentiometer (RV1)Adjusts the alarm frequency.1.49 RON

Software

LibraryDescriptionUsage
rppalRaspberry Pi Peripheral Access LibraryProvides an interface for accessing various Raspberry Pi peripherals
panic-haltpanic handler that halts the programUsed to handle panics gracefully
  1. Idea
  2. Step by step help
  3. Visual representation