Home

Formal Report - PROJ354 Home

image

Contents

1. FRIDAY APRIL 4 2014 Formal Report Home Office Automation Jimmy Bright Alexander Kampel Chris Woolford HOME SOLUTIONS Table of Contents Exec tve UL INTEL reale iaia 3 Vi ehe ieh 3 Achievements sn ee lee 3 PTO CCE Out iie eu ee ae A OA TE 4 Project CO PCs Sasan ua ee ee eng 4 BUS RR ARENAS 4 Conclusi n unid ads 5 APPS iS Sd 6 Appendix A User Manual EEE 6 Appendix B Source Code iii nl en i 9 Appendix C Bibliography sauna ie BERNIE 21 2 PAGE Executive Summary The purpose of this document is to provide information on the Home Office Automation project as completed by the team Home Solutions This document will outline the team members and some of their achievements It will also have an outline of the project itself as well as the project scope This document will also outline the project budget There will be a conclusion section at the end of the document Following this document will be a few appendices It will include the user manual for the final product and also source code and other documents from the project Team Home Solutions consists of three SAIT Polytechnic students studying IT Computer Systems Jimmy Bright was the main coder for the project he was the person most responsible for the scripts that make the project possible Alex Kampel was the person behind many designing aspects of the project He also created many HTML pages for the project Chris Woolford was responsible for many of
2. gt 21 lt option gt lt option value 22 gt 22 lt option gt lt option value 23 gt 23 lt option gt lt select gt lt select name minute gt lt option value 0 gt 00 lt option gt lt option value 5 gt 05 lt option gt lt option value 10 gt 10 lt option gt lt option value 15 gt 15 lt option gt lt option value 20 gt 20 lt option gt lt option value 25 gt 25 lt option gt lt option value 30 gt 30 lt option gt lt option value 35 gt 35 lt option gt lt option value 40 gt 40 lt option gt lt option value 45 gt 45 lt option gt lt option value 50 gt 50 lt option gt lt option value 55 gt 55 lt option gt lt select gt lt select name month gt lt option value 1 gt Jan lt option gt lt option value 2 gt Feb lt option gt lt option value 3 gt Mar lt option gt lt option value 4 gt Apr lt option gt lt option value 5 gt May lt option gt lt option value 6 gt Jun lt option gt lt option value 7 gt Jul lt option gt lt option value 8 gt Aug lt option gt lt option value 9 gt Sept lt option gt lt option value 10 gt Oct lt option gt lt option value 11 gt Nov lt option gt lt option value 12 gt Dec lt option gt lt select gt lt select name day gt lt option value 1 gt 1 lt option gt lt option value 2 gt 2 lt option gt lt option value 3 gt 3 lt option gt 13 PAGE lt option value 4 gt 4 lt option gt lt o
3. gt Turn Off lt option gt lt select gt lt br gt lt label class text gt lt input type checkbox name outletOne class text id delay value 1 gt Outlet 1 lt label gt lt label class text gt lt input type checkbox name outletTwo class text id delay value 1 gt Outlet 2 lt label gt lt label class text gt lt input type checkbox name outletThree class text id delay value 1 gt Outlet 3 lt label gt lt br gt lt label class text style text align left gt Time lt label gt lt select name hour gt lt option value 0 gt 0 lt option gt lt option value 1 gt 1 lt option gt lt option value 2 gt 2 lt option gt lt option value 3 gt 3 lt option gt lt option value 4 gt 4 lt option gt 12 PAGE lt option value 5 gt 5 lt option gt lt option value 6 gt 6 lt option gt lt option value 7 gt 7 lt option gt lt option value 8 gt 8 lt option gt lt option value 9 gt 9 lt option gt lt option value 10 gt 10 lt option gt lt option value 11 gt 11 lt option gt lt option value 12 gt 12 lt option gt lt option value 13 gt 13 lt option gt lt option value 14 gt 14 lt option gt lt option value 15 gt 15 lt option gt lt option value 16 gt 16 lt option gt lt option value 17 gt 17 lt option gt lt option value 18 gt 18 lt option gt lt option value 19 gt 19 lt option gt lt option value 20 gt 20 lt option gt lt option value 21
4. option gt lt select gt lt label gt lt input type submit value Submit gt lt form gt if POST poweron 1 system python pulse25 py elseif _POST poweron 2 system python pulse22 py elseif _POST poweron 3 14 PAGE system python pulse23 py elseif _POST poweron 4 system python pulse25 py system python pulse22 py system python pulse23 py if _POST poweroff 1 system python pulse17 py elseif _POST poweroff 2 system python pulse24 py elseif _POST poweroff 3 system python pulse18 py elseif _POST poweroff 4 system python pulse18 py system python pulse17 py system python pulse24 py if _POST onoff 1 POST onoff 0 job file home pi mycron txt minute _POST minute hour POST hour day _POST day month _POST month repeat _POST repeat week if repeat 1 hour day month elseif repeat 2 day en month se elseif repeat 3 day 15 PAGE month mn week date w timestamp elseif repeat 4 month f if isset _POST outletOne if _POST onoff 1 job minute hour day month week var www cgi bin pulse25 py PHP_EOL else job min
5. GE lt div id left gt lt h2 class on gt ON lt h2 gt lt form name on action index php method post gt lt input type image src images powerbutton jpg name poweron class small id poweron value 1 gt lt br gt lt input type image src images powerbutton jpg name poweron class small id poweron value 2 gt lt br gt lt input type image src images powerbutton jpg name poweron class small id poweron value 3 gt lt form gt lt div gt lt div id center gt lt h3 class text gt Outlet 1 lt h3 gt lt h3 class text gt Outlet 2 lt h3 gt lt h3 class text gt Outlet 3 lt h3 gt lt div gt lt div id right gt lt h2 class off gt OFF lt h2 gt lt form name off action index php method post gt lt input type image src images powerbutton jpg name poweroff class small id poweroff value 1 gt lt br gt lt input type image src images powerbutton jpg name poweroff class small id poweroff value 2 gt lt br gt lt input type image src images powerbutton jpg name poweroff class small id poweroff value 3 gt lt div gt lt div gt lt form gt lt div id date gt lt form name date action index php method post gt lt h3 class text style text align leftimargin 0px gt Time delay for power on off lt h3 gt lt select name onoff id onoff gt lt option value 1 gt Turn On lt option gt lt option value 0
6. e amount of time that the user wants to pass before the outlets turn off can be changed in sensor py 8 PAGE Appendix B Source Code login php lt php if isset _POST username print lt script type text javascript gt print alert Login Successful print lt script gt gt lt DOCTYPE HTML gt lt html gt lt head gt lt title gt Login to Power Control lt title gt lt style gt lt style gt lt head gt lt body gt lt form name login method post action check php gt lt h2 gt Please enter your login information lt h2 gt lt label for username gt Username lt label gt lt input type text name username id username gt lt br gt lt label for password gt Password lt label gt lt input type password name password id password gt lt br gt lt input type submit gt lt input gt lt form gt lt body gt lt html gt 9 PAGE check php lt php if isset _POST username username POST username password _POST password l Use this to change username or password if username HS amp amp password capstone header location index php header location login php gt 10 PAGE index php lt DOCTYPE HTML gt lt html gt lt head gt lt title gt Power Control lt title gt lt style gt wrapper position absolute left 50 width 640px height 1136px margin le
7. ername HS Password capstone The username and password can be changed in the file check php on line 8 as seen in the following picture Use this to change username or password if username HS amp amp password capstone 6 PAGE Once logged in the user will be taken to the following page u Outlets y Individual Controls Outlet 1 Outlet 2 Outlet 3 Time delay for power on off CED B There are many options for controlling the outlets on this page At the top are the master On Off buttons Clicking the top power buttons will turn on top left or off top right all of the outlets The On Off buttons in the middle are used to turn each outlet on off separately The bottom portion of the page is used for scheduling the outlets to power on off The first drop down box lets you choose whether to turn the outlet s on or off Below that you can choose which outlet s you want on or off Then you are given the option to choose the time of day and date followed by if you want to repeat that job in the future 7 PAG m Motion Sensor Option The user can also choose to use a motion sensor option that makes the process more automated but with less control A motion sensor can be placed anywhere the user desires such as entrance to the office and when motion is detected the outlets will all turn on The outlets will then turn off whenever a certain amount of time passes without motion being detected Th
8. ft 320px individual width 640px clear both master width 640px left1 width 220px float left center1 width 200px float left padding 140px Opx Opx Opx right1 width 220px float left left width 220px float left center width 200px float leftipadding 20px Opx Opx Opx right width 220px float left date clear both text text align center color A3A3A3 on text align center color 06961 c Off text align center color c20a0a h3 padding 0px margin 85px Opx font size 30px h1 padding 0px margin 1 0px Opx font size 80px h2 padding 0px margin 1 0px Opx font size 50px body background color black large margin 0px Opx Opx 10px small margin 10px Opx 10px 60px lt style gt lt head gt lt body gt lt div id wrapper gt lt form name masterOn action index php method post gt lt div id master gt lt div id left1 gt lt h1 class on gt ON lt h1 gt lt input type image src images powerbuttonlarge jpg name poweron class large id poweron value 4 gt lt div gt lt div id center1 gt lt h2 class text gt All Outlets lt h2 gt lt div gt lt div id right1 gt lt h1 class off gt OFF lt h1 gt lt input type image src images powerbuttonlarge jpg name poweroff class large id poweroff value 4 gt lt div gt lt div gt lt div id individual gt lt h2 class text gt Individual Controls lt h2 gt 11 PA
9. ption value 5 gt 5 lt option gt lt option value 6 gt 6 lt option gt lt option value 7 gt 7 lt option gt lt option value 8 gt 8 lt option gt lt option value 9 gt 9 lt option gt lt option value 10 gt 10 lt option gt lt option value 11 gt 11 lt option gt lt option value 12 gt 12 lt option gt lt option value 13 gt 13 lt option gt lt option value 14 gt 14 lt option gt lt option value 15 gt 15 lt option gt lt option value 16 gt 16 lt option gt lt option value 17 gt 17 lt option gt lt option value 18 gt 18 lt option gt lt option value 19 gt 19 lt option gt lt option value 20 gt 20 lt option gt lt option value 21 gt 21 lt option gt lt option value 22 gt 22 lt option gt lt option value 23 gt 23 lt option gt lt option value 24 gt 24 lt option gt lt option value 25 gt 25 lt option gt lt option value 26 gt 26 lt option gt lt option value 27 gt 27 lt option gt lt option value 28 gt 28 lt option gt lt option value 29 gt 29 lt option gt lt option value 30 gt 30 lt option gt lt option value 31 gt 31 lt option gt lt select gt lt br gt lt label class text gt Repeat lt select name repeat gt lt option value 0 gt No Repeat lt option gt lt option value 1 gt Hourly lt option gt lt option value 2 gt Daily lt option gt lt option value 3 gt Weekly lt option gt lt option value 4 gt Monthly lt
10. r CLAMAV Antivirus We also added scope to put a timer on the website so you can turn on any outlet at any time of the day you want in the future Budget In the project charter we estimated that the total cost of this project would be 8090 We ended up paying 185 for the hardware that was needed and we only budgeted for 110 In the project charter we estimated that it would take 390 hours to complete this project and that would cost a total of 7980 with a 20 hour wage We actually completed the project in 250 hours which is a total of 5000 for wages Our initial budget was 8090 and we were able to finish the project using only 5185 for a total savings of 2905q 4 PAGE Conclusion The project was completed without many problems The team learned many valuable skills along the way such as Python and a stronger understanding of electrical circuits principles and components The team worked efficiently and were able to finish the project well within the budget The project itself works as it was outlined in the charter but with some added functionality to the project s website Overall the project was a great experience for the team the lessons learned will greatly prepare us for work in the IT industry 5 PAGE Appendices Appendix A User Manual Webpage Option Login The user must be on the proper network and then navigate to 10 0 1 17 cgi bin login php This page currently works with Safari and Chrome Us
11. raspberry pi in raspbian http electronics stackexchange com guestions 76682 shorting a remote control pushbutton with gpio and a transistor https sites google com site semilleroadt raspberry pi tutorials gpio http en wikipedia org wiki Raspberry_Pi http Www instructables com id Building robots with Raspberry Pi and Python http raspberrypi stackexchange com guestions 1247 what should be done to secure raspberry pi http Www bartbania com index php iptables security part ii http theos in desktop linux removing unwanted startup debian files or services http www debian administration org articles 56 http www clamav net lang en 21 PAGE 22 P A G E
12. the hardware aspects of this project and was also the main person creating the project documentation Achievements Before this project began none of the team members had ever worked with Raspberry Pi s before There was a small learning curve to understanding the pins on the RPi Along with learning how to work with the RPi was learning how to code in Python Learning Python was not very difficult but it is a little different than the Java and Perl learned at SAIT The team also had to achieve a better understanding of electrical circuits and electrical components in order to solder the RPi to the receiver and the remote 3 PAGE Project Outline Our project utilizes a small computing device called the Raspberry Pi in order to control power outlets remotely This allows us to turn on a light coffee maker computer and many other electrical devices from a web page on our computers or smartphones Our system also has the ability for events to be scheduled If you want your office lights to turn on at 9 AM and off at 5 PM simply the rules on the web page We also added a motion sensor to the project This feature allows the power outlets to turn on when motion is detected and if no motion is detected for a certain amount of time then they will turn off Project Scope Solder outlet remote to RP sensor receiver to RP Programming Web Pages buttons to turn on off outlets RP scripts Server DNS role VNCViewer Web Serve
13. time sleep 0 1 wiringpi digitalWrite 18 0 wiringpi pinMode 18 0 18 PAGE pulse22 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 4 wiringpi wiringPiSetupSys wiringpi pinMode 22 1 wiringpi digitalWrite 22 1 time sleep 0 1 wiringpi digitalWrite 22 0 wiringpi pinMode 22 0 pulse23 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 3 wiringpi wiringPiSetupSys wiringpi pinMode 23 1 wiringpi digitalWrite 23 1 time sleep 0 1 wiringpi digitalWrite 23 0 wiringpi pinMode 23 0 pulse24 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 2 wiringpi wiringPiSetupSys wiringpi pinMode 24 1 wiringpi digitalWrite 24 1 time sleep 0 1 wiringpi digitalWrite 24 0 wiringpi pinMode 24 0 19 PAGE pulse25 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 1 wiringpi wiringPiSetupSys wiringpi pinMode 25 1 wiringpi digitalWrite 25 1 time sleep 0 1 wiringpi digitalWrite 25 0 wiringpi pinMode 25 0 20 PAGE Appendix C Bibliography http www cs colostate edu helpdocs ftp html http blog newfocusphoto com projects arduino based camera control http raspi tv 2013 how to use wiringpi2 for python on the
14. ute hour day month week var www cgi bin pulse17 py PHP_EOL if isset POST outletTwo if POST onoff 1 job minute hour day month week var www cgi bin pulse22 py PHP_EOL else job minute hour day month week var www cgi bin pulse24 py PHP_EOL if isset _POST outletThree if POST onoff 1 job minute hour day month week var www cgi bin pulse23 py PHP_EOL else job minute hour day month week var www cgi bin pulse18 py PHP_EOL output file_get_contents file output job 16 PAGE file_put_contents file output echo exec crontab home pi mycron txt gt lt body gt lt html gt 17 PAGE sensor py usr bin python import time import wiringpi wiringpi wiringPiSetupSys wiringpi pinMode 4 0 pulse17 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 5 wiringpi wiringPiSetupSys wiringpi pinMode 17 1 wiringpi digitalWrite 17 1 time sleep 0 1 wiringpi digitalWrite 17 0 wiringpi pinMode 17 O pulse18 py usr bin python import time import wiringpi wiringpi wiringPiSetup wiringpi wiringPiSetupGpio time sleep 0 6 wiringpi wiringPiSetupSys wiringpi pinMode 18 1 wiringpi digitalWrite 18 1

Download Pdf Manuals

image

Related Search

Related Contents

  Advanced classweb Installation  MAP Check Combi/Combi II (PFC)  FW550 three-quarter fridge with ice box      FIREFLY 808 UNIVERSAL  Xerox Phaser 3320 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file