Anda di halaman 1dari 8

have an external “wall-wart” power supply.

The system is
DTMF Automated Door System approximated to cost $500 to implement.

Group # 11: David P. Marchetti, Eric White,


Aaron Sanford
II. OVERVIEW OF SYSTEM COMPONENTS
School of Electrical Engineering and Computer A. User Interface
Science, University of Central Florida, Orlando,
Florida, 32816-2450 The user interface will consist of a personal cell phone
or hard-wired analog phone. The user will use the phone
keypad (see figure 1) to call the premises and access the
Abstract — The purpose of this senior project is to design
an automated system that can be used to open a door in the system.
event that one is not present to open the door manually. The
means of accessing the system will be through a remote
telephone (cell phone or analog phone).The automated
system will use DTMF as the control protocol and will have a
security feature that will validate incoming calls to determine
authorization. The system will include a logging feature that
will allow the user to examine the time and day of system
access. The log information will be accessed through a
keypad and LCD mounted on the main system control box.
The doors will be opened through a remote unit connected
through an RF link. The remote units will be individually Figure 1 (Standard telephone keypad)
addressed to allow multiple doors to be controlled. The doors
will be opened by activating a solenoid built into the door
frame. Index Terms — DTMF, Security Feature, Logging After entering an access code, the user will be voice
Feature, RF Link, Solenoid prompted to choose a door for remote entry. The user can
then make a selection from the voice menu provided. The
door choice will be confirmed before opening. After the
door has been opened, the user will be returned to the
I. INTRODUCTION entry menu where other doors can be opened or the system
The DTMF Automated Door System was birthed out of can be exited. The DTMF system will also include a
a desire to allow remote entry to a premise when the timeout feature that will monitor the time between
occupant is not home. Although a commercially available successive user entries. If the user does not respond to a
voice prompt within 30 seconds, a warning will be issued
X10 system is available to achieve the same objective, the
informing the user that the system is about to time-out. If
group decided to attempt to implement the end goal using
the user still does not respond after an additional 30
DTMF (Dual-Tone-Multi-Frequency) and RF as the
seconds, the system will issue an exit statement and the
control scheme. The goal is to develop an automated
phone will hang-up. (The time-monitor function will be
system that will allow an individual to control door entry performed by a Real-Time-Clock). After the user has
from remote locations. The system will be installed on the finished with the door selections, an exit menu will be
premise in proximity to the door that is to be controlled. provided that gives the user options to leave the system. If
The user will choose an access code that will be used for the user chooses to exit, the DTMF system will then reset
remote activation. The connection from a remote unit to and wait for the next call. The system allows unlimited
the door will be completed allowing the system to control access from the user; provided that a valid access code is
the door remotely. The DTMF system can then be entered. In the event that an invalid code is entered, the
accessed through a remote phone. The DTMF system will system will allow 2 more attempts before issuing a
consist of the following components: a user interface, a statement declaring that the present user is unauthorized to
phone interface, an integrated DTMF decoder, a use the system. After an unauthorized attempt is detected
microcontroller, an interactive voice circuit, a LCD and annunciated, the system will hang up and reset for the
display, a 12-button keypad, a Real-Time-Clock (RTC), a next caller.
serial EEPROM, a RF Tx/Rx system, an addressable
remote microcontroller, a solid state relay, and a door- B. Phone Interface
latch solenoid. The DTMF system is DC powered and will
The phone interface is the device responsible for detecting
an incoming phone call, establishing the current loop
between the DTMF system and the phone company
switching circuit, passing the DTMF signal to the decoder,
passing voice data to the user, and releasing the phone to
allow for other incoming calls. An important requirement
of the phone interface is that it must be FCC Part 68
compliant. The device used for the phone interface is the
XE0092 by Xecom. The XE0092 is in compliance will all Figure 3 RG-11 Phone Connection
FCC Part 68 requirements. (The functional block diagram
for the XE0092 is shown in figure 2). C. Integrated DTMF Decoder

The integrated DTMF decoder is the device that receives


