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
- PD0 Key switch N.O
- PD1 Key switch N.C
- PD2 Alarm trigger N.C
- PD3 Buzzer override
- PD4 Trigger mode 1
- PD5 Trigger mode 2
- PD6 Tamper N.C
Outputs
- PB0 Alarm LED
- PB1 Green LED
- PB2 Red LED
- PB3 Buzzer in Rack box status panel
- PB4 Siren
- PB5 Lights out to Light control unit
- PB6 Away mode relay
- PB7 Life-signal (to Module stability monitoring unit 2)
D-Sub 9 pin
Connector 1
- 5V
- 0V
- In 1 (Key switch N.O)
- In 2 (Key switch N.C)
- In 3 (Alarm trigger N.C)
- In 4 (Buzzer trigger)
- In 5 (Trigger mode 1)
- In 6 (Trigger mode 2)
- +12V Status LED
Connector 2
- In 7 (Tamper N.C)
- Out 1 (Alarm LED)
- Out 2 (Green LED)
- Out 3 (Red LED)
- Out 4 (Buzzer in Rack box status panel)
- Out 5 (Siren)
- Out 6 (Lights out to Light control unit)
- Out 7 (Away mode relay)
- Out 8 (Life-signal)
Source code
- Bascom-AVR source is available in a git repository:
- https://github.com/thomasjsn/AVR-Intruder-alarm
Photos
Schematic drawing
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
- Parallel port I/O module
- Power supply and fuse monitoring module, AVR
- Monitored fuse box, 6 channels
- Stack lights and horn controller — with AVR
- Mute and light controller for the Rack box — AVR module
- Monitored fuse box, 4 channels
- Module heartbeat monitor, 6 inputs — AVR
- Controller for lights and relays — AVR driven
- Emergency power off controller — controlled by 555 timers
- Fan controller with LCD — AVR powered
- Sound alarm control unit — AVR module
- Multiplexer output extender
- Multi-purpose AVR module
- Electric heater and timer controller — AVR
- Module heartbeat monitor, 15 inputs — LCD and AVR
- Serial port I/O module with 11 inputs — AVR
- Serial port I/O module with 9 in and outputs — AVR
- Serial interface for emergency power off — AVR
- Status panel for the Rack box project
- Intruder alarm system controller — AVR
- Serial port I/O module with 15 inputs — AVR
- Serial interface module, with analog and digital I/O — AVR
- The rack box project — an overview