Security keypad with programmable PIN

From StdOut
This page is kept for historical interest. It may document projects or methods that are obsolete and/or no longer relevant. The information here is not kept up-to-date.

This module was part of the rack box project — which was terminated when I moved out of my first apartment.
Security keypad with programmable PIN

UPA is a user panel for Alarm unit, where the user can enter his/her PIN and activate mode 1 (away mode) or 2 (intruder alarm). The module is monitored by Module stability monitoring unit 2 and a tamper circuit, this will give instant alarm if disconnected. It's not possible to activate mode 2 (intruder alarm) if UPA is disconnected. The PIN is stored in EEPROM and saved trough a power loss.

Video

Modes

Mode 1

To activate mode 1 enter PIN + *, a one second green light indicates approved PIN and confirms command.

Mode 2

To activate mode 2 enter PIN + #, a two seconds green light indicates approved PIN and confirms command.

Change PIN

To change PIN enter current PIN + 0, yellow light indicates programming mode. The new PIN is entered and confirmed with #, green light. Any other button will reject the new code and keep the old one, red light indicates this.

When entering wrong PIN

When the wrong PIN is entered you get a red light. If the wrong PIN is entered three times the panel will not be usable for one minute. The red light will flash during this period.

I/O

Inputs

  1. PD2 Keypad 1
  2. PD3 Keypad 2
  3. PD4 Keypad 3
  4. PD5 Keypad 4

Outputs

  1. PB0 Keypad 1
  2. PB1 Keypad 2
  3. PB2 Keypad 3
  4. PB3 Channel 1
  5. PB4 Channel 2
  6. PB5 Green LED
  7. PB6 Red LED
  8. PB7 Lifesignal (to Module stability monitoring unit 2)

D-Sub 9-pin

Pin Color Function
1. Pink 5V
2. Grey 0V
3. Yellow Channel 1
4. Black Channel 2
5. Green Tamper N.C
6. Blue Lifesignal (to Module stability monitoring unit 2)
7. Red Alarm LED from Alarm unit
8. Purple Green LED from Alarm unit
9. Brown Red LED from Alarm unit

Keypad

Keypad internal connection and dimensions
  1. n/a
  2. K3
  3. K2
  4. K1
  5. R1
  6. R2
  7. R3
  8. R4

Source code

Git-alt-brands.svg
Bascom-AVR source is available in a git repository:
https://github.com/thomasjsn/AVR-Programmable-keypad

Gallery

Schematic drawing

Security-keypad-circuit-149v9g.png

Parts list

Qty. Part
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 m Control cable, 10-cores, 0.14mm2, 250 V, Ø 5.4mm
1 × 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, wire, 5x20 / 6.3x32mm
1 × Keypad, 12 buttons, 4x3, AK-804
1 × LED 5mm clear, Red, 2.0V, 20mA, 140mcd, 6°
3 × LED 5mm, Red/Green, 2.0 2.1V, 10mA, 100 63mcd, 30°
3 × LED holder 5mm, Black plastic
1 × LED holder 5mm, Chrome-plated plastic, reflector
32 cm2 PCB, stripboard, 100x160mm, 160cm2
8 × Resistor, carbon film, 0.25W, 330 Ω, 5%
4 × Resistor, carbon film, 0.25W, 4.7 kΩ, 5%
4 × Resistor, carbon film, 0.25W, 10 kΩ, 5%
1 × Resistor, metal film, 0.6W, 200 Ω, 1%
1 × Spacer, round unthreaded, 3mm, Ø6mm, Delrin
16 × Straight pin header, female, Single row, 2.54mm
16 × Straight pin header, male, Single row, 2.54mm
3 × Transistor, NPN, 100 mA, 45V, 0.5W, BC547B