the incoming DTMF data and converts the data into a
usable format for the microcontroller. The device is
required to differentiate between valid DTMF tones and
spurious audio signals. The component chosen for the
decoder is the MT8870 by Zarlink. (The functional block
diagram for the MT8870 is shown in figure 4).

Figure 2 XE0092 Block Diagram

The /OH pin is the “Off-hook” connection and is used to


seize control of the phone line. /OH is pulled high by the
internal circuitry of the XE0092. In order for the phone
interface to operate, the “active-low” /OH mush be pulled
low by external circuitry. The TX- pin is the negative half
of the differential transmission pair. This pin will be used
to send voice data back through the phone line to the user. Figure 4 MT8870 Block Diagram
The TX+ pin is the positive half of the differential
transmission pair. This pin is not utilized in the DTMF The PWDN pin is an “active-high” connection that is used
system and is grounded with the circuit common. The RX- to disable the external oscillator in order to minimize
pin is the negative half of the differential receive pair. This power consumption. This feature will not be utilized and
pin is not utilized and will be left floating. The RX+ pin is this pin will be left floating. The IN+ pin is the non-
the positive half of the differential receive pair. This pin inverting input to the internal op-amp. This pin will be
will be used to send DTMF data to the integrated decoder. connected to Vref to allow for mid-rail response. The IN-
The /CID pin is the “Caller-ID” connection used to display is the inverting input to the internal op-amp. This pin will
incoming call data. This pin will not be used in the DTMF be coupled to the XE0092 RX+ pin by an external
system and will be left floating. The /RI pin is the “Ring- capacitor. This connection is used to receive the incoming
indicator” connection and is used to sense an incoming DTMF data. The GS pin is a “Gain-select” connection that
call. The pin is pulled high by internal circuitry until a sets the gain of the internal op-amp. Since op-amps are
phone call is received. When a call is detected, the /RI is more stable with a feedback loop, this pin will be
pulled low by internal circuitry for the duration of the ring. connected to a resistor to allow for moderate gain. The
The /RI pin returns high between subsequent rings. The OSC1 and OSC2 pin are the connection points for the
TIP and RING pins are used for the connection of the external crystal. The crystal used in the DTMF integrated
external phone line. The phone will be accessed through a receiver must be very precise in order to accurately decode
standard RG-11 phone connection (see figure 3). the DTMF signals. The manufacturer recommended
Additional circuitry will be interfaced to the XE0092 to crystal has a frequency of 3.579545 MHz. (The normally
protect system circuitry from phone line transients. The required oscillator capacitors are contained inside the
protective circuitry will consist of a MOV and a self- MT8870 and are not required externally). The St/GT pin
resetting poly fuse. (Steering input / Guard time output) is used to detect the
presence of a valid DTMF tone. If a voltage greater than a
preset steering threshold appears at St/GT, the output latch (Although DTMF provides tones for A-F, only tones 1-9
circuit is updated with the new binary equivalent word and the asterisk and pound keys will be used).
corresponding to the decoded DTMF tone. If a voltage
less than the preset threshold appears at St/GT, The GT
output resets the latch, and prepares for the next incoming
DTMF tone. The St/GT pin will be connected to pin ESt
for detection of the threshold voltage. The ESt (Early
steering output) pin is used in conjunction with the St/GT
pin. The ESt pin provides a logic high output when the
internal circuitry of the MT8870 has detected a valid
DTMF tone. This output is coupled to St/GT for steering
and synchronization. The ESt pin returns to a low state in
the event of a signal loss. The STD (Delayed steering
output) pin provides a logic high when a valid DTMF tone
has been received and the output latch has been updated.
This pin will be used as a control input to the
microcontroller. The TOE (Tri-State output enable) pin is
an active low input used to disable/enable the output latch.
When the output latch is disabled, the 4-bit binary word
output assumes a high-Z state (high impedance). The high
impedance state is useful in applications requiring that the
outputs be connected to a data bus. Since that function is
not needed for the DTMF automated system, the TOE pin
will be connected to VDD in order to have the output latch
enabled at all times. The Q1, Q2, Q3, and Q4 (Tri-state
data pins) outputs correspond to the decoded DTMF tone.
The outputs can assume three states: Logic low, Logic
high, and High-Z. The logic low state corresponds to
approximately 0 Volts. A logic low state is called the Table 1 4-bit Binary Code For Valid DTMF Tones
current-sink condition. When the MT8870 produces a low
sate at one of its outputs, current is taken into the chip The VDD pin is the input power required to operate the
from external circuitry. A ‘common’ ground state is MT8870. The requirement has a range from a minimum of
achieved. (There are obvious limitations to the amount of 4.75 Volts to an absolute maximum of 7 Volts. The output
current that the MT8870 can ‘sink’). The logic high sate from the VDD voltage regulator will be connected to this
corresponds to approximately 5 Volts (VDD). A logic pin. The VSS pin is the ground input for the 0 Volt
high state is called the current-source state. When the reference. The VSS pin will be connected by a common
MT8870 produces a high state at one of its outputs, bus to the rest of the automated system circuitry. The Vref
current is sourced to external circuitry. A ‘VDD’ voltage pin is the reference voltage used to bias the IN+ input to
state is achieved. (Once again, there are limitations to the one-half of VDD. This biasing allows for a mid-rail
amount of current that the MT8870 can ‘source’). The reference of the input signal. (Maximum allowable swing
high-Z state, as mentioned above, is a high impedance between positive and negative voltage is achieved). The
state. An ‘Open-circuit’ state is achieved. The benefits of halving of the VDD voltage will be accomplished through
having a high-Z sate are: The MT8870 can be connected the internal circuitry of the MT8870. The Vref will then be
to a data bus without the worry of conflicting data; the connected to the IN+ pin. The INH (Inhibit input) pin is an
outputs can essentially be electrically isolated from active-high connection that inhibits the detection of the
downstream circuitry. The three-state outputs will be DTMF tones that represent the characters A, B, C, D. This
connected to the microcontroller to allow action to be pin is normally pulled low by the internal circuitry of the
taken corresponding to the received DTMF tone. The MT8870. Although the DTMF standard defines
DTMF tones will produce varying outputs depending on frequencies for the A, B, C, D characters, the standard
the keys pressed by the user. Table 1 shows how each key phone keypad does not utilize these characters. In the
will be decoded into a 4-bit binary word. The event that the user accesses an interface that supports the
microcontroller will use this information to determine and A, B, C, D characters, the outputted frequencies will be
validate the sequence of keys entered by the user. prohibited from being decoded. Since the microcontroller
will not be programmed to receive these frequencies, this
feature is an important requirement to avoid ambiguous
output states. This pin will be connected to VDD to inhibit of data was written to the register during the programming
the decoding of the A, B, C, D characters. phase to “tell” the PIC which clock source to use.

