Вы находитесь на странице: 1из 8

DTMF Automated Door System

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

School of Electrical Engineering and Computer Science, University of Central Florida, Orlando, Florida, 32816-2450

Abstract — The purpose of this senior project is to design an automated system that can be used to open a door in the 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 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 Feature, RF Link, Solenoid

I. INTRODUCTION

The DTMF Automated Door System was birthed out of a desire to allow remote entry to a premise when the occupant is not home. Although a commercially available X10 system is available to achieve the same objective, the group decided to attempt to implement the end goal using DTMF (Dual-Tone-Multi-Frequency) and RF as the control scheme. The goal is to develop an automated system that will allow an individual to control door entry from remote locations. The system will be installed on the premise in proximity to the door that is to be controlled. The user will choose an access code that will be used for remote activation. The connection from a remote unit to the door will be completed allowing the system to control the door remotely. The DTMF system can then be accessed through a remote phone. The DTMF system will consist of the following components: a user interface, a phone interface, an integrated DTMF decoder, a microcontroller, an interactive voice circuit, a LCD display, a 12-button keypad, a Real-Time-Clock (RTC), a serial EEPROM, a RF Tx/Rx system, an addressable remote microcontroller, a solid state relay, and a door- latch solenoid. The DTMF system is DC powered and will

have an external “wall-wart” power supply. The system is approximated to cost $500 to implement.

II. OVERVIEW OF SYSTEM COMPONENTS

A. User Interface

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 system.

(see figure 1) to call the premises and access the system. Figure 1 (Standard telephone keypad)

Figure 1 (Standard telephone keypad)

After entering an access code, the user will be voice 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 entry menu where other doors can be opened or the system can be exited. The DTMF system will also include a timeout feature that will monitor the time between successive user entries. If the user does not respond to a voice prompt within 30 seconds, a warning will be issued informing the user that the system is about to time-out. If the user still does not respond after an additional 30 seconds, the system will issue an exit statement and the phone will hang-up. (The time-monitor function will be performed by a Real-Time-Clock). After the user has finished with the door selections, an exit menu will be provided that gives the user options to leave the system. If the user chooses to exit, the DTMF system will then reset and wait for the next call. The system allows unlimited access from the user; provided that a valid access code is entered. In the event that an invalid code is entered, the system will allow 2 more attempts before issuing a statement declaring that the present user is unauthorized to use the system. After an unauthorized attempt is detected and annunciated, the system will hang up and reset for the next caller.

B. Phone Interface

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 FCC Part 68 requirements. (The functional block diagram for the XE0092 is shown in figure 2).

block diagram for the XE0092 is shown in figure 2). Figure 2 XE0092 Block Diagram The

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. The TX+ pin is the positive half of the differential transmission pair. This pin is not utilized in the DTMF system and is grounded with the circuit common. The RX- pin is the negative half of the differential receive pair. This pin is not utilized and will be left floating. The RX+ pin is the positive half of the differential receive pair. This pin will be used to send DTMF data to the integrated decoder. The /CID pin is the “Caller-ID” connection used to display incoming call data. This pin will not be used in the DTMF system and will be left floating. The /RI pin is the “Ring- indicator” connection and is used to sense an incoming call. The pin is pulled high by internal circuitry until a phone call is received. When a call is detected, the /RI is pulled low by internal circuitry for the duration of the ring. The /RI pin returns high between subsequent rings. The TIP and RING pins are used for the connection of the external phone line. The phone will be accessed through a standard RG-11 phone connection (see figure 3). Additional circuitry will be interfaced to the XE0092 to protect system circuitry from phone line transients. The protective circuitry will consist of a MOV and a self- resetting poly fuse.

will consist of a MOV and a self- resetting poly fuse. Figure 3 RG-11 Phone Connection

Figure 3 RG-11 Phone Connection

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).

block diagram for the MT8870 is shown in figure 4). Figure 4 MT8870 Block Diagram The

Figure 4

MT8870 Block Diagram

