Title: Prison Door System
1Prison Door System
- Scott Cornelsen
- Scott Bingham
- Justin Kautz
2System Overview
PC
Prison Cell Mockup
Control Box
USB
- Functions
- Door Function Control
- Cell Door Activity Logging
- Pass code Management
- Physical Features
- LCD Display
- 16-button Keypad
- Functions
- Door Function Control
- Sensor Actuator Interface
- Backup Power Supply Switching Electronics
- Sensors
- Lock Current Monitors
- Open/Close Door Sensors
- Door Position Sensors
- System Power Monitors
- Actuators
- Door Motors
- Electromagnetic Locks
- Security Alarm
3Block Diagram
68HC11E0 Micro-Controller
Open/Close Sensors
Door Motors
Door Position Sensors
Magnetic Locks
Lock Current Sensors
Security Alarm
Software
System Current Sensors
LCD Display
Backup Power System
16-Button Keypad
USB Comm.
Prison Cell Mockup
Hardware Diagrams
PC Software
4Prison Cell Mockup
Cell 1
Cell 2
Door Alarm
Cell 3
Cell 4
Position sensor
Closed sensor
Electromagnetic Lock
Open sensor
Lock Current Sensor
12V DC Door Motor
Drive Shaft
12 VDC
5Mid-level Electronics Diagram
Output Latches
Clock Circuit
DC Motors
Motor Drivers
8279
74x138
Micro Controller
Keypad
Mag Locks
Lock Drivers
Power Signals
USB Module
Position Sensors
LCD Display
Pre- Amp
Current Sensors
Open/Close Sensors
Alarm Driver
Alarm
6(No Transcript)
7Open/Close Sensors
Adjustable Contact Point
Micro switch
Cell Door
8Position Sensors
Optical Sensor
LTH-301-07 IR Interrupt Sensor
Cell Door Edge View
Cell Door - Top View
Optical Sensor
9Optical Interrupt Sensor Schematic
220
10Current Sensors
Pre-Conditioning Circuit
ADC Built into Microprocessor
Voltage Reading
Current Path
Shunt Resistor
11Current Sensor Schematic
12Door Motors
Cell Door
Gear Box
12 VDC Motor
Screw Drive
Sliding Nut
13Motor Specifications
Sankyo VM250B
- Powered on the 12V unregulated bus
- Average loaded current is 200mA
- Final gear stage 180 RPMs
14Door Motor Drive Hardware
12 VDC
8279 Display Driver
Output Latches
On/Off Control
Direction Control
DC Motor
15Electromagnetic Locks
Cell Door
Iron bolt with windings of magnet wire
5 VDC
Metal Plate
16Electromagnet Specifications
- Wire gauge 32 AWG
- Number of turns 2270 on a ½ inch core 1- ½
inches long - Supply voltage 5VDC
- Resistance of coil 50O
- Supply current 0.1A
17Magnetic Lock Drive Hardware
8279 Display Driver
Output Latches
5 VDC
On/Off Control
18Lock Driver Schematic
20k
19Security Alarm
12 VDC
8279 Display Driver
Output Latches
On/Off Control
20Alarm Driver Schematic
Alarm
20k
21Power System
Power Supply State Signal
UPS Switch Control
System Power Sensors
ATX Power Supply
12 VDC
120 VAC
12 VDC
To System
5 VDC
12 VDC
Battery
22Power System Schematic
23ATX Power Supply
24Power Budget
25LCD PROPERTIES
2616-Button Keypad
5 6 7 8
ACT 07-30008-00
1 2 3 4
27Keypad Data Sheet
28Display/Keypad
Initialize Display
Pend Keypad Semaphore
ISR Releases this task when keypad is pressed
Idle
Variable Keypress is Recorded in the ISR for this
Task
Check Which Key Pressed
If Key 0 - 9
If Key Up or Down
If Key Enter
If Key Alarm
If Key Clear
Update Display
Change Mode Door,Row,All
Check Security ID
Post Alarm Semaphore
Reset Display
Else
If ID Valid
Reset Display
Reset Display
Post Door Semaphore
29Door
Pend Door1 Semaphore
Keypad/Display or USB Task Release this Task
Idle
Else
Turn Magnet Off
Log Event
Variables DoorStatus and DoorChange will be used
to determine which doors and which direction and
if door is opening or closing
If Keypad Initiated
Motor
Pend Door2 Semaphore
ISR Releases this task when Open/Close Switch is
Triggered
Idle
Timeout 2 Min.
Motor Off
Else
Magnet On
If Door Closed
30Alarm
If Keypad
Pend Alarm Semaphore
Keypad/Display or USB Task Release this Task
Idle
If Keypad Initiated
Else
Log Event
Alarm On/Off
Variable AlarmStatus will be used to determine
whether to turn the alarm on or off
31PC/Current Sensors
Initialize Other Tasks
Idle
Timeout 1 Sec.
Get Current Sensor Data
Check USB for Data
If OPCODE Report
If OPCODE Door
If OPCODE Alarm
Post Alarm Semaphore
Update DoorChange
Send Sensor Data to USB
Post Door Semaphore
32Interrupt Service Routine
Get 8279 FIFO
If 8279 Says Sensor Change
If 8279 Says Key Pressed
Update Sensor Data
Update Keypress Data
Else
If DoorStatus Variable is Changed
Post Door Semaphore
Post Keypad Semaphore
Return from Interrupt
33Initialize LCD
34Initialize 8279
8 8-bit character display -- Left Entry Encoded
Scan Sensor Matrix Mode
DD 00 KKK 100
Read FIFO
35Memory Map
0000
512 bytes RAM
01FF
1000
64 bytes Registers
103F
2000
8279
2001
3000
USBMOD4
3001
4000
LCD
4001
8000
32KBytes EEPROM
Onboard RAM
System Registers
I/O
EEPROM
FFFF
3668hc11 Port Diagram
68HC11E0
A
Timer signal to 8279 clock
B
High order address byte
C
Low order address byte and data lines
D
Input signals from USBMOD4
E
ADC from current sensors
37GUI
38PC Software
Visual Basic GUI, user input
C - manages guard profiles, cell status,
logging evens, USB communication
To MCU
USB DLL
39GUI Events
User initiated events
Timer initiated events
- Open/Close cells
- View cell status
- Add/remove guards
- View event log
- View guard list
- Display random cell status
40Open/Close Door Flow Diagram
Open/Close door
Get user input
Validate guard and row/cell
Display Error message
Do nothing
invalid
valid
Send request To MCU
Display Action message
Poll MCU for sensor status
41View Cell Status Flow Diagram
View cell status
Get cell number
Validate cell
Display Error message
Do nothing
invalid
valid
Display cell Sensor status
42Add Guard
Validate Authorization code
Display error
invalid
valid
See if guard number already exists
Display error
yes
Do nothing
no
Add guard to Linked list
Log event
43Remove Guard
Validate Authorization code
Display error
invalid
valid
See if guard Number exists
Display error
no
Do nothing
yes
Remove guard from linked list
Log event
44View Event Log
View current event log
Get current log filename from cell manager
Valid filename
Open log file
View custom event log
Get custom log file
Display log file in text box
Invalid filename
Do nothing
45View Guard List
View guard list
Get guard data filename from cell manager
Refresh view
Request guard data file be updated
Open data file
Display data file in text box
46Display Random Cell Status
Door display timer
Get next cell to display
Get cell sensor status
Show appropriate door and sensor graphics
47C Classes
Cell
Contains all of the cell information cell and
row numbers, sensor status and position
Guard
Contains all of the guard information guard ID,
security code and first and last name
LinkedList
Two instances of this class are used for the
guard information and the cell information
CellManager
Manages all cell action requests (open/close
door), event logging, guard management
(add/remove), USB communication
48PC MCU Communication
- Message passing will be arrays of bytes, the
number of command arguments depends on the
command code - Commands will be represented by ASCII characters
- Lower case commands come from the cpu, upper case
commands come from the MCU
V
Guard ID
Security code
3 bytes
Command
Argument 1
Argument 2
49PC to MCU Communication
MCU
PC
o, cell number
Open door
K
c, cell number
Close door
K
d, cell number
Door status check
D, status byte
a
Sound alarm
K
p
Power system
P, power cons.
50MCU to PC Communication
PC
MCU
O, cell number, guard ID
Open door
k
C, cell number, guard ID
Close door
k
V, guard ID, security code
Validate guard
v, valid
A
Sound alarm
k
51USBMOD4 DLL Communication Functions
FT_ListDevices returns information about what
devices are currently plugged into the USB ports
FT_Open returns a handle to the device
FT_Close stops communication with the device
FT_Read sends data to the USB device
FT_Write retrieves data from the USB device
52Questions?