D. PIC Microcontroller

The heart of the DTMF Automated Door System is the


PIC Microcontroller. The system uses three controllers – a
faster, more robust one in the main box, and two smaller
modules (to be discussed later) in each of the receiving
systems The main box PIC is the device that interfaces
with all the other external circuitry and makes decisions
based on the incoming data. The requirements for the PIC
were: 22+ I/O, I2C compatible, Software UART, 20+
MHz processor speed, 14 KB program memory, flash
memory, DIP configuration, 25mA individual pin source
current, and long-term data retention. The component
chosen for the microcontroller was the PIC 16F877A. The
specifications for the PIC are as follows:

Program Memory: 14.3 K Bytes


Data SRAM: 368 Bytes Figure 5 PIC16F877A
EEPROM: 256 Bytes
I/O Pins: 33 E. Interactive Voice Circuit
10-bit ADC: 8
PWM Channels: 2 The interactive voice circuit is the device that will
SPI Capable: Yes interface with the user. It will annunciate access code
I2C Capable: Yes validation and door status information. It will also
Onboard UART: Yes describe menu choice for the user to make selections. The
8/16 bit Timers: 2/1 component chosen for the voice circuit is the EMIC text-
Comparators: 2 to-speech module. (Figure 6 shows the EMIC sound
module).
The PIC will be programmed using the PIC Pro complier
from METLABS. The IDE allows the PIC to be
programmed using a high level language. The code is
compiled into a compatible HEX file and then burned to
the PIC. The device used to “burn” the PIC is the
PICFLASH2 by MikroElektronika. The PIC16F877A will
use a 20MHz external oscillator crystal to clock the
program data. Figure 5 shows the pin configuration for the
PIC. The PIC16F877A has four I/O ports. Each port has
multiple control functions. For example: Port A can be the
input to the onboard ADC or it can be Digital I/O. The
port functions are configured by writing data into specific
internal registers. Since the DTMF system requires
numerous digital inputs and outputs to peripheral devices,
the PIC was programmed to disable all other port
functions. In addition to the registers that configure the
port uses, the PIC microcontroller also has registers that
control internal parameters. For example: The Figure 6 EMIC Text-To-Speech Module
PIC16F877A has a default power-up condition of using
the internal oscillator. In order to override this condition, The EMIC requires 5 Vdc and 73mA to operate. The
the appropriate register had to be configured. The register EMIC uses a simple 2-wire TTL level serial interface
that controls the “default” oscillator is the OSCON. A byte (SIN, SOUT) to communicate with the PIC
microcontroller. Two additional pins (BUSY/RESET) are
interfaces used to determine device readiness and perform
hardware resets. Data will be sent from the PIC to the determines what key was pressed. The scanned
EMIC using the serial interface. The data consists of bytes information is stored in an array buffer and compared to
of text sent as hex values. The text begins with a “start-of- the programmed data.
transmission” byte ($00) and ends with an “end-of-
transmission” byte ($AA). After the reception of the $AA,
the EMIC converts the hex values contained between the
start and stop bytes to voice audio. The audio signal
produced by the EMIC will be transmitted to the user
through the XE0092 phone interface Tx pins.