The PWDN pin is an “active-high” connection that is used to disable the external oscillator in order to minimize power consumption. This feature will not be utilized and this pin will be left floating. The IN+ pin is the non- inverting input to the internal op-amp. This pin will be connected to Vref to allow for mid-rail response. The IN- is the inverting input to the internal op-amp. This pin will be coupled to the XE0092 RX+ pin by an external capacitor. This connection is used to receive the incoming DTMF data. The GS pin is a “Gain-select” connection that sets the gain of the internal op-amp. Since op-amps are more stable with a feedback loop, this pin will be connected to a resistor to allow for moderate gain. The OSC1 and OSC2 pin are the connection points for the external crystal. The crystal used in the DTMF integrated receiver must be very precise in order to accurately decode the DTMF signals. The manufacturer recommended crystal has a frequency of 3.579545 MHz. (The normally required oscillator capacitors are contained inside the MT8870 and are not required externally). The St/GT pin (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 circuit is updated with the new binary equivalent word 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 current-sink condition. When the MT8870 produces a low sate at one of its outputs, current is taken into the chip from external circuitry. A ‘common’ ground state is achieved. (There are obvious limitations to the amount of current that the MT8870 can ‘sink’). The logic high sate corresponds to approximately 5 Volts (VDD). A logic high state is called the current-source state. When the MT8870 produces a high state at one of its outputs, current is sourced to external circuitry. A ‘VDD’ voltage state is achieved. (Once again, there are limitations to the amount of current that the MT8870 can ‘source’). The high-Z state, as mentioned above, is a high impedance state. An ‘Open-circuit’ state is achieved. The benefits of having a high-Z sate are: The MT8870 can be connected to a data bus without the worry of conflicting data; the outputs can essentially be electrically isolated from downstream circuitry. The three-state outputs will be connected to the microcontroller to allow action to be taken corresponding to the received DTMF tone. The DTMF tones will produce varying outputs depending on the keys pressed by the user. Table 1 shows how each key will be decoded into a 4-bit binary word. The microcontroller will use this information to determine and validate the sequence of keys entered by the user.

(Although DTMF provides tones for A-F, only tones 1-9 and the asterisk and pound keys will be used).

tones 1-9 and the asterisk and pound keys will be used). Table 1 4-bit Binary Code

Table 1

4-bit Binary Code For Valid DTMF Tones

The VDD pin is the input power required to operate the MT8870. The requirement has a range from a minimum of 4.75 Volts to an absolute maximum of 7 Volts. The output from the VDD voltage regulator will be connected to this pin. The VSS pin is the ground input for the 0 Volt reference. The VSS pin will be connected by a common bus to the rest of the automated system circuitry. The Vref pin is the reference voltage used to bias the IN+ input to one-half of VDD. This biasing allows for a mid-rail reference of the input signal. (Maximum allowable swing between positive and negative voltage is achieved). The halving of the VDD voltage will be accomplished through the internal circuitry of the MT8870. The Vref will then be connected to the IN+ pin. The INH (Inhibit input) pin is an active-high connection that inhibits the detection of the DTMF tones that represent the characters A, B, C, D. This pin is normally pulled low by the internal circuitry of the MT8870. Although the DTMF standard defines frequencies for the A, B, C, D characters, the standard phone keypad does not utilize these characters. In the event that the user accesses an interface that supports the A, B, C, D characters, the outputted frequencies will be 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 the decoding of the A, B, C, D characters.

of data was written to the register during the programming 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:

The component chosen for the microcontroller was the PIC 16F877A. The specifications for the PIC are

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 PIC16F877A has a default power-up condition of using the internal oscillator. In order to override this condition, the appropriate register had to be configured. The register that controls the “default” oscillator is the OSCON. A byte

controls the “default” oscillator is the OSCON. A byte Figure 6 EMIC Text-To-Speech Module The EMIC

Figure 6 EMIC Text-To-Speech Module

