110 likes | 289 Views
Home Security System. Willard Stanley. Motivations. Commercial security systems have a monthly cost Designing my own allows for greater extensibility. Design Goals. Core feature parity with commercial system Cost of less than $100 Low power Web configurable. Design Constraints.
E N D
Home Security System Willard Stanley
Motivations • Commercial security systems have a monthly cost • Designing my own allows for greater extensibility
Design Goals • Core feature parity with commercial system • Cost of less than $100 • Low power • Web configurable
Design Constraints • The Arduino Uno has 32KB of program memory • There are 13 I/O pins • The device has no threading, multitasking, or OS. • The TCP stack for the Arduino Ethernet module only supports 4 socket connections
Client Software Design • Client Protocol Grammar:<client_communication> --> <login>|<heartbeat>|<sensor_event><login> --> login <client_id> <password><client_id> -> [0-9]+<password> --> [a-zA-Z0-9!@#$%^&*()}{":>?<]+<heartbeat> --> heartbeat <session_id><session_id> --> [0-9a-f]{50}<sensor_event> --> sensor <session_id> <byte><byte> --> .
Server Software Design • Server Protocol Grammar:<server_response> --> <command>|null<command> --> <start_session>|<trigger_alarm>|<flash_leds><start_session> --> start <session_id><trigger_alarm> --> panic<flash_leds> --> flash|noflash
Client Implementation • Built using the Arduino’s development toolkit • Based on a subset of C • Since there is no multitasking, the client is simply a loop. • Program size turned out to be around 13KB • Pseudo Code:Loop{ if !check_for_tcp_connection(){establish_tcp_connection(server) }new_sensor_data= read_in_sensor_data() if new_sensor_data != old_sensor_data{update_LEDs(new_sensor_data)send_event_to_server(new_sensor_data)old_sensor_data= new_sensor_data} else{send_heartbeat(server) }} //End Loop
Server Implementation • Built using Python 2.7 • Designed and tested on FreeBSD 8.2 • Uses a synchronous threading model • Uses MySQL for the database