F. LCD Display

When a user accesses the DTMF system, the call


information will be stored on a serial EEPROM (to be
discussed later). The user can then view the logged
information at a later time. The call data will be displayed Figure 8 Grayhill 12-Button Keypad
on a 2 x 16 LCD from Parallax (shown in figure 7). (The
display will be mounted on the main system box). In
addition to call data, the LCD will also be used to interact H. Real-Time-Clock
with a maintenance menu that allows for password resets
and setting the time of day. The call log information stored in the serial EEPROM (to
be discussed later) will be time-stamped. Since the PIC
microcontroller does not contain an internal Real-Time-
Clock (RTC), an external component was required. The
device chosen for the RTC is the DS1307 (shown in figure
9) from Dallas Semiconductor. (The DS1307 is mounted
on a circuit board manufactured by Sparkfun Electronics).

Figure 7 Parallax 2 x16 LCD

The chosen LCD has a TTL level serial link to the PIC
microcontroller. Although most LCD’s receive data
through a parallel data bus, the LCD from Parallax
incorporates an onboard microcontroller to allow for serial
transmission. Data is sent to the LCD using ASCII
characters encoded as hex values. The display contains
preset values for turning on and off the backlight and
clearing the display. The LCD requires 5 Vdc and 80 mA
to operate.

G. 12-Button Keypad

As mentioned earlier, the system user will have an option Figure 9 DS1307 Real-Time-Clock
to view call information and access maintenance menus.
The user interface will be a 12-button keypad (shown in The DS1307 employs the 2-wire I2C serial protocol for
figure 8) by Grayhill mounted to the main system box. transmitting and receiving data. (One wire is used for the
The link between the keypad and the PIC is a 7-pin header system clock and synchronization, the other is used as the
that conforms to a row-column matrix configuration. serial data bus). The clock/date data contained in the
Since all of the keys on the keypad represent valid DS1307 is stored in registers. In order for the data to be
numbers and symbols in the DTMF system, each of the retrieved, the specific register address must be known. The
seven pins had to be connected to the microcontroller. A I2C protocol defines a data packet format to access the
scanning routine was programmed into the PIC that registers. The data packet contains a “control-word” that
determines whether a read/write operation is being devices will be accomplished through a simple TTL level
performed; as well as the address of the device to be serial interface. The data transmission speed is
accessed. (The I2C serial interface allows multiple devices configurable up 19.2 K baud. The data to be sent through
to be connected to the same serial bus. Each device must the RF modules will consist of an address byte and a
have a unique address). The data packet also includes an control byte. The address byte will be used to distinguish
“address-word” used to read the data registers in the between the multiple doors, and the control byte will be
device from a specific location. Since the DS1307 used to communicate door action to be performed.
contains registers for the year, month, day, hour, minute,
and second, multiple read operations had to be
programmed into the PIC to retrieve all the necessary
time-stamp data. (The only port on the PIC16F877A
capable of implementing the I2C protocol is Port C). The
DS1307 clock and data pins were connected to RC3 and
RC4 on the PIC, respectively. The retrieved data will be
stored in the serial EEPROM for later use. The DS1307
requires 5 Vdc to operate; the required current is
insignificant. (The DS1307 also has a battery back-up to
retain data in the case of power failure).