The EMIC requires 5 Vdc and 73mA to operate. The EMIC uses a simple 2-wire TTL level serial interface (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 EMIC using the serial interface. The data consists of bytes of text sent as hex values. The text begins with a “start-of- 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 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 with a maintenance menu that allows for password resets and setting the time of day.

that allows for password resets and setting the time of day. Figure 7 Parallax 2 x16

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 to view call information and access maintenance menus. The user interface will be a 12-button keypad (shown in figure 8) by Grayhill mounted to the main system box. The link between the keypad and the PIC is a 7-pin header that conforms to a row-column matrix configuration. Since all of the keys on the keypad represent valid numbers and symbols in the DTMF system, each of the seven pins had to be connected to the microcontroller. A scanning routine was programmed into the PIC that

determines what key was pressed. The scanned information is stored in an array buffer and compared to the programmed data.

in an array buffer and compared to the programmed data. Figure 8 Grayhill 12-Button Keypad H.

Figure 8 Grayhill 12-Button Keypad

H.

Real-Time-Clock

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).

on a circuit board manufactured by Sparkfun Electronics). Figure 9 DS1307 Real-Time-Clock The DS1307 employs the

Figure 9

DS1307 Real-Time-Clock

The DS1307 employs the 2-wire I2C serial protocol for transmitting and receiving data. (One wire is used for the system clock and synchronization, the other is used as the serial data bus). The clock/date data contained in the DS1307 is stored in registers. In order for the data to be retrieved, the specific register address must be known. The I2C protocol defines a data packet format to access the registers. The data packet contains a “control-word” that

determines whether a read/write operation is being performed; as well as the address of the device to be accessed. (The I2C serial interface allows multiple devices to be connected to the same serial bus. Each device must have a unique address). The data packet also includes an “address-word” used to read the data registers in the device from a specific location. Since the DS1307 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 required. The component chosen for the memory device is the 24FC1025 1MB I2C Serial EEPROM from Microchip. The EEPROM will be connected to the PIC using the same I2C data bus as the RTC. Since the device uses the I2C protocol, a different data packet with the specific EEPROM address had to be programmed into the PIC. A

1 MB capacity was chosen in order to store an extensive

call log. For example: Each data register from the RTC is

1 byte. The clock data is stored in 6 registers: (6 bytes).

Assuming the system is accessed 20 times per day: (6 bytes X 20 = 120 bytes of data per day). 1 MB / 120 bytes = 8333 days or approximately 23 years !!! In the event that the EEPROM is filled, the next data string will simply overwrite the first memory location. The 24FC1025 requires 5 Vdc to operate; the required current is insignificant.

J. RF Tx/Rx System

In order for the DTMF system to open a door, a signal has to be sent to the remote control modules. The link between the DTMF system main box and the remote modules will be accomplished through an RF communication path. The devices chosen to provide the RF link is the 433.92 MHz Tx/Rx matched pair from Parallax (shown in figure 10). The devices have a transmission range of approximately 500ft. The link between the PIC16F877A and the RF

devices will be accomplished through a simple TTL level serial interface. The data transmission speed is configurable up 19.2 K baud. The data to be sent through the RF modules will consist of an address byte and a control byte. The address byte will be used to distinguish between the multiple doors, and the control byte will be used to communicate door action to be performed.

will be used to communicate door action to be performed. Figure 10 Parallax RF Tx/Rx The

Figure 10 Parallax RF Tx/Rx

The devices operate on 5 Vdc and 5 mA of current. Both the Tx and Rx have a power down pin that can be used to command the devices to enter power-save mode.

K. Remote Microcontroller Modules

The DTMF system will access the doors via a remote microcontroller module. The module will contain the following components: An RF Receiver (discussed earlier), a PIC microcontroller, an address circuit, a power supply, and a solid state relay.

- PIC Microcontroller:

The device chosen for the microcontroller is the PIC16F87. The specifications for the PIC are as follows:

Program Memory:

7168 Bytes

Data SRAM:

368 Bytes

EEPROM:

