15
Home Security and Lighting System Western Washington University Jonathon Ross 28 April, 2009

Home Security and Lighting System Western Washington University Jonathon Ross 28 April, 2009

Embed Size (px)

Citation preview

Page 1: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Home Security and Lighting System Western Washington University Jonathon Ross 28 April, 2009

Page 2: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

MCU – MC9S12DP512 MCU Bus Frequency

• 25MHz Memory Requirements

• 3kB Ram• 10kB Rom

Kernel Choice • MicroC/OS-II

Page 3: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Start Task Light Sense Task User Interface Task Light Adjust Task Motion Sensor Task Alarm Task

Page 4: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Creates tasks and displays startup

message.• Task Priority - #4 • Task Period - Once (Startup)• Estimated Task Execution Time - ~1s• Task CPU load - Not Applicable

Page 5: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Senses and adjusts light according to a

predetermined level set by the user.• Task Priority - #5 • Task Period - 10ms (Periodic)• Estimated Task Execution Time - 1ms• Task CPU load

Average - .5/10 = .05 Peak - 1/10 = .1

Page 6: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Interfaces between user and product as well

as controls states and other tasks• Task Priority - #6 • Task Period - 10ms (Periodic) • Estimated Task Execution Time - .1ms• Task CPU load

Average - .05/10 = .005 Peak - .1/10 = .01

Page 7: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Allows user to adjust the lighting level with

a 4 button array. Options available - on, off, up, down

• Task Priority - #7 • Task Period - 10ms (Periodic)• Estimated Task Execution Time - .25ms• Task CPU load

Average - .1/10 = .01 Peak - .25/10 = .025

Page 8: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Senses outside motion and activates a light

when movement is detected outside the front door.

• Task Priority - #8 • Task Period - 20ms (Periodic)• Estimated Task Execution Time - 1.5ms• Task CPU load

Average - 1/20 = .05 Peak - 1.5/20 = .075

Page 9: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Description• Detects open windows and doors and

activates an alarm when necessary.• Task Priority - #9 • Task Period - 50ms (Periodic)• Estimated Task Execution Time - .1ms• Task CPU load

Average - .05/50 = .001 Peak - .1/50 = .002

Page 10: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

L max= (10%) + (1%) + (2.5%) + (7.5%) + (.2%)

L max= 21.2%

L average = (5%) + (.5%) + (1%) + (5%) + (.1%)

L average = 11.6%

Page 11: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009
Page 12: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Keypad I/O

Key.c()

KeyCodeTableKey

KeyFlag

Keypad ModuleApplication

KeyPend()UserInterfaceTask

LightAdjust()

StartTask()KeyInit()

KeyPend()

Page 13: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

LCD I/O

Lcd.c()

LCD ModuleApplication

UserInterfaceTask()

LightAdjustTask()

StartTask()Lcd_init()

LcdClrDisp()LcdMoveCursor()LcdCursor()LcdBackspace()LcdForwardSpace()LcdDispChar()LcdDispDecNum()putstrg()

Page 14: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

LightSensor

Application

LightSenseTask()TRIAC/Bulbs

LightSensor I/OLight Bulbs/Output

LightAdjustTask()

Level

Level.flag

Page 15: Home Security and Lighting System  Western Washington University  Jonathon Ross  28 April, 2009

Alarm 1Alarm 2Alarm 3Alarm 4Alarm 5

Application

AlarmTask()Buzzer

Alarm Groups I/OAlarm

MotionSensorTask()TRIAC

Light

Motion Sensor

Motion Sensor I/O