I. Serial EEPROM

The DTMF systems allows the user to access call log data
that contains the time of day called and the actions
performed. The log information needs a storage medium.
As mentioned earlier, the PIC18F877A only has a 256
byte internal EEPROM. If the DTMF system is to store
data of a substantial size, an external memory module is Figure 10 Parallax RF Tx/Rx
required. The component chosen for the memory device is
the 24FC1025 1MB I2C Serial EEPROM from Microchip. The devices operate on 5 Vdc and 5 mA of current. Both
The EEPROM will be connected to the PIC using the the Tx and Rx have a power down pin that can be used to
same I2C data bus as the RTC. Since the device uses the command the devices to enter power-save mode.
I2C protocol, a different data packet with the specific
EEPROM address had to be programmed into the PIC. A K. Remote Microcontroller Modules
1 MB capacity was chosen in order to store an extensive
call log. For example: Each data register from the RTC is The DTMF system will access the doors via a remote
1 byte. The clock data is stored in 6 registers: (6 bytes). microcontroller module. The module will contain the
Assuming the system is accessed 20 times per day: (6 following components: An RF Receiver (discussed
bytes X 20 = 120 bytes of data per day). 1 MB / 120 bytes earlier), a PIC microcontroller, an address circuit, a power
= 8333 days or approximately 23 years !!! In the event supply, and a solid state relay.
that the EEPROM is filled, the next data string will simply
overwrite the first memory location. The 24FC1025 - PIC Microcontroller:
requires 5 Vdc to operate; the required current is
insignificant. The device chosen for the microcontroller is the
PIC16F87. The specifications for the PIC are as follows:
J. RF Tx/Rx System
Program Memory: 7168 Bytes
In order for the DTMF system to open a door, a signal has Data SRAM: 368 Bytes
to be sent to the remote control modules. The link between EEPROM: 256 Bytes
the DTMF system main box and the remote modules will I/O Pins: 16
be accomplished through an RF communication path. The 10-bit ADC: 0
devices chosen to provide the RF link is the 433.92 MHz PWM Channels: 1
Tx/Rx matched pair from Parallax (shown in figure 10). SPI Capable: Yes
The devices have a transmission range of approximately I2C Capable: Yes
500ft. The link between the PIC16F877A and the RF Onboard UART: Yes
8/16 bit Timers: 2/1
Comparators: 2 The door latch will be controlled by a door solenoid
distributed by SmartHome (shown in figure 12). The
The PIC16F87 has an internal 8 MHz oscillator that solenoid requires 12 Vdc and 900 mA to operate. The
eliminates the need for an externally connected clock. solenoid will be molded into the door frame and will
receive a 5 second pulse during which the door can be
- Address Circuit: opened.

The address circuit will consist of an 8-position dip switch


and 8 pull up resistors connected to VCC. The dip switch
will allow for 256 differently addressed remote modules.
The modules will be given a unique address by setting the
dip switches. When the address byte is received by the
PIC, the address will be checked against the status of the
dip switches. If the addresses are equal, the received
control byte will be executed.

- Power Supply:

The power supply for the remote modules will consist of a


12 Vdc 1000mA “wall-wart” and a 5 Volt 1.5 A voltage
regulator. The “wall-wart” is a generic power supply
acquired from Skycraft. The voltage regulator is a
LM7805 (shown in figure 11) from Texas Instruments.
Figure 11 SmartHome Electric Door Strike