256 Bytes

I/O Pins:

16

10-bit ADC:

0

PWM Channels:

1

SPI Capable:

Yes

I2C Capable:

Yes

Onboard UART:

Yes

8/16 bit Timers:

2/1

Comparators:

2

The PIC16F87 has an internal 8 MHz oscillator that eliminates the need for an externally connected clock.

- Address Circuit:

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.

is a LM7805 (shown in figure 11) from Texas Instruments. Figure 11 LM7805 Voltage Regulator -

Figure 11 LM7805 Voltage Regulator

- Solid State Relay:

The device used to control the flow of current to the door solenoid (to be discussed later) is a solid state relay. The relay had to be carefully chosen to allow the switching of a DC load (Solid state relays usually switch AC loads). Additionally, since the PIC16F87 can only source 25 mA per pin, the relay coil had to have a small turn-on current. The chosen component is the MPDCD3 from Crydom. The relay contacts can switch 60 Vdc up to 3 amps and have a turn on current of 3 mA.

L. Door Solenoid:

The door latch will be controlled by a door solenoid distributed by SmartHome (shown in figure 12). The solenoid requires 12 Vdc and 900 mA to operate. The solenoid will be molded into the door frame and will receive a 5 second pulse during which the door can be opened.

a 5 second pulse during which the door can be opened. Figure 11 SmartHome Electric Door

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.

C. The PIC seizes control of the phone line by

pulling the /OH pin low on the XE0092.

D. The PIC energizes the EMIC voice module to

play the welcome greeting and voice prompting the user

for an access code.

E. The user presses buttons on the phone keypad

which sends DTMF tones to the MT8870 DTMF decoder.

F. The DTMF decoder validates the tones and

produces a 4-bit binary word at its outputs corresponding to the decoded DTMF tone.

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 message. If the user enters three incorrect access codes, the PIC will energize the EMIC to play an “Unauthorized user” message and will pull the /OH pin on the XE0092 high. (When the /OH pin is pulled high. The phone line is released).

H. If the access code was correct, the PIC instructs

the EMIC to play the menu options.

I. The PIC waits for the user to select from the

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 between entries, a “time-out” message is played to warn the user. If the user continues to wait before entering more data, the PIC will instruct the EMIC to play an exit greeting and the phone line will be released).

J. The user presses keys on the phone to select

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.

L. If the data is validated, the PIC transmits an

address byte and a control byte via the RF transmitter. If the data is not valid, the PIC instructs the EMIC to play an “invalid menu option” message.

M. The RF receivers pass the received data bytes to

the remote microcontrollers. The PIC16F87 checks the 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.

N. After the data has been transmitted, the main-box

PIC instructs the EMIC to play a “door status” message. The EMIC is then instructed to play an “exit or return to menu” message. If the user elects to exit, a “goodbye” message is played and the phone line is released. If the 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

The previously described components and operational overview encompass the Senior Design project to be implemented by the authors.

Acknowledgements

The authors wish to acknowledge the assistance of Don Partin BSEET, Brian Walters BSEE, William Moore BSCS, and Paul Gunnels BSCE PE.

Walters BSEE, William Moore BSCS, and Paul Gunnels BSCE PE. Biography David Marchetti is currently a
Walters BSEE, William Moore BSCS, and Paul Gunnels BSCE PE. Biography David Marchetti is currently a
Walters BSEE, William Moore BSCS, and Paul Gunnels BSCE PE. Biography David Marchetti is currently a

Biography

David Marchetti is currently a senior at the University of Central Florida and will receive his Bachelor’s of Science in Electrical Engineering in May of 2007. He will be taking the FE in October 2007

Eric White is currently a senior at the University of Central Florida and will receive his Bachelor’s of Science in Electrical Engineering in May of 2007. He currently works in the DSP laboratory and hopes to pursue a Masters in optics.

Aaron Sanford is currently a senior at the University of Central Florida and will receive his Bachelor’s of Science in Electrical Engineering in May of 2007.