This post is part of the Rack Box Project series.

A simple intruder alarm controller I build and used in my old apartment. Uses an AVR ATtiny2313 microcontroller.

Table of contents

Details

I build this intruder alarm controller for my old apartment. It had two modes; away and armed. It was activated either with a key switch, or using the Security keypad with programmable PIN module.

When the key switch was turned, a green and red LED started to toggle back and forth. If the key was turned back on green, the away mode would activate, if on red then the system would arm. The key switch and LEDs was mounted in status panel that I had in the apartment.

Modes

Mode 1, away

This mode had no alarm function. It just turned off the apartment lights, put the system in mute (no audible system failure alarms) and turned off the status panel that I used to control everything in the apartment.

The intruder alarm controller just activated inputs on other controlling modules (like Light control unit and Multi-purpose module 1), that would, in turn, actually turn off and mute alarms and lights.

If it was dark in the apartment then the light turned on automatically if there was movement in the hallway.

Mode 2, armed

When activated; the system counted down 60 seconds for me to leave the area. During this countdown the alarm and the green LED was flashing and a buzzer gave short bursts.

The alarm would not arm if either the alarm or tamper input was triggered after counting down. If the tamper input was triggered curing the countdown, the buzzer switched to long bursts.

When the countdown was complete the alarm armed, the status panel turns off, system was muted (well, not the alarm siren) and the apartment lights was turned off (via. Light control unit).

When the alarm was tripped I had 30 seconds to deactivate, or the siren would sound. The alarm and red LED flashed quickly, and the buzzer gave long signal bursts. If the tamper circuit was broken, the siren sounded instantly.

If it was dark in the apartment, the light will turn on (via. Light control unit). The alarm LED would stay lit if the alarm had been tripped, until the system was armed again.

I/O

Inputs

  1. PD0 Key switch N.O
  2. PD1 Key switch N.C
  3. PD2 Alarm trigger N.C
  4. PD3 Buzzer override
  5. PD4 Trigger mode 1
  6. PD5 Trigger mode 2
  7. PD6 Tamper N.C

Outputs

  1. PB0 Alarm LED
  2. PB1 Green LED
  3. PB2 Red LED
  4. PB3 Buzzer in Rack box status panel
  5. PB4 Siren
  6. PB5 Lights out to Light control unit
  7. PB6 Away mode relay
  8. PB7 Life-signal (to Module stability monitoring unit 2)

D-Sub 9 pin

Connector 1

  1. 5V
  2. 0V
  3. In 1 (Key switch N.O)
  4. In 2 (Key switch N.C)
  5. In 3 (Alarm trigger N.C)
  6. In 4 (Buzzer trigger)
  7. In 5 (Trigger mode 1)
  8. In 6 (Trigger mode 2)
  9. +12V Status LED

Connector 2

  1. In 7 (Tamper N.C)
  2. Out 1 (Alarm LED)
  3. Out 2 (Green LED)
  4. Out 3 (Red LED)
  5. Out 4 (Buzzer in Rack box status panel)
  6. Out 5 (Siren)
  7. Out 6 (Lights out to Light control unit)
  8. Out 7 (Away mode relay)
  9. Out 8 (Life-signal)

Source code

Photos

Completed circuit board, without the AVR microcontroller
Mounted D-sub connectors in plastic enclosure
Mounted D-sub connectors in plastic enclosure
Front of the module during assembly
Circuit board fitted inside the enclosure
AVR microcontroller installed, circuit board wired up
Key switch on status panel
Yellow and red xenon strobes
Module installed in the rack box
Motion sensor
Porch door sensor
Inside the module
AVR microcontroller on circuit board
Inside the module

Schematic drawing

Schematics for the intruder alarm controller

Parts list

  • 1 × AVR ATtiny2313-20PU, DIL-20, 20 MHz, 18 I/Os
  • 1 × Capacitor, aluminium electrolytic, 10 µF, 25V
  • 1 × Capacitor, ceramic, 1 nF, 100V
  • 1 × D-sub soldering cups, 9 pin female
  • 2 × D-sub soldering cups, 9 pin male
  • 1 × DIL socket, 20-pin, 7.62mm
  • 1 × Enclosure, plastic (1591 FL), 120x65x40mm, flange
  • 1 × Fuse 5x20 mm, 400 mA, fast-acting
  • 1 × Fuse holder, open, PCB, 5x20mm
  • 1 × Fuse holder, open, PCB, Protective cover
  • 1 × LED 5mm coloured clear, Green, 2.1V, 20mA, 30mcd, 10°
  • 2 × LED 5mm, Red/Green, 2.0 2.1V, 10mA, 100 63mcd, 30°
  • 3 × LED holder 5mm, Black plastic
  • 1 × LED lamp 5mm, Red, Ø8.0mm, 12V, 20mA, 15mcd
  • 32 cm2 PCB, stripboard, 100x160mm, 160cm2
  • 10 × Resistor, carbon film, 0.25W, 330 Ω, 5%
  • 9 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
  • 7 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
  • 2 × Spacer, round unthreaded, 3mm, Ø6mm, Delrin
  • 21 × Straight pin header, female, Single row, 2.54mm
  • 23 × Straight pin header, male, Single row, 2.54mm
  • 8 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B

Last commit 2023-02-05, with message: Add series for the rack box project.

Rack Box Project series
All posts in Rack Box Project series
  1. Parallel port I/O module
  2. Power supply and fuse monitoring module, AVR
  3. Monitored fuse box, 6 channels
  4. Stack lights and horn controller — with AVR
  5. Mute and light controller for the Rack box — AVR module
  6. Monitored fuse box, 4 channels
  7. Module heartbeat monitor, 6 inputs — AVR
  8. Controller for lights and relays — AVR driven
  9. Emergency power off controller — controlled by 555 timers
  10. Fan controller with LCD — AVR powered
  11. Sound alarm control unit — AVR module
  12. Multiplexer output extender
  13. Multi-purpose AVR module
  14. Electric heater and timer controller — AVR
  15. Module heartbeat monitor, 15 inputs — LCD and AVR
  16. Serial port I/O module with 11 inputs — AVR
  17. Serial port I/O module with 9 in and outputs — AVR
  18. Serial interface for emergency power off — AVR
  19. Status panel for the Rack box project
  20. Intruder alarm system controller — AVR
  21. Serial port I/O module with 15 inputs — AVR
  22. Serial interface module, with analog and digital I/O — AVR
  23. The rack box project — an overview