III. Overview of DTMF System

The basic operation of the DTMF Door System is as


follows:

A. The user calls the home from a remote location


using a cell phone or an analog “land-line”.

B. The XE0092 detects a phone call and passes the


data to the PIC16F877A by pulsing the /RI pin low.

Figure 11 LM7805 Voltage Regulator C. The PIC seizes control of the phone line by
pulling the /OH pin low on the XE0092.
- Solid State Relay:
D. The PIC energizes the EMIC voice module to
The device used to control the flow of current to the door play the welcome greeting and voice prompting the user
solenoid (to be discussed later) is a solid state relay. The for an access code.
relay had to be carefully chosen to allow the switching of
a DC load (Solid state relays usually switch AC loads). E. The user presses buttons on the phone keypad
Additionally, since the PIC16F87 can only source 25 mA which sends DTMF tones to the MT8870 DTMF decoder.
per pin, the relay coil had to have a small turn-on current.
The chosen component is the MPDCD3 from Crydom. F. The DTMF decoder validates the tones and
The relay contacts can switch 60 Vdc up to 3 amps and produces a 4-bit binary word at its outputs corresponding
have a turn on current of 3 mA. to the decoded DTMF tone.

L. Door Solenoid: G. The PIC receives the binary word and compares
it to stored user data. If the data is correct, the PIC
energizes the EMIC to play the menu options. If the data
is incorrect, the PIC energizes the EMIC to play an error The previously described components and operational
message. If the user enters three incorrect access codes, overview encompass the Senior Design project to be
the PIC will energize the EMIC to play an “Unauthorized implemented by the authors.
user” message and will pull the /OH pin on the XE0092
high. (When the /OH pin is pulled high. The phone line is Acknowledgements
released).
The authors wish to acknowledge the assistance of Don
H. If the access code was correct, the PIC instructs Partin BSEET, Brian Walters BSEE, William Moore
the EMIC to play the menu options. BSCS, and Paul Gunnels BSCE PE.

I. The PIC waits for the user to select from the Biography
menu. (While the PIC is waiting, the RTC is checked
periodically to determine the time between subsequent
user entries. If the user waits more than 30 seconds David Marchetti is currently a
between entries, a “time-out” message is played to warn senior at the University of
the user. If the user continues to wait before entering more Central Florida and will receive
data, the PIC will instruct the EMIC to play an exit his Bachelor’s of Science in
greeting and the phone line will be released). Electrical Engineering in May
of 2007. He will be taking the
J. The user presses keys on the phone to select FE in October 2007
options from the voice prompted menu.

K. The data is received by the DTMF decoder and


once again sent to the PIC as a binary word for validation.
Eric White is currently a senior
L. If the data is validated, the PIC transmits an
at the University of
address byte and a control byte via the RF transmitter. If
Central Florida and will receive
the data is not valid, the PIC instructs the EMIC to play an
his Bachelor’s of Science in
“invalid menu option” message.
Electrical Engineering in May
of 2007. He currently works in
M. The RF receivers pass the received data bytes to
the DSP laboratory and hopes
the remote microcontrollers. The PIC16F87 checks the
to pursue a Masters in optics.
status of its address dip switch and compares it to the
value received through the address byte. If the addresses
match, the PIC examines the control word to determine
the course of action. If the addresses do not match, the PIC
disregards the control word and waits for the next data
transmission.
Aaron Sanford is currently a
N. After the data has been transmitted, the main-box senior at the University of
PIC instructs the EMIC to play a “door status” message. Central Florida and will
The EMIC is then instructed to play an “exit or return to receive his Bachelor’s of
menu” message. If the user elects to exit, a “goodbye” Science in Electrical
message is played and the phone line is released. If the Engineering in May of 2007.
user elects to return to the menu, the main option menu is
played and the process is started all over again.

O. After the user has finished using the DTMF


system and has released the phone line, the main-box PIC
writes the transaction data to the external serial EEPROM
using the I2C protocol.

IV. Conclusion