Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
Home Security System with Remote Home Automation Control
Justin Klumpp & Leo Wan Senior Project Description
Western Washington University December 7 2005
Professor Todd Morton
Table of Contents Title Page Number Functional Description……………………………………………………………..1--25 Introduction 1 Functional Description 2--3 Physical Description 5--6 Detailed Description 7--14 Software Description 14--15 User Interface 16--25 Development Plan………………………………………………………………..26--29 Development Plan 26 Development Material 28 Demonstration Description 29 Electrical Specifications………………………………………………………….30--34 Main Unit’s Specification 30--31 Alarm Sensor’s Specification 32--33 Light Control Module’s Specification 33--34
Diagrams List Tables List Figure # and Description Pg. # 1—Overall System Block Diagram 2 2—Phone Line Interface 3 3—Home Automation Block Diagram 4 4—Home Security Block Diagram 5 5—Main Control Module’s Sketch 6 6a,b—Light Control Module’s Sketches 6 7—Motion Sensor’s Sketch 6 8—Sprinkler Valve’s Sketch 6 9—Microcontroller Block Diagram 11 10—Alarm Sensor: Microcontroller Block Diagram
13
11—Relay Control: Microcontroller Block Diagram
14
12—I/O for User Interface 16 13—Setting the Clock 17 14—Setting the Phone Number 18 15—Option Menu 19 16—Testing the Phone Number 19 17—Setting the Sprinkler Schedule 20 18—Flow Diagram of Alarm Message 21 19—Flow Diagram of User Interface for Remote Home Automation control
23
20—Flow Diagram for LCD User Interface
24
21—Continue of Flow Diagram for LCD User Interface
25
Table # and Description Pg. # 1—Software Modules 15 2—Alarm Sensor’s Identification Number 18 3—Voice Messages for Alarm Sensor Callback
21
4—Voice recordings for Home Automation Control
22
5—Timetable for Projection Completion 28 6—Main Unit’s Specification Criteria 30 7—Main Unit’s Power Requirement 30 8—Sprinkler Valve’s Power Requirement 30 9—Main Unit’s PCB Limit 31 10—Main Unit’s Preliminary Parts List 31 11—Alarm Sensor’s Specification Criteria 32 12—Alarm Sensor’s Power Requirement 32 13—Alarm Sensor’s PCB Limit 33 14—Alarm Sensor’s Preliminary Parts List 33 15—Light Control Module’s Specification Criteria
33
16—Light Control Module’s Power Requirement
34
17—Light Control Module’s PCB Limit 34 18—Light Control Module’s Preliminary Parts List
34
______________________________________________________________________________ Home Control System -1- 12/7/2005
Introduction
Today’s culture is filled with horror stories of home break-ins and burglaries,
leaving people to fear that their home may not be protected from the outside world.
Americans want their home to be safe and secure from any would-be intruders. This
desire for security has caused an increase in the demand for sophisticated home alarm
systems. This demand for better home security systems has also drifted over to a need
for home automation. Not only does a home need to be secure, but home appliances
need a more refined control system. Home appliances should not be limited to only
local control. For instance, if the sprinkler system is left on during a rainstorm it will
waste water, and electricity. There needs to be a simple and elegant way to avoid this
type of situation, and allow people the freedom of having complete control of their house
from anywhere. Americans are always on the go, and demand that technology will
accommodate their lifestyle.
With this fact in mind we propose to build an alarm system, with home
automation controls. The key to this control system will be the use of a telephone for a
two way communication path to the central control unit. By using a phone the end user
will be instantly notified via telephone for any intrusions in their home. Also, the
telephone will double as a remote control for household appliances such as lights, or an
outdoor sprinkler system. Justin Klumpp will be in charge of the alarm side of the
system including the alarm sensors and transfer of wireless data to the base unit. Leo
Wan will be responsible for the home automation controls, including the light control
module and sprinkler valve control system.
______________________________________________________________________________ Home Control System -2- 12/7/2005
Functional Description
The basic top level block diagram is shown below in figure 1. The core of the
project will be the base microcontroller; it will determine what actions need to be sent
out to the rest of the system. The base microcontroller will determine when each sub
part needs to be activated and will be the main medium for data processing.
Phone Interface
The phone interface is shown in more detail in figure 2, it will consist of three
main components. The telephone line will be hooked to the direct access arrangement
(DAA) chip. This will communicate directly with the microcontroller allowing incoming
and outgoing calls to be made. Dual Tone Multi-Frequency signal processing will be
Base Microcontroller
Home Security
Sprinkle Valve Home Automation
Phone Interface
Figure 1: Overall System Block Diagram
______________________________________________________________________________ Home Control System -3- 12/7/2005
used for generating tones for outgoing calls and will also be used to decode incoming
tones which will be sent to the microcontroller for data processing.
Home Automation
The home automation system will consist of three main components. The overall
system will be laid out as shown in figure 3. The microcontroller will send out signals to
the home automation system for device control. A wireless receiver will be connected
to the light control module which will receive signals from the transmitter on the base
microcontroller. The sprinkler head will be hard wired to the microcontroller, which will
control the sprinkler run time schedule. Although there will be only one light control
module built for this project, the project design will allow for up to four wireless modules
to be connected to the home automation system.
Figure 2: Phone Line Interface
DAA
DTMF Signals
Microcontroller
______________________________________________________________________________ Home Control System -4- 12/7/2005
Home Security
The home security block diagram is shown in more detail in figure 4. This
system will consist of three components: a wireless transmitter, a microcontroller and a
laser motion sensor. The motion sensor will be directly connected to the microcontroller
which will have a transmitter to send signals to the base microcontroller to notify of the
sensor’s current state. Once the microcontroller receives the signal from an alarm
sensor it will determine if a phone call needs to be made to the end user notifying that
there has been an intrusion into their home. Although only one alarm sensor will be
built for this project the design will allow for an expansion for up to sixteen alarm
sensors.
RF Receiver
Microcontroller 9S12C32
Microcontroller 9S12DP256
Home Automation Module
Relay
Figure 3: Home Automation Block Diagram
Relay
______________________________________________________________________________ Home Control System -5- 12/7/2005
Physical Description
The physical layout of the home control system will resemble the sketch shown in
figure 5. This system will consist of: the main control module, which includes a keypad
and liquid crystal display (LCD) screen. The Light Control Module will plug directly into
the wall, and will have its wireless sensor mounted internally [figure 6a, 6b]. The alarm
sensor will be a motion detector, which is shown in figure 7. The sprinkler valve is
manufactured by RainBird and is shown in figure 8.
RF Transmitter
Microcontroller 9S12C32
Microcontroller 9S12DP256B
Alarm Sensor
Home Security Module
Figure 4: Home Security Block Diagram
______________________________________________________________________________ Home Control System -6- 12/7/2005
1.50”
0.50” Receiver Module
1.50”
2.50”
6.80
5.30
2.60
Figure 5: Main Control Module
Figure 6-a: Light Control Module Figure 6-b: Light Control Module
Figure 7: Motion Sensor Figure 8: Sprinkler Valve
______________________________________________________________________________ Home Control System -7- 12/7/2005
Detailed Description
Alarm Sensor [ Figure 10 ]
The alarm sensor used for this project is a motion sensor made by General
Electric. This motion sensor will output a high of 8 volts when it detects motion within
50 feet, and when no motion is detected the output is 0 volts. The design in this project
will allow any sensor to be hooked to the microcontroller as long as the sensor has an
output of at least 5 volts, when active and less than 1 volt when inactive.
The motion sensor will be connected to a 5 volt regulator to ensure a 5 volt output to
the microcontroller. The microcontroller will be set to wake up every second to send out
a status byte indicating the current state of the device. The alarm sensor identifier will
be set using a 4 pin dip-switch, which will be able to represent a binary number from
0–15. The dip-switch will be connected to pins PT1–PT4 on the 9S12C32
microcontroller. There will be an interrupt set on pin PP5 enabling the microcontroller to
wake up whenever motion is detected by the sensor. The signal will be sent out using
the PS1 pin which is the data transmit pin for the serial communications port. The byte
will be encoded with several items; first each new byte will be determined by two start
bits of 11. The data following the start bits will be captured by the microcontroller for a
count of 5 bits. The data to be captured will be the sensor number and its current state.
The byte configuration will be as follows: 11XXXXX00
o The first two bits are the start bits: 11
o The next bit is a 1 if the sensor is tripped, a 0 the sensor is still armed
o The next four bits will be a binary number between 0 and 15, having a total of
16 possibilities, this will be the sensor identifier
______________________________________________________________________________ Home Control System -8- 12/7/2005
Since each sensor has a unique identifier the base receiver will be able to determine
what alarm sensor information is being sent, and will allow for a check to see if all alarm
sensors are still active. If one of the current configured alarm sensors has not sent out
a signal, the microcontroller will know that one either has a dead battery, or has
malfunctioned.
Light Control [ Figure 11 ]
The light control circuit will consist of a wireless receiver, which will be hooked to
the MC9S12C32 microcontroller. Once a signal has been received it will be decoded by
the MCU. The microcontroller will have its serial communications port open and be
taking readings on pin PS0. The microcontroller will look for a 1010 for the first four bits
of data and then it will capture the next three bits. The byte data will have the
configuration of 1010XXX0 where the first four bits will be the start nibble, which will
identify a new byte being received. The next bit will tell the appliance to turn on or off,
and the next two bits will allow control of up to 4 modules. Once a proper byte has been
decoded the light will change according to the incoming code. When a signal is
received to turn the light on, the microcontroller will turn pin PT0 on. This pin will then
activate a relay to switch the light on. For the light to turn off the microcontroller will turn
pin PT0, off which will open the relay, turning off the light.
Sprinkler Control
The sprinkler control unit will use a RainBird automatic sprinkler valve. The
sprinkler valve requires 24 VAC by the manufacturer, which will be provided by a 24 V
wall transformer. The sprinkler control software module on the base microcontroller will
control the sprinkler valve with a preset daily schedule according to the time generated
______________________________________________________________________________ Home Control System -9- 12/7/2005
by the battery backed real time clock chip. The end user can also override the preset
schedule and tell the microcontroller to either turn the sprinkler valve relay on or off.
RF Wireless Control
The wireless control will be done with a total of two transmitters and two
receivers. We chose to use an operating frequency of 418 MHZ. This particular
frequency falls within the Industry/Scientific/Medical (ISM) band. This frequency is not
crowded which will help reduce the chance of RF interference. The data transmission
will all be serial, with encoding as stated previously in the Light Module, and Alarm
Sensor sections. The expected range of indoor transmission is around 75 feet.
Telephone Interface with DAA and DTMF Transceiver
The telephone line will be connected directly into the DAA so it will have full
control of on hook and off hook states of the phone line. The DAA will use a two wire
connection to the ring and tip of the phone line. The DAA will be configured to use a full
ring detect for incoming call detection.
For home automation, when an incoming call comes is detected RING2 pin will
go low for two counts. The DAA_Interface software on the base microcontroller will
detect and process these pulses. After five rings, ten pulses, the microcontroller will
assert pin OH low on the DAA, which will put the phone line in the off hook state. Once
off hook the DTMF transceiver will be looking for incoming codes to decode which will
be sent to the microcontroller. Then the DTMF interface software module will determine
what action will take place for the home automation control units.
When a signal from an alarm sensor has been received by the base
microcontroller and it has determined that the sensor was tripped or malfunctioned, the
______________________________________________________________________________ Home Control System -10- 12/7/2005
OH pin on the DAA will be switched low. Once the OH pin is low the line will be off
hook, and the DTMF interface software module will look up the preset phone number,
which will be sent using binary data to the DTMF transceiver to be encoded. The
encoded number will then be sent out in tones and will dial the end user’s cell phone.
Once the line has been established between the end user and the DAA the base
microcontroller will access the voice chip with a memory location to a prerecorded
message. These prerecorded messages will be a voice signal by which the end user
will be notified that a sensor in the security system has been triggered or has gone
offline.
Microcontrollers
Microcontroller 1: (MC9S12DP256B)
The major portion of data processing will do done using microcontrollers.
The base control unit will be using a Motorola 9S12DP256B. We chose to use this
microcontroller mainly due to our familiarity with this line of microcontrollers. Also all of
the development software is easily accessible. The main input user interface will be a
keypad hooked up to pins PB0 - PB7. A LCD module will use a total of eleven pins and
will be connected to PA0 - PA7 and PK0 - PK2. The sprinkler relay will be connected to
PK3 and will be used as an I/O pin. The DTMF transceiver will be hooked to pins PM0 -
PM7 and pin PK4. The DAA will be hooked to pins PT0 and PT1. The wireless
transmitter and receiver will be hooked to pins PS0 and PS1, which will allow for serial
data transmission of the wireless signals. The voice chip will be out of PORTS and will
be hooked to the microcontroller on pins PS4 – PS7, for SPI communication.
______________________________________________________________________________ Home Control System -11- 12/7/2005
The microcontroller will be using a 16 MHz crystal for its clock, and the bus
speed will be 24 MHz. The microcontroller will also have a reset circuit to ensure
operating voltage stays at 5 volts. The BDM port was left open in this design so it could
be hooked up at a later time for troubleshooting purposes.
Wall TransformerPower Supply
Input: 120VAC
Output: 5VDC Current: 1A
2X16 LCD
MC9S12DP256B
PORTA
PA0 to
PA7
PORTB
PB0 to
PB7
PORTK
PK0 PK1 PK2
PK3
PK4
DTMF Transceiver
Voice Chip Sprinkler
Relay
DAA
Reset Circuit
BDM Connector
16 MHz Crystal XTAL/EXTAL
BDM
RESET
256K Flash EEPROM
4K EEPROM
12K RAM
PORTS
PS0 PS1
PS4 PS5 PS6 PS7
PORTM
PM0 To
PM7
PORTT
PT0 PT1
Receiver at 418Mhz
Transmitter at 418Mhz
8
11
9
4
2
Figure 9: Microcontroller Block Diagram
______________________________________________________________________________ Home Control System -12- 12/7/2005
We will be utilizing the 256K Flash EEPROM for the program code storage. The
4K EEPROM will be utilized for storing the end user’s phone number, sprinkler settings,
and the time of the real time clock.
Microcontroller 2: (MC9S12C32)
The alarm sensor and light control modules will both be using a Motorola
9S12C32 microcontroller. Both of these sensors would have been better suited to run
off of the Nitron Motorola 68HC08QT4 microcontroller. The 68HC08QT4
microcontroller has 4k bytes of flash and 128 bytes of ram, and 4 channel 8 bit analog
to digital converter. Using this microcontroller would have cut down on cost, power
dissipation, and printed circuit board real estate. Although, the Nitron Motorola
microcontroller has these excellent abilities its lacks the serial port we need, and it
would increase our overall development time. The 9S12C32 has a serial port that will
be used for the serial transmission between the wireless transmitter and receiver.
Serial transmission could have been done with the 68HC08QT4 by using a bit bang
approach but this would have required writing another software module. By having the
SCI port already available on the 9S12C32 will cut down on overall development time.
Very few resources on the 9S12C32 microcontroller will be used in this project.
The alarm sensor will use pin PP5 as in interrupt to wake the microcontroller up [figure
10]. The alarm sensor will also use pin PT0 to input the alarm’s current state as an
input pin from the alarm sensor, and will use PS1 for serial data transmission. A 4 pin
dip-switch will be hooked to pins PT1—PT4. The second 9S12C32 MCU will control the
light module relay which will be connected to pin PT0 [figure 11]. The wireless receiver
will be connected to PS0 which will be used as a serial data communications interface.
______________________________________________________________________________ Home Control System -13- 12/7/2005
Both microcontrollers will have a 8MHz crystal, and a reset circuit to ensure operating
voltage stays at 5 volts. The bus speed for both microcontrollers will run at 8 MHz
Power Supply 9 Volt Battery
Input: 9.0VDC
Output: 8.0VDC
8 MHz Crystal
2K RAM
32K Flash ROM
BDM
RESET
XTAL/EXTAL
PORTS
PS1
PORTT
PT0 PT1 PT2 PT3 PT4
MC9S12C32
Reset Circuit
BDM Connector
Transmitter
Alarm Motion Sensor
+5V
+5V+5V
PORTP
PP5
Figure 10: Alarm Sensor: Microcontroller Block Diagram
4 Pin Dip-Switch
______________________________________________________________________________ Home Control System -14- 12/7/2005
Software Description
The software will be one of the more complex parts for this project. Since the
overall complexity is high, we are going to be developing our software with the high
level programming language, C, combined with the µC/OS Real-time Kernel. With
µC/OS, we will be able to break down the overall software to a few smaller modules as
shown in table 1.
Some of the modules in table 1, such as the LCD_Display and Key_Pad have
Wall Transformer Power Supply
Input: 120VAC Output 1: 5.0VDC
Current: 1A
8 MHz Crystal
2K RAM
32K Flash ROM
BDM
RESET
XTAL/EXTAL
PORTS
PS0
PORTT
PT0
MC9S12C32
Reset Circuit
BDM Connector
Receiver
Light Control Module
+5V
+5V
Figure 11: Relay Control: Microcontroller Block Diagram
______________________________________________________________________________ Home Control System -15- 12/7/2005
already been written by Professor Morton, these modules should work with little to no modification. However for the other modules like the Wireless, Voice_Ctrl, DTMF_Interface, and Sprinkler_Ctrl, will be new modules which Justin and I will have to create in order for them to work with the microcontroller.
Software Modules Module Name Module Description: Kernel This is the µC/OS pre-emptive kernel, which will control all of the
scheduled modules according to their scheduled time for multitasking. User_Interface This module contains all user communications with the main system. Sprinkler_Ctrl Controls the sprinklers on and off state according to the user’s
preference. EEPROM It controls the data being read and write to the EEPROM memory Key_Pad Receive the input from the keypad. Real_Time_Clock This module handles the real time operations of the system. LCD_Display Output information to the LCD display. DTMF_Interface This module will handle the transmit and receive of the DTMF signals SPI_Driver This module will include all the initialization and controls of the SPI
serial communications. SCI_Driver This module will include all the initialization and controls of the SCI
serial communications. DAA_Interface Handles the communications with the DAA, which gives signals for
phone line controls. Wireless To control transmit and receive signals with the wireless components. Voice_Ctrl Give instructions to the voice recorded IC to playback the according
messages.
Table 1: Software Modules
______________________________________________________________________________ Home Control System -16- 12/7/2005
User Interface
The user interface for this system is extensive, but not confusing. Our goal for
user interface is to have the end user be able to control this device without the use of
the instructions. This system’s user interface consists of three major parts: the initial
setup, menu, and voice playback for communication with the end user at a remote
location.
Hardware
In order to achieve usability for the user interface, we will be using a 16 key
keypad and a 16X2 LCD display [figure 12] for the user read out and data input on the
main unit itself. When the end user is connected to the system at a remote location, the
voice IC will be used to playback prerecorded messages to communicate with the user
over the phone system.
Initial Setup
When the microcontroller starts up for the first time or an error occurs in the
EEPROM storage, it will automatically go to the initial setup sequence. For the first part
of this sequence, the user will be prompted to enter the time for the real time clock. To
set the time, the user will use the key pad and enter the time using the number keys.
16X2 LCD
16 Keys keypad Figure 12: I/O for User Interface
______________________________________________________________________________ Home Control System -17- 12/7/2005
After the fourth digit of the time is entered, the system will require the user to confirm by
pressing the “#” key. Otherwise, the input cursor will be looped back to the first digit to
reenter the time. After the “#” is pressed, the LCD screen will change to the second
clock set input state and prompt for either “A” for AM or “B” for PM. Again, after the last
entry the system will require the “#” key to confirm.
When the clock is set the system will automatically transfer the time to the battery
backed real time clock. Then the next procedure will be asking the user for their alarm
preferences. Similar to the time entry above, the alarm settings will require two pieces
of information from the end user; the user’s remote phone number, and the amount of
sensors that are going to be used. When the correct information is received, it will be
stored in the EEPROM for volatile protection against power failure.
To enter the end users’ phone number, the user will first see the alarm screen 1
on the LCD screen [Figure 14]. Then starting from the area code, the user will use the
key pad to replace the 0’s with the phone number they wish to be contacted at. When
the tenth digit has been entered in, the cursor will again loop back to the first digit so the
user can correct any mistakes.
In order to have the alarm sensors working properly with the system, the end
user will have to configure the alarm sensor’s identification number. On the alarm
sensor module, there is a 4-pin dip switch, that will be use to set the alarm sensors’
CLOCK_SET_00:00 PRESS_#_TO_CONT.
PRESS_A-AM,B-PM PRESS_#_TO_CONT.
Clock Screen: 1 Clock Screen 2
“#” Pressed
Figure 13: Setting the Clock
______________________________________________________________________________ Home Control System -18- 12/7/2005
identification number. The identification numbers are listed in table 2 upon the users’
selection.
Alarm Sensor Number:
1 2 3 4 5 6 7 8
Identification Number:
0000 0001 0010 0011 0100 0101 0110 0111
Alarm Sensor Number:
9 10 11 12 13 14 15 16
Identification Number:
1000 1001 1010 1011 1100 1101 1110 1111
After the alarm sensors are identified, the user will need to enter the total amount
of sensors (1-16) being used. Since the alarm system will check for battery status of
the sensors, if the user enters a number higher than the actual amount of sensors that
are being used, the main system will encounter a off line error from those non existing
sensors and will send an alert to the user’s remote phone number immediately.
After the alarm setup is finished, the system has completed the initial start-up
sequence. Next the system will go to the main screen where the true real time clock is
displayed on the top of the two lines [figure 15]. During all normal operation, the main
screen will be displayed on the LCD display with the time updated every second. At
anytime, the user can press “#” at to enter the menu for more control options. Inside the
menu, there will be three options: system restart, phone line test, and sprinkler schedule
1(000)000-0000 PLUS_#_TO_CONT.
Alarm Screen 1
#_OF_SENSORS: 00 PRESS_#_TO_CONT.
Alarm Screen 2
“#” Pressed
Figure 14: Setting the Phone Number
Table 2: Alarm Sensors Identification Numbers
______________________________________________________________________________ Home Control System -19- 12/7/2005
time. Due to the limited read out space with the 2X16 LCD, we can only display one
operation at a time with the “#” key to access the next available option.
The first option in the menu will be the system reset operation [Figure 15]. If the
user presses a “1” on this screen, the system will be routed back to the initial setup.
This is the only option for the user to reset the system’s real time clock and the end
users’ phone number.
The second option in the menu is phone line testing [Figure 16]. This option is
made for the user to check their connectivity with the phone system, and to see if the
end users’ phone number has been entered in correctly during the initial setup. If this
option is selected, the system will dial out the end users’ phone number. Although there
will not be a message playback when the user picks up the phone call, as long as the
users’ phone rings, it indicates the phone line interface as a whole is in working order.
The last option in the menu is setting the sprinkler’s on/off time [Figure 17]. The
“on” time in the schedule setup is very similar with the clock setup in the initial settings.
The first part of the setup will be to enter the “on” time for the sprinkler. After the fourth
Figure 15: Main and Option Menu
“1”Pressed
Figure 16: Testing the Phone Number
PRESS_1:RESET, PRESS_#:MORE...
TIME: XX:XX XM PRESS_#_FOR_MENU
PRESS_1:PH_TEST PRESS_#:MORE...
TESTING_PHONE LINE,DAILING...
Main Menu Option Menu
______________________________________________________________________________ Home Control System -20- 12/7/2005
digit “on” time is entered into the system, the cursor will loop back to the first digit for
mistake corrections. When the “#” is pressed, the system will prompt for the AM or PM
entry for the sprinkler “on” time. With the “on” time set, the next step is to enter in the
sprinkler duration time in minutes. This duration entry will be stored in the EEPROM
and alerts the microcontroller to turn off the sprinkler valve when the time is up.
Next is the description of the phone line user interface. Each one of the
messages in the tables below [Table 3] will be recorded to a designated address in the
voice playback IC. Since the alarm phone interface will only call the end user when an
alarm sensor has been tripped or the battery inside the alarm sensor is depleted;
therefore the alarm phone interface is only a one way communication from the system
to the end user. Figure 18 and table 3, show the messages for the alarm phone
interface and both the situations where a call will be placed to inform the end user with
the current situation.
“1”Pressed
“#”Pressed
“#”Pressed
Figure 17: Setting the Sprinkler Schedule
PRESS_1:SCHEDULE PRESS_#:EXIT
ON_TIME: 00:00 PRESS_#_TO_CONT.
DURUATION:000MIN PRESS_#_TO_CONT.
PRESS_A-AM,B-PM PRESS_#_TO_CONT.
______________________________________________________________________________ Home Control System -21- 12/7/2005
The phone interface for the automation system is a bit more complicated. The
user will be able to change settings of the automated controllers around the house input
through the phone line. The home automation user interface will play messages to
inform the state that the user is in, and it will also receive the DTMF input to allow the
user to control the system over the phone line.
When the user first dials into the system, it will prompt for a valid password in
order to get into the main control menu. To deceases the chance of hackers breaking
into the menu, the system will go on-hook after one invalid password entry to make any
hackers have to call back repeatedly. When a correct password is entered, then the
user will be able to get into the main menu and choose between the sprinkler control
and the household control.
Sensor tripped
Message: 17+(1, 2,..16)+18
Sensors Battery Died
Message: 17+19
Message Number:
Message recorded:
1.-16. Sensor name #1-16 17. Warning, your 18. Has been tripped 19. Sensor has gone off line
Table 3: Voice Messages for Alarm Sensor Callback
Figure 18: Flow Diagram of Alarm Message
______________________________________________________________________________ Home Control System -22- 12/7/2005
In order to control the operations of the sprinkler system, the end user will need
to press the “1” key on their phone while in the main menu. Once the user is in the
sprinkler control menu, three choices will be available: “1” for instant on, “2” to turn off
(schedule also), “3” to follow the present schedule. For the household control, the user
will be able to choose between 1 of the 4 available remote modules and control their
outputs to be either on or off. To reduce the confusions of this voice system, anytime
the user wants to start over in the main menu, they can simply press the “*” key on their
phone. Table 4 and figure 19 show the recorded messages and the flow diagram of the
automation phone interface.
Message Number:
Message Recorded:
1. Welcome to your automation system, press 1 for menu. 2. Press 1 for sprinkler controls, 2 for household control. At anytime press *
to go back to the main menu 3. Sprinkler system, 4. Household control, press 1, 2, 3 or 4 to control the corresponding module 5. Press 1 to turn on, 2 to turn off 6. Or 3 to follow schedule 7. Please enter the password 8. Input Confirmed
Table 4: Voice recordings for Home Automation Control
______________________________________________________________________________ Home Control System -23- 12/7/2005
The following figures are the overall flow diagrams of the user interface of the
system. With figure 20 being the menu control and figure 21 being the initial setup.
Message 7
Dial in from user
On Hook Wrong password
Message 1
Correct password
Message 2
“1” Pressed
Message 3+5+6
“1” Pressed
Message 4
“2” Pressed
Message 5
“1, 2, 3 or 4” Pressed
Message 8
“1” Pressed
“*” Pressed
“*” Pressed
“*” Pressed
Message 8 “1, 2 or 3” Pressed
Figure 19: Flow Diagram of User Interface for Remote Home Automation Control
______________________________________________________________________________ Home Control System -24- 12/7/2005
Figure 20: Flow Diagram for LCD User Interface
PRESS_1:RESET, PRESS_#:MORE...
PRESS_1:SCHEDULE PRESS_#:EXIT
PRESS_1:PH_TEST PRESS_#:MORE...
ON_TIME: 00:00 PRESS_#_TO_CONT.
DURUATION:000MIN PRESS_#_TO_CONT.
#_TO_FINISH, *_TO_START_OVER.
“#” Pressed
“#” Pressed
“#” Pressed
“#” Pressed
“#” Pressed
“1” Pressed
TESTING_PHONE LINE,DAILING...
“1” Pressed
“#” Pressed
“*” Pressed
Initial setup
Holds for 5 seconds
Menu Main Screen
Menu User Interface
“1” Pressed
PRESS_A-AM,B-PM PRESS_#_TO_CONT.
“#” Pressed
______________________________________________________________________________ Home Control System -25- 12/7/2005
Power On
AUTO_HOME POWERING_UP...
PRESS_ANY_KEY TO_SET_TIME
PRESS_A-AM,B-PM PRESS_#_TO_CONT.
CLOCK_SET_00:00 PRESS_#_TO_CONT.
HIT_A_KEY_TO_ADD SECURITY_PHONE#.
1(000)000-0000 PLUS_#_TO_CONT.
#_TO_FINISH, *_TO START OVER.
SETUP_SUCCESSFUL SYSTEM_READY
TIME: XX:XX XM PRESS_#_FOR_MENU
#_OF_SENSORS: 00 PRESS_#_TO_CONT.
Key Pressed
“#” Pressed
“#” Pressed
“#” Pressed
“#” Pressed
“#” Pressed
“*” Pressed
Holds for 5 seconds
Holds for 5 seconds
Main Screen
Menu“#” Pressed
“#” Pressed
Initial Start up User Interface
Initial Setup
Figure 21: Continue of Flow Diagram for LCD User Interface
______________________________________________________________________________ Home Control System -26- 12/7/2005
Development Plan
To ensure that there will be enough time to complete this project a well defined
development schedule must be implemented [table 5]. We must be sure to follow this
schedule in order to not fall behind and end up not having enough time to complete the
project. Several key components for the project have already been received, but there
are still a few components that must be purchased in a timely manner to ensure that
there’s enough time to put everything together. Each section of the schedule has been
divided up in a logical order to ensure proper flow for designing this home control
system.
The flow of the development cycle will start first with building the telephone line
interface, for communication between the microcontroller and the DAA. Once the
telephone module has been completed our next task will be to each individually build
our sensor components. This will be the alarm sensor and the light control module.
Once these items are completed the next step will be to setup the wireless hardware for
communications between the base microcontroller, alarm sensor and light module.
Once the wireless hardware is setup the next step will be to setup both the DTMF
transceiver circuit and voice circuit. When all of the hardware has been completed and
tested to ensure correct operation, the next step will be the microcontroller software.
We put all hardware design first in the development cycle in order to make the software
design be a more efficient process. By knowing that all of hardware is operational the
software will be easier to write and debug. This development plan is shown in a week
by week table starting in week 9 of Fall Quarter, and has been laid out to the last week
of Spring Quarter 2006.
______________________________________________________________________________ Home Control System -27- 12/7/2005
Winter Break Week 1 Justin: Design circuit for motion sensor
Leo: Design circuit for sprinkler valve Week 2 Complete motion sensor and sprinkler valve circuit. Build DAA
circuit. Week 3 Relax and spend time with our families Winter Quarter Week 1 Should be in the process of building and testing the DAA. Week 2 DAA should be done at this point, and start working on the
wireless transmission circuit design Week 3 Complete wireless hardware and begin working with DTMF
circuit Week 4 DTMF circuit should be completed at this point Week 5 Write interface software for MCU for communication to DAA. Week 6 At this point the microcontroller software should be to the point
where a call can be detected from the DAA Week 7 Start working with Voice IC, get all messages recorded and
begin working on circuit layout for the voice chip. Week 8 Complete voice circuit , and test design Week 9 Cushion Week, will work on anything that has not been
completed by this point according to the schedule Week 10 Begin working on keypad module, and complete Week 11 Work on LCD module Week 12 Continue to work on LCD module and complete Spring Quarter Week 1 Justin: Work with the 9S12C32 microcontroller and begin writing
software for wireless serial transmission Leo: Work with the 9S12C32 and write software for serial data receive and write decoder logic
Fall Quarter Week 9 Continue locating major parts: still need to get DTMF transceiver,
voice chip, wireless transmitter, wireless receiver and antenna. Week 10 Spend more time developing a complete system flow to
understand how each component fits into the overall design. Week 11 Read up on datasheets, and make sure all components have
either been received already, or are in the process of being shipped.
Week 12 Continue to read datasheets, in particular the datasheet for the DAA, and start getting prepared to build a test circuit for the DAA.
______________________________________________________________________________ Home Control System -28- 12/7/2005
Week 2 Write the DTMF data control module.
Week 3 Complete DTMF control, and debug, in class hardware review. Week 4 Justin: Begin writing wireless data control module
Leo: Write real time clock module. Week 5 Justin: Continue writing wireless data control module
Leo: Continue writing real time clock module. Week 6 Complete real time clock, and wireless data control module. Week 7 Debug system and assemble any components. Week 8 Relax. Week 9 In class code review. Week 10 Test the project. Week 11 Senior Project Demonstration. Week 12 Graduate and Celebrate!
Development Materials
The development of this project will be done in the ET340 lab. There are many
resources available in this lab for development and testing. The hardware design will
be done on prototype boards, which will mainly be copper circuit boards with point to
point soldering designs. Debugging and testing the circuits will also be done with the
resources available in the lab mainly being the programmable power supply, digital
multimeter and the mixed signal oscilloscope. Circuit designs will also be simulated
using computer software, the two main programs for testing will be TINA and PSpice,
which will be done either at home or the ET340 lab.
Both of the Motorola microcontrollers will come on evaluation boards which have
breadboards for small prototyping circuit testing. All software modules will be written
using Code Wright and CodeWarrior software, which will be done using the computers
in lab 340. The debugging of any code using the BDM port on the microcontroller and
will be hooked up to the Noral Flex debugging software in the lab.
Table 5: Timetable for Projection Completion
______________________________________________________________________________ Home Control System -29- 12/7/2005
Demonstration Description
For the demonstration on the 10th week of the spring quarter, we will have the
main unit and one of each remote modules constructed to demonstrate the usability of
the system. For the main unit’s enclosure, we will be using a plastic case to house the
microcontroller. Since reliability is a very important factor for this system, we will be
using the point-to-point soldering technique to construct all of our components, which
will make our circuits a lot more reliable as comparison to solder-less breadboard
construction.
It is necessary to have a phone line connection to acquire the usability of our
system. Therefore we will be using the station across from the scanner to connect on
to one of the ET340 phone lines. The alarm sensor will be the GE motion detector. To
demonstrate this, Justin Klumpp will be instructing viewers to trigger the sensor by
walking in front of the motion sensor, and this will make the system to call the remote
phone number, which will initially set up as his cell phone number.
For the automation part of the system, Leo Wan will bring in a lamp from his
house and connect it to the other side of the automation receiver module. By using his
cell phone, Leo will let the viewers control the automation system by calling the second
phone line of the ET340 laboratory, which the system is connected to. The sprinkler
system on the other hand might be a bit harder to demonstrate. To show the on off of
the sprinkler system, we will either use an LED to display the signal that is going out to
the sprinkler relay, or by using a fog machine and the actual sprinkler valve to show the
real life reaction but without the water.
______________________________________________________________________________ Home Control System -30- 12/7/2005
Main Unit’s Electrical Specifications
Project Specifications
Specification Description FCC Part 15 The main unit complies with the FCC wireless regulation. FCC Part 68 The main unit complies with the FCC PSTN (public switched
telephone network) regulation. Real Time Clock Accuracy ±20 parts per million (Crystal) Maximum Alarm Sensors 16 allowable units Maximum Home Automation Units
4 allowable units
Maximum Wireless Transmit / Receive Distance
100 feet
Operating Temperature 0°C to 50°C
Power Requirements
Main Unit (Wall Transformer)
Description Values
Vin The input voltage for the main unit’s wall power supply.
120 Vac
Vout The output voltage of the main unit’s wall power supply.
5 Vdc
Worst Case Power Dissipation
The maximum current the main unit will draw. 415mA
Sprinkler
Valve (Wall Transformer)
Description Values
Vin The input voltage for the sprinkler valve’s wall power supply.
120 Vac
Vout The output voltage of the sprinkler valve’s wall power supply.
24 Vac
Worst Case Power Dissipation
The maximum current the sprinkler valve will draw.
350 mA
Table 7: Main Unit’s Power Requirement
Table 6: Main Unit’s Specification Criteria
Table 8: Sprinkler Valve’s Power Requirement
______________________________________________________________________________ Home Control System -31- 12/7/2005
PCB Layout
PCB (Main)
Description Length (inches)
Height The maximum height allowance for the main PCB and riser in inches.
1.50
Width The maximum width allowance for the main PCB in inches.
3.50
Tall The maximum length allowance for the main PCB in inches
3.50
Parts List
Preliminary Parts List
Description Part # Distributor Qty. Price Max. Current
Lead Time
Microcontroller MC9S12DP256P Motorola 1 $14.08 70mA 1 Week Crystal 16 Mhz HC49US16.000MABJ Digi-Key 1 $0.15 .02mA 1 Week
D.A.A. CPC5622A All American 1 $7.54 21mA 0 DTMF Transceiver M8880-01P All American 1 $4.53 15mA 3 Weeks
Voice Playback I.C. (4 minutes)
ISD4002-240P Digi-Key 1 $7.12 30mA 1 Week
418 Mhz ASK RF Transmitter
TLP434A Laipac Tech. 1 $2.30 20mA 2 Weeks
418 Mhz ASK RF Receiver
RLP434A Laipac Tech. 1 $6.40 5mA 2 Weeks
418 Mhz Antenna ANT-418-PW-RA Digi-Key 1 $3.10 N/A 1 Week Automatic
Sprinkler Valve APAS-100 Lowe’s 1 $12.93 220mA 0
Wall Transformer 24VAC
420AS24037 Digi-Key 1 $5.15 N/A 1 Week
LCD 2X16 LM162 Sharp 1 $5.88 3mA 0 Resistors N/A Digi-Key 30 $0.06 30mA 0
Capacitors N/A Digi-Key 10 $0.20 N/A 0 BBRTC DS1305 Digi-Key 1 $3.82 1.28mA 1 Week
Crystal 32.768Mhz C-001R 32.7680K-A Digi-Key 1 $0.15 .02mA 1 Week RJ-11 Connector SY011M4P4C Jameco 1 $0.37 N/A 1 Week
Total: $72.11 415mA
Table 9: Main Unit’s PCB Limit
Table 10: Main Unit’s Preliminary Parts List
______________________________________________________________________________ Home Control System -32- 12/7/2005
Alarm Sensor’s Electrical Specifications
Project Specifications
Specification Description FCC Part 15 The alarm sensors comply with the FCC wireless regulation. Maximum Motion Sensor Distance
50 feet
Motion Sensor Detection Angle
Up to 110° Horizontal, and 30° Vertical
Maximum Wireless Transmit Distance
100 feet
Operating Temperature 0°C to 50°C
Power Requirements
Security Sensor Unit
(9V Battery)
Description Values
Battery Type The alarm sensor is going to use an 9V battery. 9 Vdc (rectangle)
Vout The output voltage of the battery 9 Vdc Iout The total output current in mAhr. 450 mAhr Worst Case Power Dissipation
The maximum current the alarm sensor unit will draw.
.4 mA
Estimated Battery Life
The estimated battery life time before complete depletion.
1125 Hours
Table 12: Alarm Sensor’s Power Requirement
Table 11: Alarm Sensor’s Specification Criteria
______________________________________________________________________________ Home Control System -33- 12/7/2005
PCB Layout
PCB (Sensors Receivers)
Description Length (inches)
Height The maximum height allowance for the alarm sensors PCB and riser in inches.
0.50
Circle Diameter The maximum circle area (given in diameter) allowance for the alarm sensors PCB in inches
1.50
Parts List
Preliminary Parts List
Description Part # Distributor Qty. Price Max. Current
Lead Time
418 Mhz ASK RF Transmitter
TLP434A Laipac Tech. 1 $2.30 20mA 2 Weeks
418 Mhz Antenna ANT-418-PW-RA Digi-Key 1 $3.10 N/A 1 Week Crystal 8 Mhz HC49US8.000MABJ Digi-Key 1 $0.15 .02mA 1 Week
Resistors N/A Digi-Key 3 $0.06 10mA 0 Capacitors N/A Digi-Key 2 $0.20 N/A 0
4-Pin Dip-Switch 219-4MST Digi-Key 1 $0.55 N/A 0 5 Volt Regulator LM2931AZ-5.0 Digi-Key 1 $0.70 15mA 0 Microcontroller MC9S12C32 Digi-Key 1 $10.65 50mA 0
Total: $18.01 95mA
Light Control Module’s Electrical Specifications
Project Specifications
Specification Description FCC Part 15 Light control module comply with FCC wireless regulation. Automation Unit’s Maximum Power Output
150 Watts
Maximum Wireless Receiving Distance
100 feet
Operating Temperature 0°C to 50°C
Table 13: Alarm Sensor’s PCB Limit
Table 14: Alarm Sensor’s Preliminary Parts List
Table 15: Light Control Module’s Specification Criteria
______________________________________________________________________________ Home Control System -34- 12/7/2005
Power Requirements
Light Control
Module (Wall Transformer)
Description Values
Vin The input voltage for the light control module’s wall power supply.
120 Vac
Vout The output voltage of the light control module’s wall power supply.
5 Vdc
Worst Case Power Dissipation
The maximum current the light control module will draw.
65 mA
PCB Layout
Parts List
Preliminary Parts List
Description Part # Distributor Qty. Price Max. Current
Lead Time
418 Mhz ASK RF Receiver
RLP434A Laipac Tech. 1 $6.40 5mA 2 Weeks
418 Mhz Antenna ANT-418-PW-RA Digi-Key 1 $3.10 N/A 1 Week Crystal 8 Mhz HC49US8.000MABJ Digi-Key 1 $0.15 .02mA 1 Week
Resistors N/A WWU 3 $0.06 10mA 0 Capacitors N/A WWU 2 $0.20 N/A 0
Microcontroller MC9S12C32 Digi-Key 1 $10.65 50mA 0 Total: $20.68 65mA
PCB (Light Modules)
Description Length (inches)
Height The maximum height allowance for the light control module’s PCB and riser in inches.
0.50
Width The maximum width allowance for the light control module’s PCB in inches.
2.00
Tall The maximum length allowance for the light control module’s PCB in inches
1.00
Table 16: Light Control Module’s Power Requirement
Table 18: Light Control Module’s Preliminary Parts List
Table 17: Light Control Module’s PCB Limits