Sie sind auf Seite 1von 70

SlideShareExploreSearchYou

Upload
Login
Signup
Search

Home
Technology
Education
MoreTopics
ForUploaders
CollectLeads
GetStarted
Tips&Tricks
Tools
ForBusiness
Search

ONENETisanopensourcestandardforwirelessnetworkdesignedforlowcost,lowpower(batteryoperated)controlnetwork...

suchason/offmessages.Simpletransactionsuseencryptiontechniquestoavoidsusceptibilitytoreplayattacks.Blocktra...

Figure2.1:StraightcableconnectionbetweenRS232DB9DTEandRS232DB9DCEFigure2.2:Straightcableconnectionbetwe...

Figure2.3:StraightcableconnectionbetweenRS232DB9DTEandRS232DB25DCEFigure2.4:Crossovercableconnectionbet...

Figure2.5:CrossovercableconnectionbetweenDB25DCEandDB25DCEFigure2.6:CrossovercableconnectionbetweenDB9D...

2.4.3EthernetEthernetdefinesanumberofwiringandsignallingstandardsforthephysicalconnectionoftwoormoredevic...

interconnected.AndduetotheubiquityofEthernet,theeverdecreasingcostofthehardwareneededtosupportit,andthe...

unlicensedIndustrial,ScientificandMedical(ISM)2.4GHzshortrangeradiofrequencyband.TheBluetoothspecifications...

mostpopularstandardformobilephonecommunicationintheworld.Itisusedbyoverthreebillionpeopleacrossmorethan...

suchasautomobileenginecontrolsystems,remotecontrols,officemachines,appliances,powertoolsandtoys.Hence,micro...

theprogrammemorybus.Ifthefetchedinstructionrequiresanoperationondatamemory,theCPUcanfetchthenextprogram...

CHAPTERTHREEMETHODOLOGYIndesigningahomeautomationsystem,oneormoresuitableplatformsareusedinordertobuilda...

3.1.2SelectionofhardwarecomponentsEachplatformhasasetofhardwarecomponentsoverwhichitisimplemented.ForRS23...

Figure3.1:Blockdiagramofthehomeautomationsystem3.2.1PIC18F4455PIC18F4455ismanufacturedbyMicrochipIncorporat...

andparallelports,timersandsometimesotherbuiltinperipheralssuchasA/D(analoguetodigital)andD/A(digitaltoa...

3.2.1.2RandomAccessMemory(RAM)TheRAM,randomaccessmemory,isusedtowriteandreaddatavaluesasaprogramruns.R...

asynchronousmodes.TheparallelI/Oportsrequireadatalineforeachbitinabyte,whiletheserialI/Ousesasingled...

24576Bytesflashprogrammemory,Capableof12288instructionset,2048BytesofDatamemory,256BytesofDataEEPR...

Figure3.4:PIC18F4455blockdiagram42

3.2.3PIC18F4455programmingFigure3.4isadetailedblockdiagramofthePIC4455.Inprogrammingit,acomplierandaprog...

Figure3.6:MikroElectronikaprogrammerinterface3.2.4Nokia6021Nokia6021,showninfigure3.7,isanEDGE(EnhancedDa...

shortandmultimediamessageservice(SMS/MMS)andwirelessapplicationprotocol(WAP).ItalsohasanRS232datacablecal...

Figure3.8:HIN232pinoutItrequiresasingle+5Vpowersupplyandfeatureonboardchargepumpvoltageconverterswhichge...

3.2.6RelayRelayisasmallelectricalswitchconsistingofanelectromagnet(coil),aswitchandaspring,thatopensand...

ContactorrelayThisisaveryheavydutyrelayusedforswitchingelectricmotorsandlightingloads.Highcurrentcon...

CHAPTERFOURDESIGNANDIMPLEMENTATIONThedesignofthisprojectinvolvedcouplingseveralhardwarecomponentsandtestinga...

Setthecommunicationparametersliketheclockrate(20MHz),thebaudrate(9600bits/s),thetransmitpin(PINC6)and...

Afterthecompletionofthehardwarecoupling,severaltestsweredoneonthedesign.Someobservationsandcorrectionswer...

mayeasilybreak,apapermaterialwhichmaygiveintostrainandstress,orevenametallicmaterialwhichwillmakethe...

Figure4.5:Theindividualcontrolhomeautomationsystem56

UpcomingSlideShare
Loadingin...5

10of72

MyFinalYearProjectIndividualControlHomeAutomationSystem
54,549
Share
Like
Download

MichaelOlafusi,BusinessDataAnalysisConsultant&MicrosoftExcelTrainer
Follow
7 73 0 9
PublishedonJun10,2013

Thisprojectinvolvesthedesignandconstructionofanindividualcontrolhome
automation
...

Publishedin:Technology
8Comments
55Likes
Statistics
Notes

FullName
Commentgoeshere.
12hoursagoDeleteReplySpamBlock
AreyousureyouwanttoYesNo
Yourmessagegoeshere

Shareyourthoughts...
Post

haymanotyehuala
canyouhelpme
8monthsagoReply
AreyousureyouwanttoYesNo
Yourmessagegoeshere

PeerasabHawaldar,HOD/LectureratTechnicalEducation
geniuseffortthis
12monthsagoReply
AreyousureyouwanttoYesNo
Yourmessagegoeshere

taralshahshah
Youcanalsodothisdirectlyviayourpcorlaptop,wiredorwireless.youcandoitwith8051orevenPIC16Fmicrocontrollers.
checkthetotalprojectincludingcode,simulationeverythinghere,
http://embeddedtweaks.wordpress.com/2014/10/29/controllingyourelectricalappliancesviapclaptoppicmicrocontroller/
and
http://embeddedtweaks.wordpress.com/2014/10/29/controllingyourelectricalappliancesviapclaptop8051microcontroller/
1yearagoReply
AreyousureyouwanttoYesNo
Yourmessagegoeshere

MuhammadBilalShahid,SalesAssistantatSpar,ThereForYOU
nicework.reallyhelpedmealotinconstructingmyautomationsystem.cheers
1yearagoReply
AreyousureyouwanttoYesNo
Yourmessagegoeshere

MichaelOlafusi,BusinessDataAnalysisConsultant&MicrosoftExcelTraineratUrBizEdge
Clickondownload.IthinkyoushoulduseaPC.
1yearagoReply
AreyousureyouwanttoYesNo
Yourmessagegoeshere
ShowMore

uroosaumer
3daysago

Nikhil_pk
3daysago

BridhitaChetry
1weekago

zizoha
1weekago

KaushalUpadhyay
2weeksago
ShowMore

NoDownloads
Views
TotalViews
54,549
OnSlideshare
0
FromEmbeds
0
NumberofEmbeds
5
Actions
Shares
89
Downloads
11,131
Comments
8
Likes
55
Embeds0
Noembeds
Nonotesforslide

MyFinalYearProjectIndividualControlHomeAutomationSystem

1. 1.INDIVIDUALCONTROLHOMEAUTOMATIONSYSTEMBYOLAFUSIMICHAELOLALEKANEEE/04/2995SUBMITTEDTOTHEDEPARTMENTOFELECTRICAL
ANDELECTRONICSENGINEERING,FEDERALUNIVERSITYOFTECHNOLOGY,AKURE.INPARTIALFULFILLMENTOFTHEREQUIREMENTFORTHEAWARD
OFBACHELOROFENGINEERING.OCTOBER,2009
2. 2.CERTIFICATIONThisistocertifythatthisproject,theentiredesignandconstructionofthehomeautomationsystemwascarriedoutandsubmittedastrueworkofOLAFUSI
MICHAELOLALEKANofmatriculationnumberEEE/04/2995underthesupervisionofEngineerO.E.BejideoftheDepartmentofElectricalandElectronicsEngineering,Federal
UniversityofTechnology,AkureinpartialfulfilmentoftherequirementsfortheawardofBachelorofEngineeringinElectricalElectronicsEngineering._____________________
_____________________EngineerO.E.BejideDate(ProjectSupervisor)____________________________________________Dr.A.O.MelodiDate(Headof
Department)____________________________________________ExternalSupervisorDateii
3. 3.DEDICATIONToGodAlmightyforHisprovisionandgraceTomyparentsfortheirconstantvitalsupportTomysiblingsfortheircareandplaceDoIdedicatethisreportiii
4. 4.ACKNOWLEDGEMENTIcannotbutacknowledgetheunquantifiablehelpGodgavemethroughoutthisprojectwork,alwaysshowingupwheneverIgottotheendofmyline
andfeltlikechangingtheprojecttoasimplerone.MostremarkablewasthebreakthroughHegavemewhenIwasstuckatonePICCcodefunctionforamonth!Iamdeeplyindebted
tomyparentsandsiblingsfortheirconstantsupportespeciallyincircumstanceswhereIfindithardtoevenconvincemyselfthatmyrequestforhelpisfairandreasonable.Iam
equallyindebtedmyveryunderstanding,fatherlyandenviableprojectsupervisor,EngineerO.E.Bejidewhoisalwayswillingtogoaboveandbeyondincounsellingandsupervising
me.Icouldnothavebeenabletounderstandhowtogoaboutthevitalaspectoftheprojectworkifnotforthesupervisoryassistanceofmyfriendandcolleague,AyoadeAdewole
(really,allaspectofmyprojectworkwasvital).Imustalsoacknowledgemycolleagueswhooverthefouryearswehavebeentogether,inwaystheythemselvesdonotunderstand,
havebeenthevitalcomponentsofmyeducationalandpersonalgrowthwhichalsogreatlyrubbedonmysuccessfulcompletionofthisprojectwork.Igreatlyappreciatethetripartite
supportandnourishmentIenjoyedfromtheentirefamilyoftheChapelofFaith,especiallythroughUncleVictorOmololu,AuntPatienceOmololuandtheirministry.Imustalso
acknowledgethespiritualoversightofthetwochaplainswhomIhavebeenunderthroughoutmyfiveyearundergraduatestudy,RevGbengaOlagunjuandRev.TimothyAbi
Abiola.iv
5. 5.ABSTRACTThisprojectinvolvesthedesignandconstructionofanindividualcontrolhomeautomationsystemusingRS232,GSMtechnologyandamicrocontroller.Home
automationistheautomaticorsemiautomaticcontrolandmonitoringofhouseholdappliancesandresidentialhousefeatureslikedoors,gateandeventhewindows.Thisprojectisa
demonstrationofhowtodesignandbuildamultipurposeremotelycontrolledsystemthatcanswitchOFFandONanyelectricalhouseholdappliance(includingthesecuritylight),by
diallingaphonealreadyinterfacedviaRS232toamicrocontrollerthatcontrolsarelayfortheautomaticswitchingonandoffoftheapplianceandthephonewillsendafeedbackshort
messageservicetextindicatingthenewstateoftheappliance,whetherswitchedONorOFF.Theresultsofthisprojectshowthatamicrocontrollerisaverypowerfuldevice
forbuildingsmartelectronicdevicesthatcanautomaticallycontrolelectricalappliances,withlittlecircuitrycomplexitiesandcomponents.v
6. 6.TABLEOFCONTENTSPROJECT
REPORT....................................................................................................................iCERTIFICATION......................................................................................................................iiDEDIC
OFCONTENTS..........................................................................................................viTABLEOF
FIGURES............................................................................................................viiiLISTOF
TABLES....................................................................................................................ixCHAPTER
ONE........................................................................................................................1INTRODUCTION......................................................................................................................11.1
AUTOMATION..........................................................................................................21.1.1Officeautomation...............................................................................................31.1.2
Buildingautomation...........................................................................................31.1.3Powerautomation...............................................................................................41.1.4Home
automation................................................................................................41.2PROJECTAIM...........................................................................................................41.3PROJECT
OBJECTIVE.............................................................................................51.4PROJECTSCOPEANDLIMITATION.....................................................................51.5PROJECT
JUSTIFICATION......................................................................................51.6REPORTLAYOUT.....................................................................................................6CHAPTER
TWO.......................................................................................................................7LITERATUREREVIEW...........................................................................................................72.1
HISTORYOFHOMEAUTOMATION.....................................................................72.2HOMEAUTOMATIONSYSTEMS..........................................................................72.3
HOMEAUTOMATIONSTANDARDS....................................................................92.3.1INSTEONstandard...........................................................................................102.3.2
EuropeanHomeSystems(EHS)protocol........................................................112.3.3ZigBeestandard................................................................................................122.3.4KNX
.................................................................................................................132.3.5ZWavestandard...............................................................................................152.3.6X10
standard.....................................................................................................182.3.7LonWorks.........................................................................................................202.3.8ONENET
standard...........................................................................................202.3.9UniversalPowerlineBus...................................................................................222.4HOMEAUTOMATION
IMPLEMENTATIONPLATFORMS.................................242.4.1Powerlinecommunication..................................................................................242.4.2
RS232.................................................................................................................252.4.3Ethernet...............................................................................................................292.4.4
Bluetooth.............................................................................................................302.4.5Infrared...............................................................................................................312.4.6
GSM....................................................................................................................312.4.7Microcontroller...................................................................................................322.3.7.1Von
Neumannarchitecture.........................................................................332.3.7.2Harvardarchitecture...................................................................................33vi
7. 7.CHAPTERTHREE..................................................................................................................35METHODOLOGY
..................................................................................................................353.1PRELIMINARYCONSIDERATIONS......................................................................353.1.1Selectionof
implementationplatform................................................................353.1.2Selectionofhardwarecomponents.....................................................................363.2SYSTEM
DESIGN......................................................................................................363.2.1PIC18F4455.........................................................................................................373.2.1.1Central
ProcessingUnit(CPU)..................................................................383.2.1.2RandomAccessMemory(RAM)..............................................................393.2.1.3ReadOnlyMemory
(ROM).......................................................................393.2.1.4InputandOutputports(I/O)......................................................................393.2.2PIC18F4455
architecture...................................................................................403.2.3PIC18F4455programming................................................................................433.2.4Nokia
6021.........................................................................................................443.2.5HIN232..............................................................................................................453.2.6
Relay..................................................................................................................47CHAPTERFOUR....................................................................................................................49DESIGN
ANDIMPLEMENTATION......................................................................................494.1BUILDINGTHEPOWERSUPPLYANDINTERFACINGTHERELAY.............504.2
SERIALCOMMUNICATIONBETWEENTHEMICROCONTROLLERANDNOKIA6021............................................................................................................514.3
PROGRAMMINGTHEMICROCONTROLLER...................................................524.4TESTINGTHECOMPLETEDESIGNAND

CASING...........................................53CHAPTERFIVE......................................................................................................................57CONCLUSIONAND
RECOMMENDATION........................................................................575.1CONCLUSION..........................................................................................................575.2
RECOMMENDATION..............................................................................................57REFERENCES.........................................................................................................................59APPE
I:Billofcomponents...........................................................................................61APPENDIXII:ThePICCcodeforprogrammingthePIC4455inCCSCcompiler..............62vii
8. 8.TABLEOFFIGURESFigure2.1:StraightcableconnectionbetweenRS232DB9DTEandRS232DB9DCE.......26Figure2.2:StraightcableconnectionbetweenRS232DB25
DTEandRS232DB25DCE...26Figure2.3:StraightcableconnectionbetweenRS232DB9DTEandRS232DB25DCE.....27Figure2.4:CrossovercableconnectionbetweenDB9
DTEandDB9DCE...........................27Figure2.5:CrossovercableconnectionbetweenDB25DCEandDB25DCE.......................28Figure2.6:Crossovercableconnectionbetween
DB9DCEandDB9DCE...........................28Figure3.1:Blockdiagramofthehomeautomationsystem....................................................37Figure3.2:Interactionsbetweenthemain
microcontrollerparts............................................38Figure3.3:40PinPIC18F4455microcontroller.....................................................................40Figure3.4:PIC18F4455block
diagram...................................................................................42Figure3.5:CCSCcompilerIDEinterface..............................................................................43Figure3.6:
MikroElectronikaprogrammerinterface...............................................................44Figure3.7:Nokia6021mobilephone......................................................................................45Figure
3.8:HIN232pinout.......................................................................................................46Figure4.1:Flowchartofthe
design........................................................................................49Figure4.2:Thepowersupply...................................................................................................50Figure4.3:TheRS232
tomicrocontrollerportionofthedesign.............................................52Figure4.4:Thecompletehomeautomationsystemcircuit(controllinglightingfixture).......55Figure4.5:The
individualcontrolhomeautomationsystem..................................................56viii
9. 9.LISTOFTABLESTable2.1:ListofX10fourbitcommands...............................................................................19Table3.1:HIN232pin
descriptions.........................................................................................46ix
10. 10.CHAPTERONEINTRODUCTIONImaginehowhelpfulitwillbetobeabletoswitchonyourairconditioningsystemtenminutesbeforeyougethomeonahotafternoonin
January.Howabouthavingasecuritysystemthatwilldetectsmoke,excessiveelectricalpowerusage,burglarattemptsandunauthorizedmovementsinyourhouseandalertyou?This
iswhathomeautomationisaboutandthereisnoendtoitsapplication.Infact,sophisticatedhomeautomationsystemsarenowbeingdevelopedthatcanmaintainaninventoryof
householditems,recordtheirusagethroughanRFID(RadioFrequencyIdentification)tag,andprepareashoppinglistorautomaticallyorderreplacements.Homeautomationhas
madeitpossibletohavewhatisoftenreferredtoasasmarthome,ahomethatcandetectandidentifyyou,automaticallyadjustthelightingtoyourpredefinedtaste,opendoors
automatically,playyourfavouritemusic,wateryourflowersinthemorning,switchonthesecuritylightsatnightandswitchthemoffinthemorning,heatwaterforbatheandtea,
streamtoyouanywhereintheworldviatheinternetalivevideoofwhatishappeninginandaroundyourhouse.Itmakesitpossibletolinklighting,entertainment,security,
telecommunications,heating,andairconditioningintoonecentrallycontrolledsystem.Thisallowsyoutomakeyourhouseanactivepartnerinmanagingyourbusylife.Nowadays,
youcanhardlyfindahousewithoutahomeautomationsystemwhichcanrangefromtheremoteforthetelevision,burglaralarmandhitechsecuritygates,toanautomatedair
conditioningsystemthatmaintainsthetemperatureatapredefinedvalue.1
11. 11.1.1AUTOMATIONAutomationistheuseofcontrolsystemsandinformationtechnologytocontrolequipment,industrialmachineryandprocesses,reducingtheneedfor
humanintervention.Inthescopeofindustrialization,automationisastepbeyondmechanization.Mechanizationprovidedhumanoperatorswithmachinerytoassistthemwiththe
physicalrequirementsofworkwhileautomationgreatlyreducestheneedforhumansensoryandmentalrequirementsaswell(Wikipedia,2009).Automationplaysanincreasingly
importantroleintheglobaleconomyandindailyexperience.Engineersstrivetocombineautomateddeviceswithmathematicalandorganizationaltoolstocreatecomplexsystemsfor
arapidlyexpandingrangeofapplicationsandhumanactivities.Manyrolesforhumansinindustrialprocessespresentlyliebeyondthescopeofautomation.Humanlevelpattern
recognition,languagerecognition,andlanguageproductionabilityarewellbeyondthecapabilitiesofmodernmechanicalandcomputersystems.Tasksrequiringsubjective
assessmentorsynthesisofcomplexsensorydata,suchasscentsandsounds,aswellashighleveltaskssuchasstrategicplanning,currentlyrequirehumanexpertise.Automationhas
hadanotableimpactinawiderangeofhighlyvisibleindustriesbeyondmanufacturing.Onceubiquitoustelephoneoperatorshavebeenreplacedlargelybyautomatedtelephone
switchboardsandansweringmachines.Medicalprocessessuchasprimaryscreeninginelectrocardiographorradiographyandlaboratoryanalysisofhumangenes,bloodplasmas,
cells,andtissuesarecarriedoutatmuchgreaterspeedandaccuracybyautomatedsystems.Automatedteller2
12. 12.machineshavereducedtheneedforbankvisitstoobtaincashandcarryouttransactions.Ingeneral,automationhasbeenresponsiblefortheshiftintheworldeconomyfrom
agrariantoindustrialinthe19thcenturyandfromindustrialtoservicesinthe20thcentury.1.1.1OfficeautomationOfficeautomationreferstothevariedcomputermachineryand
softwareusedtodigitallycreate,collect,store,manipulate,andrelayofficeinformationneededforaccomplishingbasictasksandgoals.Rawdatastorage,electronictransfer,and
themanagementofelectronicbusinessinformationcomprisethebasicactivitiesofanofficeautomationsystem,officeautomationhelpsinoptimizingorautomatingexistingoffice
procedures.1.1.2BuildingautomationBuildingautomationdescribesthefunctionalityprovidedbythecontrolofabuilding.Thecontrolsystemisacomputerized,intelligentnetwork
ofelectronicdevices,designedtomonitorandcontrolthemechanicalandlightingsystemsofabuilding.Abuildingautomationsystemisanexampleofadistributedcontrol
system.Thebuildingautomationsystem(BAS)corefunctionalitykeepsthebuildingclimatewithinaspecificrange,provideslightingbasedonanoccupancyschedule,andmonitors
systemperformanceanddevicefailuresandprovidesemailand/ortextnotificationstobuildingengineeringstaff.TheBASfunctionalityreducesbuildingenergyandmaintenance
costswhencomparedtoanoncontrolledbuilding.3
13. 13.1.1.3PowerautomationPowerautomationistheautomatedcontrolandmonitoringofpowerplants,substationsandtransformersforeffectiveness,efficiencyandfaultdetection.
Ithasmadeitpossibletohaveareliablemunicipalornationalelectricitysystem,whichoftencomprisesremoteandhardtoreachtransformersandpowersubsystemunits.Itmakesit
possibletomonitordifferentpowerunits,relaytheirstatusandhealthinformation,andevencarryoutfaultdetectionandcorrectionwithouthumaninterference.Exampleofpower
automationsystemistheSupervisoryControlandDataAcquisition(SCADA)system.1.1.4HomeautomationHomeautomationmaydesignateanemergingpracticeof
increasedautomationofhouseholdappliancesandfeaturesinresidentialdwellings,particularlythroughelectronicmeansthatallowforthingsimpracticable,overlyexpensive
orsimplynotpossibleinrecentdecades.Homeautomationincludesallthatabuildingautomationprovideslikeclimatecontrols,doorandwindowcontrols,andinadditioncontrolof
multimediahometheatres,petfeeding,plantwateringandsoon.Butthereexistsadifferenceinthathomeautomationemphasizesmoreoncomfortsthroughergonomicsandeaseof
operation.1.2PROJECTAIMTheaimofthisprojectistodesignandconstructahomeautomation4
14. 14.systemthatwillremotelyswitchonoroffanyhouseholdapplianceconnectedtoit,usingamicrocontroller,voicedialonphone,andshortmessageserviceforfeedback.1.3
PROJECTOBJECTIVETheobjectiveofthisprojectistoimplementalowcost,reliableandscalablehomeautomationsystemthatcanbeusedtoremotelyswitchonoroff
anyhouseholdappliance,usingamicrocontrollertoachievehardwaresimplicity,lowcostshortmessageservice(SMS)forfeedbackandvoicedialfromanyphonetotogglethe
switchstate.1.4PROJECTSCOPEANDLIMITATIONThisprojectworkiscompleteonitsowninremotelyandautomaticallyswitchingonandoffofanyelectricalappliancenot
limitedtohouseholdappliances,andsendsafeedbackmessageindicatingthenewpresentstateoftheappliance.Itdoesnotimplementcontrolofmultipleappliancesorautomatic
detectionoffaultsinthecontrolledappliance.1.5PROJECTJUSTIFICATIONThisprojectisofcontributoryknowledgetothedevelopmentandimplementationofhomeautomation
systemsinNigeriausinglowcost,locallyavailablecomponentslikemicrocontroller,freevoicedialservice(popularlyreferredtoasflashing)andverycheapshortmessageservice
(SMS)text.5
15. 15.1.6REPORTLAYOUTTheentireprojectiscomposedoffivechapters,eachcoveringasectionoftheworkassummarizedbelow:Chapteronegivesanintroductionto
automationasawholeandthedifferenttypesofautomation.Chaptertwocoversanextensiveliteraturereviewofpreviousworksonhomeautomationsystems,thedifferent
establishedstandardsandprotocols,andtheplatformsoverwhichhomeautomationcanbeimplemented.Chapterthreehighlightstheprojectmethodology,givingreasonsfor
choiceofspecificplatformsandcomponents,andalso,comprehensivedetailsonbothhardwarecomponentsandcommunicationservicesused.Chapterfourisontheprojectdesign
andimplementationwithclearpracticaldetailsoftheprojectdesign,construction,testing,microcontrollercodinganddebugging.Specialemphasisisalsomadeontheflexibility
andscalabilityoftheprojectworkwithreallifeillustration.Chapterfiveisontheconclusionandrecommendationsbasedontheprojectworkwithemphasisonthereliability,
maintainabilityandflexibilityofthedesign.Also,recommendationsbasedonthechallengesencounteredandfurtherpossibledevelopmentoftheprojectworkareenumerated.6
16. 16.CHAPTERTWOLITERATUREREVIEW2.1HISTORYOFHOMEAUTOMATIONHomeautomationhasbeenaroundsincetheworldwar1(1914),infact,thetelevision
remote(asimplehomeautomationsystem)waspatentedin1893(Wikipedia,2009).Sincethendifferenthomeautomationsystemshaveevolvedwithasharpriseafterthesecond
WorldWar.Itsgrowthhasbeenthroughvariousinformalresearchanddesignsbytechnologyenthusiastswhowantabetterwayofgettingthingsdoneathomewithoutmuchefforton
theirpart.Thesystemsevolvedfromonethatcanautomaticallydoroutinechoreslikeswitchonandoffsecuritylights,tomoresophisticatedonesthatcanadjustlighting,putthe
televisionchanneltofavouritestationandcontroldoors.2.2HOMEAUTOMATIONSYSTEMSHomeautomationsystemsmaydesignateelectronicsystemsinhomesandresidential
buildingsthatmakepossibletheautomationofhouseholdappliances.Thenewstreamofhomeautomationsystemshasdevelopedintoavastoneandthecurrentmarketisflooded
withaflurryofhomeautomationsystemsanddevicemanufacturers.Thetypesofhomeautomationsystemsbasedontheircontrolsystemsare:1.IndividualControlSystems7
17. 17.Thesetypeswerethefirsttohitthemarketintheearlyyears,hereeachdeviceliketheheaterortheairconditionerwillhaveanindependentcontroldedicatedtoit.2.Distributed
ControlSystemsThemainfeatureofthesetypeofsystemsisemergencyshutdown.Withthissystemyoucanpresetorchangethecontrolparametersofseveralsimilardevices,for
example,thethermostatofseveralairconditionersandtheirON/OFFtimings.3.CentralControlSystemsThesearecomputerizedsystemsprogrammedtohandleallfunctions
ofmultipleutilitieslikeairconditioningsystem,homeentertainments,doors,windows,refrigeratorsandcookingsystems,allatthesametimeregardlessofwhetheryouareathomeor
away.Youcanconnecttothecontrolsystemthroughtelephoneorinternetfromanywhereintheworld.Thetypesofhomeautomationsystemsbasedonthecarriermodeare:1.
PowerlinecarrierSystemsTheleastexpensivetypeofhomeautomationsystemoperatesoverthehomesexistingwiring,orpowerlinecarrier.ThesecanrangefromX10basedlamp
timers,tomoresophisticatedsystemsthatrequireinstallationbyatrainedprofessional.8
18. 18.2.WirelesssystemsAlsoavailablearewirelesshomeautomationsystemsthatutilizeradiofrequencytechnology.Theyareoftenusedtooperatelights,sometimesinconjunction
withahardwiredlightingcontrolsystem.3.HardwiredsystemsWired,orhardwiredhomecontrolsystemsarethemostreliableandexpensive.Thesesystemscanoperateoverhigh
gradecommunicationscablesuchasCategory5or5e,ortheirownproprietarybuscable.Thatiswhyitisbesttoplanforthemwhenahouseisbeingconstructed.
Hardwiredsystemscanperformmoretasksatatimeanddothemquicklyandreliably,makingthemidealforlargerhomes.Theycanalsointegratemoresystemsinthehome,
effectivelytyingtogetherindoorandoutdoorlighting,audioandvideoequipment,securitysystem,eventheheatingandcoolingsystemintoonecontrolpackagethatwillbeeasyand

intuitivetooperate.4.InternetProtocolcontrolsystemInternetProtocol(IP)controlautomationsystemusestheinternet,giveseachdeviceunderitscontrolanInternetProtocol
address,andcreatesalocalareanetwork(LAN)inthehome.Hence,thehomecanbeinteractedwithovertheinternetwithpossibilityoflivevideostreamingandrealtimecontrol.2.3
HOMEAUTOMATIONSTANDARDS9
19. 19.Therearemanyestablishedindustrystandardsforhomeautomationsystemsandareimplementedoverthevariouscarriermodesrangingfrompowerlinetowireless.Thepopular
andmajorstandardsareINSTEON,EuropeanHomeSystems(EHS),ZigBee,KNX,ZWave,X10,LonWorks,ONENETandUniveraslPowerlineBus(UPB).2.3.1INSTEON
standardINSTEONstandardisadualbandmeshtopologyemployingacpowerlinesandaradiofrequency(RF)protocoltocommunicatewithandautomatehomeelectronicdevices
andappliances,whichnormallyworkindependently.ItisahomeautomationnetworkingtechnologyinventedbySmartLabsInc.INSTEONwasdeveloped,basedontheX10model,
forcontrolandsensingapplicationsinthehome(Wikipedia,2009).INSTEONisdesignedtoenablesimpledevicestobenetworkedtogetherusingthepowerlineand/orradio
frequency(RF).AllINSTEONdevicesarepeers,meaningeachdevicecantransmit,receive,andrepeatanymessageoftheINSTEONprotocol,withoutrequiringamastercontroller
orcomplexroutingsoftware.INSTEONisnotonlyaneffectivesystemforconnectinglightingswitchesandloadswithoutextrawiring,butitalsoformsthebasisforamore
sophisticatedhomeautomationnetwork.ThefollowingarethepossibleapplicationsofINSTEON:Sceneandremotecontrollighting,10
20. 20.Securityalarminterfacesandsensors,Homesensors(e.g.water,humidity,temperature),Accesscontrol(e.g.doorlocks),Heating,ventilatingandaircooling(HVAC)
control,Audiovideocontrol,andAppliancemanagement.2.3.2EuropeanHomeSystems(EHS)protocolTheEuropeanhomesystems(EHS)protocolwasaimedathomeappliances
controlandcommunicationusingpowerlinecommunication(PLC).DevelopedbyEHSA(EuropeanHomeSystemsAssociation)itwasmergedwithtwootherprotocolstoformthe
KNXprotocol,whichcomplieswithCENELECnormEN50090standardandhadachancetobeabasisforthefirstopenstandardforhomeandbuildingcontrol(Wikipedia,
2009).TheareasofapplicationofEHSare:Heating,ventilatingandaircooling(HVAC)control,Sceneandremotecontrollighting,andAppliancemanagement.11
21. 21.2.3.3ZigBeestandardZigBeeisaspecificationforasuiteofhighlevelcommunicationprotocolsusingsmall,lowpowerdigitalradiosbasedontheIEEE802.15.42003standard
forwirelesspersonalareanetworks(WPANs),suchaswirelessheadphonesconnectingwithcellphonesviashortrangeradio.ThetechnologydefinedbytheZigBeespecificationis
intendedtobesimplerandlessexpensivethanotherWPANssuchasBluetooth.ZigBeeistargetedatradiofrequency(RF)applicationsthatrequirealowdatarate,longbatterylife,
andsecurenetworking(Wikipedia,2009).ZigBeeisalowcost,lowpower,wirelessmeshnetworkingstandard.Thelowcostallowsthetechnologytobewidelydeployedinwireless
controlandmonitoringapplications,thelowpowerusageallowslongerlifewithsmallerbatteries,andthemeshnetworkingprovideshighreliabilityandlargerrange.ZigBeeoperates
intheindustrial,scientificandmedical(ISM)radiobands868MHzinEurope,915MHzintheUSAandAustralia,and2.4GHzinmostjurisdictionsworldwide.ZigBeechip
vendorstypicallysellintegratedradiosandmicrocontrollerswithbetween60Kand128Kflashmemory,suchastheFreescaleMC13213,theEmberEM250andtheTexasInstruments
CC2430.Radiosarealsoavailableasstandalonetobeusedwithanyprocessorormicrocontroller.Generally,thechipvendorsalsooffertheZigBeesoftwarestack,although
independentonesarealsoavailable.TheZigBeeAllianceisagroupofcompaniesthatmaintainandpublishtheZigBeestandard.TypicalareasofapplicationofZigBeeare:12
22. 22.HomeEntertainmentandControlSmartlighting,advancedtemperaturecontrol,safetyandsecurity,moviesandmusic,HomeAwarenessWatersensors,powersensors,
smokeandfiredetectors,smartappliancesandaccesssensors,MobileServicesmpayment,mmonitoringandcontrol,msecurityandaccesscontrol,mhealthcareandtele
assist,CommercialBuildingEnergymonitoring,HVAC,lighting,accesscontrol,andIndustrialPlantProcesscontrol,assetmanagement,environmentalmanagement,energy
management,industrialdevicecontrol.2.3.4KNXKNXisastandardised(EN50090,ISO/IEC14543),OSIbasednetworkcommunicationsprotocolforintelligentbuildings.KNXis
thesuccessorto,andconvergenceof,threepreviousstandards:theEuropeanHomeSystemsProtocol(EHS),BatiBUS,andtheEuropeanInstallationBus(EIB).TheKNXstandard
isadministeredbytheKonnexAssociation(Wikipedia,2009).ThisstandardisbasedonthecommunicationstackofEIBbutenlargedwiththephysicallayers,configurationmodes
andapplicationexperienceofBatiBUSandEHS.13
23. 23.KNXdefinesseveralphysicalcommunicationmedia:TwistedpairwiringPowerlinenetworkingRadioInfraredEthernet(alsoknownasEIBnet/IPorKNXnet/IP)KNXis
designedtobeindependentofanyparticularhardwareplatform.AKNXDeviceNetworkcanbecontrolledbyanythingfroman8bitmicrocontrollertoaPC,accordingtotheneeds
ofaparticularimplementation.Themostcommonformofinstallationisovertwistedpairmedium.KNXisapprovedasanopenstandardtoInternationalstandard(ISO/IEC145433)
EuropeanStandard(CENELECEN50090andCENEN133211)andChinaGuoBiao(GB/Z20965).KNXhasmorethan100members/manufacturersincludingABB,Bosch,Miele
&CieKG,ONSemiconductor,SchneiderElectricIndustriesS.A.,Siemens,UponorCorporationandJung.TherearethreecategoriesofKNXdevice:1.Amodeor"Automaticmode"
devicesautomaticallyconfigurethemselves,andareintendedtobesoldtoandinstalledbytheenduser.14
24. 24.2.Emodeor"Easymode"devicesrequirebasictrainingtoinstall.Theirbehaviourispreprogrammed,buthasconfigurationparametersthatneedtobetailoredtotheusers
requirements.3.Smodeor"Systemmode"devicesareusedinthecreationofbespokebuildingautomationsystems.Smodedeviceshavenodefaultbehaviour,andmustbe
programmedandinstalledbyspecialisttechnicians.2.3.5ZWavestandardTheZwaveisawirelesscommunicationsproprietarystandarddesignedforhomeautomation,specifically
toremotecontrolapplicationsinresidentialandlightcommercialenvironments.Thistechnology,whichisdevelopedbySigmadesignsZensys,usesalowpowerRFradioembedded
orretrofittedintohomeelectronicsdevicesandsystems,suchaslighting,homeaccesscontrol,entertainmentsystemsandhouseholdappliances.Thetechnologyhasbeenstandardized
bytheZWaveAlliance,aninternationalconsortiumofmanufacturersthatoverseesinteroperabilitybetweenZWaveproductsandenableddevices(Wikipedia,2009).ZWaveisa
meshnetworkingtechnologywhereeachnodeordeviceonthenetworkiscapableofsendingandreceivingcontrolcommandsthroughwallsorfloorsandaroundhouseholdobstacles
orradiodeadspotsthatmightoccurinthehome.ZWavedevicescanworksinglyoringroups,andcanbeprogrammedintoscenesoreventsthattriggermultipledevices,either
automaticallyorviaremotecontrol.ZWaveisalowpowerwirelesstechnologydesignedspecificallyfor15
25. 25.remotecontrolapplications.UnlikeWiFiandotherIEEE802.11basedwirelessLANsystemsthataredesignedprimarilyforhighbandwidthdataflow,theZWaveRFsystem
operatesinthesubGigahertzfrequencyrangeandisoptimizedforlowoverheadcommandssuchasonoff(asinalightswitchoranappliance)andraiselower(asinathermostator
volumecontrol),withtheabilitytoincludedevicemetadatainthecommunications.BecauseZWaveoperatesapartfromthe2.4GHzfrequencyof802.11basedwirelesssystems,it
islargelyimpervioustointerferencefromcommonhouseholdwirelesselectronics,suchasWiFirouters,cordlesstelephonesandBluetoothdevicesthatworkinthesamefrequency
range.Thisfreedomfromhouseholdinterferenceallowsforastandardizedlowbandwidthcontrolmediumthatcanbereliablealongsidecommonwirelessdevices.Onotherhand,2.4
GHzfrequencyusageallowsunlicenseddevicesusageinmostcountriesthisisconvenienttocustomersandallowswidertechnologyadoptionandreduceddeploymentcosts.This
couldbenottrueforotherfrequenciesandcouldeasilyturnintoastrongdrawbackiflicensingisrequiredorfrequencyisoccupied.Thatsoneofreasonwhycompeting2.4GHz
technologiesbecamesopopular.Asaresultofitslowpowerconsumptionandlowcostofmanufacture,ZWaveiseasilyembeddedinconsumerelectronicsproducts,including
batteryoperateddevicessuchasremotecontrols,smokealarmsandsecuritysensors.ZWaveiscurrentlysupportedbyover200manufacturersworldwideandappearsinabroadrange
ofconsumerproductsintheU.S.andEurope.SomecommonapplicationsforZWaveinclude:RemoteHomeControlAndManagementByaddingZWaveto16
26. 26.homeelectronicssuchaslighting,climateandsecuritysystems,itispossibletocontrolandmonitorthesehouseholdfunctionsviaremotecontrol,basedonmanualorautomated
decisions.Thecontrolcanbeappliedtoasingledeviceorgroupofdevices,inasingleroomorzoneorthroughouttheentirehome.OneofthebenefitsofZWaveoverpowerline
communicationtechnologiesistheabilitytofunctioninolderhouseslackinganeutralwire.ZWavedevicescanalsobemonitoredandcontrolledfromoutsideofthehomebywayof
agatewaythatcombinesZWavewithbroadbandInternetaccess.EnergyConservationZWaveisenvisionedasakeyenablingtechnologyforenergymanagementinthegreen
home.Asanexample,ZWaveenabledthermostatsareabletoraiseorlowerautomatically,basedoncommandsfromZWaveenableddaylightsensors.Groupedscenecontrolscan
ensurethatunnecessaryenergyconsumptionisminimizedbyvariousalloffstatesforsystemsthroughoutthehome,suchaslighting,appliancesandhomeentertainmentsystems.
HomeSafetyAndSecuritySystemsBecauseZWavecantransceivecommandsbasedonrealtimeconditions,andisabletocontroldevicesinintelligentgroupings,itallowsnovel
extensionsoftraditionalhomesecurityconcepts.Asanexample,theopeningofaZWaveenableddoorlockcandeactivateasecuritysystemandturnonlightswhenchildrenarrive
homefromschool,andsendanotificationtoaparentsPCorcellphoneviatheInternet.OpeningaZWaveenabledgaragedoorcan17
27. 27.triggerexteriorandinteriorhomelights,whileaZWavemotiondetectorcantriggeranoutdoorsecuritylightandawebcam,whichwouldallowtheendusertomonitorthehome
whileaway.HomeEntertainmentZWavesabilitytocommandmultipledevicesasaunifiedeventmakesitwellsuitedforhomeaudioandvideoapplications.Forexample,a
simple"PlayDVD"commandontheremotecontrolcouldturnontheneededcomponents,setthemtothecorrectinputsandevenlowermotorizedshadesanddimtheroomlights.Z
WavesRFtechnologyisalsowellsuitedasanevolutionofconventionalInfrared(IR)basedremotecontrolsforhomeelectronics,asitisnotconstrainedbyIRslineofsightand
distancelimitations.InJanuaryof2008,ZensysannouncedasinglechipsolutionthatpairsZWavewithIRcontrol,positioningthetechnologyasanallencompassingsolution
forhomeremotecontrols.2.3.6X10standardX10isaninternationalandopenindustrystandardforcommunicationamongelectronicdevicesusedforhomeautomation.Itprimarily
usespowerlinewiringforsignallingandcontrol,wherethesignalsinvolvebriefradiofrequencyburstsrepresentingdigitalinformation.X10wasdevelopedin1975by
PicoElectronicsofGlenrothes,Scotland,inordertoallowremotecontrolofhomedevicesandappliances.Itwasthefirstgeneralpurposehomeautomationnetworktechnologyand
remainsthemostwidelyavailable.AlthoughanumberofhigherbandwidthalternativesexistincludingKNX,INSTEON,BACnet,andLonWorks,X10remains18
28. 28.popularinthehomeenvironmentwithmillionsofunitsinuseworldwide,andinexpensiveavailabilityofnewcomponents(Wikipedia,2009).PacketstransmittedusingX10
controlprotocolconsistofafourbithousecodefollowedbyoneormorefourbitunitcode,finallyfollowedbyafourbitcommand.Table2.1:ListofX10fourbitcommandsCode
FunctionDescription0000AllUnitsOffSwitchoffalldeviceswiththehousecodeindicatedinthemessage0001AllLightsOnSwitchesonalllightingdevices(withtheabilityto
controlbrightness)0010OnSwitchesonadevice0011OffSwitchesoffadevice0100DimReducesthelightintensity0101BrightIncreasesthelightintensity0111Extended
CodeExtensioncode1000HailRequestRequestsaresponsefromthedevice(s)withthehousecodeindicatedinthemessage1001HailAcknowledgeResponsetotheprevious
command101xPresetDimAllowstheselectionoftwopredefinedlevelsoflightintensity1101StatusisOnResponsetotheStatusRequestindicatingthatthedeviceisswitched
on1110StatusisOffResponseindicatingthatthedeviceisswitchedoff1111StatusRequestRequestrequiringthestatusofadevice19
29. 29.2.3.7LonWorksLonWorksisanetworkingplatformspecificallycreatedtoaddresstheneedsofcontrolapplications.Theplatformisbuiltonaprotocolcreatedby
EchelonCorporationfornetworkingdevicesovermediasuchastwistedpair,powerlines,fibreoptics,andradiofrequency.Itisusedfortheautomationofvariousfunctionswithin
buildingssuchaslightingandHVAC(Heating,ventilatingandairconditioning).Thistechnologyhasitsoriginswithchipdesigns,powerlineandtwistedpair,signallingtechnology,
routers,networkmanagementsoftware,andotherproductsfromEchelonCorporation.Twophysicallayersignallingtechnologies,twistedpairandpowerlinecarrier,aretypically
includedineachofthestandardscreatedaroundtheLonWorkstechnology.Thetwowirelayeroperatesat78kbit/susingdifferentialmanchesterencoding,whilethepowerline
achieveseither5.4or3.6kbit/s,dependingonfrequency.Additionally,theLonWorksplatformusesanaffiliatedInternetprotocol(IP)tunnellingstandardANSI/CEA852inuse

byanumberofmanufacturerstoconnectthedevicesonpreviouslydeployedandnewLonWorksbasednetworkstoIPawareapplicationsorremotenetworkmanagementtools.Most
LonWorksbasedcontrolapplicationsarebeingimplementedwithsomesortofIPintegration,eitherattheuserinterface,applicationlevelorinthecontrolinfrastructure.Thisis
accomplishedwithwebservicesorIProutingproductsavailableonthemarket(Wikipedia,2009).2.3.8ONENETstandard20
30. 30.ONENETisanopensourcestandardforwirelessnetworkdesignedforlowcost,lowpower(batteryoperated)controlnetworksforapplicationssuchashomeautomation,
securityandmonitoring,devicecontrol,andsensornetworks.ONENETisnottiedtoanyproprietaryhardwareorsoftware,andcanbeimplementedwithavarietyoflowcostoff
theshelfradiotransceiversandmicrocontrollersfromanumberofdifferentmanufacturers(Wikipedia,2009).ONENETusesUHFISMradiotransceiversandcurrentlyoperatesin
the868MHzand915MHzfrequencies.TheONENETstandardallowsforimplementationonotherfrequencies,andsomeworkisbeingdonetoimplementitinthe400MHzand2.4
GHzfrequencyranges.ItutilizesWidebandFSK(Frequencyshiftkeying)toencodedatafortransmissionanditfeaturesadynamicdatarateprotocolwithabasedatarateof38.4
kbit/s.Thespecificationallowspernodedynamicdatarateconfigurationfordataratesupto230kbit/s.ONENETsupportsstar,peertopeer,andmeshnetworkingtopologies.Star
networktopologycanbeusedforlowercomplexityandcostofperipherals,andalsosimplifiesencryptionkeymanagement.Inpeertopeermode,amasterdeviceconfiguresand
authorizespeertopeertransactions.Thewirelessmeshnetworkmodeallowsforrepeatingtocoverlargerareasorroutearounddeadareas.Outdoorpeertopeerrangehasbeen
measuredtoover500m,indoorpeertopeerrangehasbeendemonstratedfrom60mtoover100m,andmeshmodecanextendoperationalrangetoseveralkilometers.Simple,block,
andstreamingtransactionsaresupported.SimpletransactionstypicallyusemessagetypesasdefinedbytheONENETprotocoltoexchangesensordatasuchastemperatureorenergy
consumption,andcontroldata21
31. 31.suchason/offmessages.Simpletransactionsuseencryptiontechniquestoavoidsusceptibilitytoreplayattacks.Blocktransactionscanbeusedtotransmitlargerblocksofdata
thansimplemessages.Blocktransactionsconsistofmultiplepacketscontainingupto58bytesperpacket.Blockstransactionscantransferupto65,535bytesperblock.Streaming
transactionsaresimilarinformattoblocktransactionsbutdonotrequireretransmissionoflostdatapackets.ONENETisoptimizedforlowpowerconsumptionsuchasbattery
poweredperipherals.LowdutycyclebatterypoweredONENETdevicessuchaswindowsensors,moisturedetectors,etc.canachieveathreetofiveyearbatterylifewithAAor
"AAA"alkalinecells.Dynamicpoweradjustmentallowssignalstrengthinfotobeusedtoscalebacktransmitpowertoconservebatterypower.Highdataratesandshortpacketsizes
minimizetransceiverontime.Furtherpowerefficiencycanbegainedutilizingdeterministicsleepperiodsforclientdevices.2.3.9UniversalPowerlineBusTheUniversalPowerline
Bus(UPB)isanindustryemergingstandardforcommunicationamongdevicesusedforhomeautomation.Itusespowerlinewiringforsignallingandcontrol.Householdelectrical
wiringisusedtosenddigitaldatabetweenUPBdevices.WhileintheX10protocolthisdigitaldataisencodedontoa120KHzcarrierwhichistransmittedasburstsduringthe
relativelyquietzerocrossingsofthe50or60HzACalternatingcurrentwaveform,theUPBprotocolworksdifferently.TheUPBcommunicationmethodconsistsofaseriesof
preciselytimedelectricalpulses(called22
32. 32.UPBPulses)thataresuperimposedontopofthenormalACpowerwaveform(sinewave).ReceivingUPBdevicescaneasilydetectandanalysetheseUPBPulsesandpulloutthe
encodeddigitalinformationfromthem.UPBPulsesaregeneratedbychargingacapacitortoahighvoltageandthendischargingthatcapacitorsvoltageintothepowerlineataprecise
time.Thisquickdischargingofthecapacitorcreatesalargespike(orpulse)onthepowerlinethatiseasilydetectablebyreceivingUPBdeviceswiredlargedistancesawayonthe
samepowerline.UPBcontrollersrangefromextremelysimplepluginmodulestoverysophisticatedwholehousehomeautomationcontrollers.Thesimplestcontrollersareplugin
controllersthatarerecommendedforamoderateamountofswitchesanddevicesasitbecomescumbersometocontrolawiderangeofdevices.Moresophisticatedcontrollerscan
controlmoreunitsand/orincorporatetimersthatperformpreprogrammedfunctionsatspecifictimeseachday.Unitsarealsoavailablethatusepassiveinfraredmotiondetectorsor
photocellstoturnlightsonandoffbasedonexternalconditions.Finally,wholehousehomeautomationcontrollerscanbefullyprogrammed.Thesesystemscanexecutemany
differenttimedevents,respondtoexternalsensors,andexecute,withthepressofasinglebutton,anentirescene,turninglightson,establishingbrightnesslevels,andsoon.UPBwas
developedbyPCSPowerlineSystemsofNorthridge,Californiaandreleasedin1999.BasedontheconceptoftheubiquitousX10standard,UPBhasanimprovedtransmissionrate
andhigherreliability.WhileX10withoutspecialisedfirewallshasareportedreliabilityof7080%,UPBreportedlyhasareliabilityofmorethan99%(Wikipedia,2009).23
33. 33.2.4HOMEAUTOMATIONIMPLEMENTATIONPLATFORMSHomeautomationcanbeimplementedoveranumberofplatformsnamely,Powerline,RS232serial
communication,Ethernet,Bluetooth,InfraredandGSM.Eachplatformhavingitsownpeculiarityandareaofapplication.2.4.1PowerlinecommunicationPowerlinecommunicationis
asystemforcarryingdataonaconductoralsousedforelectricalpowertransmission.Thoughelectricalpoweristransmittedoverhighvoltagetransmissionlines,distributedover
mediumvoltageandusedinsidebuildingsatlowervoltages,powerlinecommunicationcanbeappliedateachstage.Allpowerlinecommunicationsystemsoperatebyimpressinga
modulatedcarriersignalonthewiringsystem.Differenttypesofpowerlinecommunicationsusedifferentfrequencybands,dependingonthesignaltransmissioncharacteristicsof
thepowerwiringused.Sincethepowerwiringsystemwasoriginallyintendedfortransmissionofalternatingcurrent(AC)power,inconventionaluse,thepowerwirecircuitshave
onlyalimitedabilitytocarryhigherfrequencies.Thepropagationproblemisalimitingfactorforeachtypeofpowerlinecommunications.Dataratesoverapowerline
communicationssystemvarywidely.Lowfrequency(about100200Khz)carriersimpressedonhighvoltagetransmissionlinesmaycarryoneortwoanalogvoicecircuits,or
telemetryandcontrolcircuitswithanequivalentdatarateofafewhundredbitspersecondhowever,thesecircuitsmaybemanymileslong.24
34. 34.2.4.2RS232TheRS232standsforrecommendedstandardnumber232.TheserialportsonmostcomputersuseasubsetoftheRS232standard.ThefullRS232standardspecifiesa
25pin"D"connectorofwhich22pinsareused.MostofthesepinsarenotneededfornormalPCcommunications,andindeed,mostnewPCsareequippedwithmaleDtype
connectorshavingonly9pins,tradingoffcompatibilitywiththestandardagainsttheuseoflesscostlyandmorecompactconnectors.InRS232,thecommunicatingdevicesare
referredtoasDataTerminalEquipment(DTE)andDataCommunicationEquipment(DCE).TheDTEisanendinstrumentthatconvertsuserinformationintosignalsorreconverts
receivedsignalsandusesthemaleconnector.TheDTEisthefunctionalunitofadatastationthatservesasadatasourceoradatasinkandprovidesforthedatacommunication
controlfunctiontobeperformedinaccordancewithlinkprotocol.WhiletheDCEiscommunicationlinkcontroldevicethatprovidestheclocksignalandusesthefemaleconnector.
TheDTEendsthecommunicationline,whereastheDCEprovidesapathforcommunication.InconnectingaDTEdevicetoaDCEastraightpinforpinconnectionisused.
However,toconnecttwoDCEsorDTEsthetransmitandreceivelinesmustbecrossed.TheDTEisusuallyacomputeroraterminaldeviceandtheDCEisusuallyamodem.Figures
2.12.3showsthestraightconnectionswhilefigures2.42.6illustratethecrossovercableconnections.25
35. 35.Figure2.1:StraightcableconnectionbetweenRS232DB9DTEandRS232DB9DCEFigure2.2:StraightcableconnectionbetweenRS232DB25DTEandRS232DB25
DCE26
36. 36.Figure2.3:StraightcableconnectionbetweenRS232DB9DTEandRS232DB25DCEFigure2.4:CrossovercableconnectionbetweenDB9DCEandDB9DCE27
37. 37.Figure2.5:CrossovercableconnectionbetweenDB25DCEandDB25DCEFigure2.6:CrossovercableconnectionbetweenDB9DCEandDB9DCE28
38. 38.2.4.3EthernetEthernetdefinesanumberofwiringandsignallingstandardsforthephysicalconnectionoftwoormoredevicestogether.Ethernetwasoriginallybasedontheidea
ofcomputerscommunicatingoverasharedcoaxialcableactingasabroadcasttransmissionmedium.Themethodsusedshowsomesimilaritiestoradiosystems,althoughthereare
fundamentaldifferences,suchasthefactthatitismucheasiertodetectcollisionsinacablebroadcastsystemthanaradiobroadcast.Thecommoncableprovidingthecommunication
channelwaslikenedtotheetheranditwasfromthisreferencethatthename"Ethernet"wasderived(Wikipedia,2009).Fromthisearlyandcomparativelysimpleconcept,Ethernet
evolvedintothecomplexnetworkingtechnologythattodayunderliesmostlocalareanetworks.ThecoaxialcablewasreplacedwithpointtopointlinksconnectedbyEthernethubs
and/orswitchestoreduceinstallationcosts,increasereliability,andenablepointtopointmanagementandtroubleshooting.StarLANwasthefirststepintheevolutionofEthernet
fromacoaxialcablebustoahubmanaged,twistedpairnetwork.Theadventoftwistedpairwiringdramaticallyloweredinstallationcostsrelativetocompetingtechnologies,
includingtheolderEthernettechnologies.Throughthephysicalconnection,Ethernetstationscommunicatebysendingeachotherdatapackets,blocksofdatathatareindividuallysent
anddelivered.DespitethesignificantchangesinEthernetfromathickcoaxialcablebusrunningat10Mbits/stopointtopointlinksrunningat1Gbit/sandabove,allgenerationsof
Ethernet(excludingearlyexperimentalversions)sharethesameframeformats(andhencethesameinterfaceforhigherlayers),andcanbereadily29
39. 39.interconnected.AndduetotheubiquityofEthernet,theeverdecreasingcostofthehardwareneededtosupportit,andthereducedpanelspaceneededbytwistedpairEthernet,
mostmanufacturersnowbuildthefunctionalityofanEthernetcarddirectlyintocomputerandlaptopmotherboards,eliminatingtheneedforinstallationofaseparatenetwork
card.2.4.4BluetoothBluetoothisanopenwirelessprotocolforexchangingdataovershortdistancesfromfixedandmobiledevices,creatingpersonalareanetworks(PANs).Itwas
originallyconceivedasawirelessalternativetoRS232datacables.Itcanconnectseveraldevices,overcomingproblemsofsynchronization.Itisastandardandacommunications
protocolprimarilydesignedforlowpowerconsumption,withashortrange(powerclassdependent:1meter,10meters,100meters)basedonlowcosttransceivermicrochipsineach
device.Bluetoothmakesitpossiblefordevicestocommunicatewitheachotherwhentheyareinrange.Becausethedevicesusearadio(broadcast)communicationssystem,theydo
nothavetobeinlineofsightofeachother.Bluetoothusesaradiotechnologycalledfrequencyhoppingspreadspectrum,whichchopsupthedatabeingsentandtransmitschunksofit
onupto79frequencies.Initsbasicmode,themodulationisGaussianfrequencyshiftkeying(GFSK).Itcanachieveagrossdatarateof1Mb/s.Bluetoothprovidesawaytoconnect
andexchangeinformationbetweendevicessuchasmobilephones,telephones,laptops,personalcomputers,printers,GlobalPositioningSystems(GPS)receivers,digitalcameras,and
videogameconsolesthroughasecure,globally30
40. 40.unlicensedIndustrial,ScientificandMedical(ISM)2.4GHzshortrangeradiofrequencyband.TheBluetoothspecificationsaredevelopedandlicensedbytheBluetoothSpecial
InterestGroup(SIG).TheBluetoothSIGconsistsofcompaniesintheareasoftelecommunication,computing,networking,andconsumerelectronics(Wikipedia,2009).2.4.5
InfraredInfrared(IR)radiationiselectromagneticradiationwhosewavelengthislongerthanthatofvisiblelight(400700nm),butshorterthanthatofmicrowaveradiation.Its
wavelengthspansbetween750nmand100mandisemployedinshortrangecommunicationamongdevicesthatconformtothestandardspublishedbytheInfraredDataAssociation
(IrDA).RemotecontrolsandIrDAdevicesuseinfraredlightemittingdiodes(LEDs)toemitinfraredradiationwhichisfocusedbyaplasticlensintoanarrowbeam.Thebeamis
modulated,i.e.switchedonandoff,toencodethedata.Thereceiverusesasiliconphotodiodetoconverttheinfraredradiationtoanelectriccurrent.Itrespondsonlytotherapidly
pulsingsignalcreatedbythetransmitter,andfiltersoutslowlychanginginfraredradiationfromambientlight.Infraredcommunicationsareusefulforindooruseinareasofhigh
populationdensity.IRdoesnotpenetratewallsandsodoesnotinterferewithotherdevicesinadjoiningrooms.Infraredisthemostcommonwayforremotecontrolstocommand
appliances.2.4.6GSMGSMwhichstandsforGlobalSystemforMobileCommunication,isthe31
41. 41.mostpopularstandardformobilephonecommunicationintheworld.Itisusedbyoverthreebillionpeopleacrossmorethan212countriesandterritories(Wikipedia,2009).GSM
basicallyprovidesvoicecallandshortmessageservice(SMS).Itoperatesasacellularnetworkthatmobilephonesconnecttobytryingtosearchforcellsintheirimmediatevicinity.
ThemodulationusedinGSMisGaussianminimumshiftkeying(GMSK),akindofcontinuousphasefrequencyshiftkeying.InGMSK,thesignaltobemodulatedontothecarrieris

firstsmoothedwithaGaussianlowpassfilterpriortobeingfedtoafrequencymodulator,whichgreatlyreducestheinterferencetoneighbouringchannels(adjacentchannel
interference).GSMnetworksoperateinthe900MHzor1800MHzfrequencybandsinmostcountriesoftheworldexceptinfewcountrieslikeUSAandCanadawhere850and1900
MHzbandsareusedasthe900and1800MHzbandswerealreadyallocated.TheGSMtechnologyusesa200Khzradiofrequencychannelsthataretimedivisionmultiplexedto
enableuptoeightuserstoaccesseachcarrier.2.4.7MicrocontrollerAmicrocontrollerisaninexpensivesinglechipcomputer.Singlechipcomputermeansthattheentirecomputer
systemlieswithintheconfinesoftheintegratedcircuitchip(Byte,2002).Themicrocontrollerontheencapsulatedsilverofsiliconhasfeaturessimilartothoseofourstandard
personalcomputer.Itsabilitytostoreandrununiqueprogramsmakesitextremelyversatile,anditsabilitytoperformmathsandlogicfunctionsallowsittomimicsophisticatedlogic
andelectroniccircuits.Microcontrollersareusedinautomaticallycontrolledproductsanddevices,32
42. 42.suchasautomobileenginecontrolsystems,remotecontrols,officemachines,appliances,powertoolsandtoys.Hence,microcontrollersduenotfunctioninisolation,theyaccept
inputfromoneormoredevicesandprovideoutputtootherdeviceswithinagivensystem.Infact,theyareresponsiblefortheintelligenceinmostsmartdevicesintheconsumer
market.Themicrocontrollerhastwogeneralarchitecturetypesthatdefineitsmodeofoperationanddesign.2.3.7.1VonNeumannarchitectureThisarchitecturehasasingle,common
memoryspacewherebothprograminstructionsanddataarestored.Thereisasingledatabuswhichfetchesbothinstructionsanddata.AndeachtimetheCPUfetchesaprogram
instructionitmayhavetoperformoneormoreread/writeoperationstodatamemoryspace.Itmustwaituntilthesesubsequentoperationsarecompletebeforeitcanfetchanddecode
thenextprograminstruction.Theadvantagetothisarchitectureliesinitssimplicityandeconomy.OnsomeVonNeumannmachinestheprogramcanreadfromandwritetoCPU
registers,includingtheprogramcounter.Thiscanbedangerousasyoucanpointtheprocessortomemoryblocksoutsideprogrammemoryspaceandcarelessprocessormanipulation
cancauseerrorswhichrequireahardreset.2.3.7.2HarvardarchitectureThisarchitectureimplementsseparatememoryareasforprograminstructionsanddata.Therearetwoormore
internaldatabuseswhichallowsimultaneousaccesstobothinstructionsanddata.TheCPUfetchesinstructionson33
43. 43.theprogrammemorybus.Ifthefetchedinstructionrequiresanoperationondatamemory,theCPUcanfetchthenextprograminstructionwhileitusesthedatabusforitsdata
operation.Thisspeedsupexecutiontimeatthecostofmorehardwarecomplexity.Mostmodernmicrocontrollershavetheharvardarchitecture.34
44. 44.CHAPTERTHREEMETHODOLOGYIndesigningahomeautomationsystem,oneormoresuitableplatformsareusedinordertobuildareliableandflexiblesystemthatcanbe
easilyoperatedandadaptedforanewhouseholdappliance.Therefore,forthepurposeofthisprojectsomespecificdeliberatechoicesweremadeonthetypeofplatforms,
hardwarecomponentsandmodeofoperationofthehomeautomationsystem.3.1PRELIMINARYCONSIDERATIONSBeforetheactualdesignoftheprojectwork,specific
deliberatechoicesinselectionofappropriateimplementationplatformsandhardwarecomponentsweremade.Prioritywasgiventolowcostavailability,reliability,flexibilityand
simplicityinalltheseselections.3.1.1SelectionofimplementationplatformAsalreadyexplainedinthepreviouschapter,therearemanyplatformsoverwhichahomeautomation
systemcanbeimplemented.OfthecurrentlyavailableplatformsPowerline,RS232,Ethernet,Bluetooth,Infrared,GSMandMicrocontrollerRS232,GSMandMicrocontroller
werefoundmostappropriateduetotheirlowcostavailability,reliabilityandsimplicitywhenusedforanindividualcontrolhomeautomationsystemwhichmyprojectworkison.
PowerlineandEthernetistooexpensiveandcomplexforthiskindofhomeautomationsystem,whileBluetoothandInfraredareunreliable.35
45. 45.3.1.2SelectionofhardwarecomponentsEachplatformhasasetofhardwarecomponentsoverwhichitisimplemented.ForRS232,thereareDB9andDB25connectioncables,
butDB9cablewasfoundmostappropriatebecauseitischeaper,morereadilyavailable,lessbulkyandjustsufficientforthedesignedsystemwhencomparedwithDB25.ForGSM,
thereareGSMmodemsandphonebrands,butNokia6021waschosenduetoitslowcostavailability,abilitytounderstandATcommandsandavailabilityofitsRS232DB9cable.
Finally,forMicrocontroller,thepopularonesarethoseproducedbyMicrochip,ATMEL,MotorolaandTexasInstruments,ofalltheseMicrochipmanufacturedPICmicrocontroller
wasfoundmostsuitableduetoitslowcostavailability,andreadilyavailableprogrammers,compilersandflexibility.3.2SYSTEMDESIGNThedesignedhomeautomationsystem
usesPIC18F4455microcontroller,Nokia6021mobilephone,RS232standardforcommunicationbetweenthemicrocontrollerandmobilephone,HIN232forinterfacingthe
microcontroller,arelayandadriverforinterfacingtherelay.Asillustratedintheblockdiagramshowninfigure3.1,whentheNokia6021receivestherequiredsignal,it
communicatesviatheRS232andHIN232tothePIC18F4455,thePIC18F4455controlstherelaystateviaadriverandthisinturndeterminesthestateoftheconnectedappliance,
whetherswitchedonoroff.36
46. 46.Figure3.1:Blockdiagramofthehomeautomationsystem3.2.1PIC18F4455PIC18F4455ismanufacturedbyMicrochipIncorporationbasedinUnitedStatesofAmerica,andis
oneoftheirharvardarchitecturebasedmicrocontrollerseriescalledPIC.PICisgenerallyassumedtomeanprogrammableinterfacecontroller.ThePICmicrocontrollercontainsa
CPU(centralprocessingunit),RAM(randomaccessmemory),ROM(readonlymemory),I/O(input/output)lines,
serial37HIN232PIC18F4455SERIALRELAYDRIVERRS232HOMEAPPLIANCEACLINE
47. 47.andparallelports,timersandsometimesotherbuiltinperipheralssuchasA/D(analoguetodigital)andD/A(digitaltoanalogue)converters.Figure3.2showstheinteractions
(dataflow)betweenthemainmicrocontrollerparts.Figure3.2:Interactionsbetweenthemainmicrocontrollerparts3.2.1.1CentralProcessingUnit(CPU)TheCPUisresponsiblefor
allthecomputing,itfetches,decodesandexecutesprograminstructionsanddirectstheflowofdatatoandfrommemory.Itperformsthecalculationsrequiredbyprograminstructions
andplacestheresultsofthesecalculations,ifrequired,intomemoryspace.MostCPUsaresynchronous,meaningthattheydependonthecyclesofaprocessorclock,thisclock
generatesahighfrequencysquarewaveusuallydrivenbyacrystal,aRC(resistorcapacitor)oranexternalsource.Theclockissometimesreferredtoasanoscillator.Theclockspeed,
oroscillationrate,ismeasuredinmegahertz(MHz)whichrepresentsonemillioncycles/second.38
48. 48.3.2.1.2RandomAccessMemory(RAM)TheRAM,randomaccessmemory,isusedtowriteandreaddatavaluesasaprogramruns.RAMisvolatilemeaningthatifthepower
supplytothemicrocontrollerisremoved,itscontentsarelost.AllvariablesusedinaprogramareallocatedfromtheRAM.ThetimetoretrieveinformationfromRAMdoes
notdependuponthelocationoftheinformationbecauseRAMisnotsequential,hencethetermrandomaccess.MostsmallPICmicrocontrollersprovideverylittleRAMwhichforces
youtowriteapplicationsthatuseRAMwisely.Manipulatinglargedatastructuresandusingpointers,reentrantorrecursivefunctionsuselargeamountsofRAMandaretechniques
whicharegenerallyavoidedonmicrocontrollers3.2.1.3ReadOnlyMemory(ROM)TheROM,readonlymemory,isnonvolatilememoryusedforprograminformationand
permanentdata.ThemicrocontrollerusesROMmemoryspacetostoreprograminstructionsitwillexecutewhenitisstartedorreset.Programinstructionsmustbesavedinnon
volatilememorysothattheyarenotaffectedbylossofpower,themicrocontrollerusuallycannotwritedatatoprogrammemoryspace.3.2.1.4InputandOutputports(I/O)Without
somemeansofgettinginformationandsignalsinandout,themicrocontrollerwillhavelittleornouse.Hence,theinputandoutputportsareusedtopassdatainandoutofthe
microcontrollerinacontrolledmanner,oftenaccordingtoastandardprotocol.ThePICmicrocontrollerportsareoftwotypesnamely,serialandparallelports.Theycanoperatein
twomainmodesnamely,synchronousand39
49. 49.asynchronousmodes.TheparallelI/Oportsrequireadatalineforeachbitinabyte,whiletheserialI/Ousesasingledatalineforallthebitsinthedatastreambytransferringthe
bitsinsequence.Thesynchronousmodeinvolvessynchronizingthedatatransferwithaclockwhiletheasynchronousmodedoesnot.PICmicrocontrollersmostoftenhaveparallel
I/OcapabilitybuiltinandtheserialI/Oasaperipheralfeature.3.2.2PIC18F4455architectureAsshowninfigure3.3isatypicalPIC18F4455,a40pinhighperformancenanowatt
technologymicrocontroller,wasusedintheactualdesign(Microchip,2007).Figure3.3:40PinPIC18F4455microcontrollerThefeaturesofPIC18F4455are:40
50. 50.24576Bytesflashprogrammemory,Capableof12288instructionset,2048BytesofDatamemory,256BytesofDataEEPROMmemory,18interruptsources,USBV.20
compliant,100,000erase/writecycle,Programmablecodeprotection,Dataretentionofover40years,Selfprogrammableundersoftwarecontrol,EnhancedUSARTmodule,
andCcompileroptimizedarchitecture.41
51. 51.Figure3.4:PIC18F4455blockdiagram42
52. 52.3.2.3PIC18F4455programmingFigure3.4isadetailedblockdiagramofthePIC4455.Inprogrammingit,acomplierandaprogrammerwereused.Therearemanyavailable
compilersforPIC18F4455suchasMikroC,HiTech,MikroBasic,MikroPascal,CCSCandMPLAB,butCCSC(whoseinterfaceisshowninfigure3.5)wasused.Also,thereare
manyprogrammersavailablebutMikroElectronikadevelopmentboard(itscontrolinterfaceisshowninfigure3.6)wasused.Figure3.5:CCSCcompilerIDEinterfaceTheCCSC
compilerhasanIntegratedDevelopmentEnvironment(IDE)throughwhichprogramswrittencanbecompiledintoHexadecimalcodes.TheIDEinterfaceisshownabove.43
53. 53.Figure3.6:MikroElectronikaprogrammerinterface3.2.4Nokia6021Nokia6021,showninfigure3.7,isanEDGE(EnhancedDataRatesforGSMEvolution)enabledmobile
phone.ItisbuiltontheGSMtechnologystandardandhasbothInfraredandBluetoothtransceivers,thesefeaturesmakeitsuitableforuseinbuildinganhomeautomationsystem.It
canserveasanextremelylongrangeremote(onethatcanbecontrolledfromanywhereintheworld)viaacombinationoftwoormoreofitsInfraredorBluetoothfunctionality,voice
anddatacallcapabilities,44
54. 54.shortandmultimediamessageservice(SMS/MMS)andwirelessapplicationprotocol(WAP).ItalsohasanRS232datacablecalledDKU5cablewithwhichthephonecanbe
connectedtoanyRS232serialcommunicationcapabledevice.Figure3.7:Nokia6021mobilephoneInremotecommunicationwiththeNokia6021,Hayescommandset(alsoknown
asATcommand)isused.Thiscommandsetisaspecificcommandlanguageconsistingofseriesofshorttextstringswhichcombinetogethertoproducecompletecommandsfor
operationssuchasdialling,hangingup,sending/readingtextmessages,andchangingtheparametersoftheconnection.3.2.5HIN232HIN232,showninfigure3.8,isanRS232
transmitter/receiverinterfacechip,usedformakingserialcommunicationpossiblebetweenadevicethatusesTTL(transistortransistorlogic)signallevelsandanotherdevicethat
usesRS232signallevels(Intersil,2008).45
55. 55.Figure3.8:HIN232pinoutItrequiresasingle+5Vpowersupplyandfeatureonboardchargepumpvoltageconverterswhichgenerate+10Vand10Vsuppliesfromthe5V
supply.ItsdriversfeaturetrueTTLinputcompatibility,slewratelimitedoutput,and300poweroffsourceimpedance.Thereceiverscanhandleupto+30V,andhavea3kto7k
inputimpedance,andtheyfeaturehysteresistogreatlyimprovenoiserejection.Table3.1:HIN232pindescriptionsTable3.1givesadetailedworkingdescriptionofeachpin.46
56. 56.3.2.6RelayRelayisasmallelectricalswitchconsistingofanelectromagnet(coil),aswitchandaspring,thatopensandclosesunderthecontrolofanotherelectricalcircuit.The
springholdstheswitchinoneposition,untilacurrentispassedthroughthecoil,thecoilgeneratesamagneticfieldwhichmovestheswitch.Becausetherelayisabletocontrolan
outputcircuitofhigherpowerthantheinputcircuit,itisoftenusedtoautomaticallyswitchlargeelectricalpowerdevices(Wikipedia,2009).Therearemanytypesofrelay,namely
LatchingrelayThisrelayhastworelaxedstates(bistable)anditisoftenreferredtoasimpulse,keeporstayrelay.Whenthecurrentisswitchedoff,therelayremainsinitslaststate.
Thisispossibleduetoasolenoidoperatingaratchetandcammechanism,orbyhavingtwoopposingcoilswithanovercenterspringorpermanentmagnettoholdthearmatureand
contactsinpositionwhilethecoilisrelaxed.Hence,thefirstpulseofcurrenttothecoilturnstherelayonandthesecondpulseturnsitoff.ReedrelayThisrelayhasasetof
contactsinsideavacuumorinertgasfilledglasstube,whichprotectsthecontactsagainstatmosphericcorrosion.Thecontactsareclosedbyamagneticfieldgeneratedwhencurrent
passesthroughacoilaroundtheglasstube.Reedrelaysarecapableoffasterswitchingspeedsthanmostotherrelaytypes,buthavealowswitchcurrentandvoltageratings.47

57. 57.ContactorrelayThisisaveryheavydutyrelayusedforswitchingelectricmotorsandlightingloads.Highcurrentcontactsaremadewithalloyscontainingsilver.Thoughthere
isanunavoidablearcingandthecontactsoxidize,thesilveroxideformedisstillagoodconductor.Contactorrelaysareoftenusedformotorstartersandtheygeneratealotofnoise
whenswitching.SolidstaterelayThisrelaytypeisasolidstateelectroniccomponentthatprovidesthesamefunctionastheelectromagneticrelay.Itisjustthatitdoesnothaveany
movingpartwhichincreasesitslongtermreliability.48
58. 58.CHAPTERFOURDESIGNANDIMPLEMENTATIONThedesignofthisprojectinvolvedcouplingseveralhardwarecomponentsandtestingatthedifferentstagesofthe
implementation.Firstly,aflowchartasshowninfigure4.1wasdevelopedforthedesignindicatingtheprocessesinvolved.Figure4.1:Flowchartofthedesign49PhoneringsSwitch
applianceoffStartSwitchapplianceonAppliancealreadyswitchedonSendmessageSendmessageNoYesYes
59. 59.4.1BUILDINGTHEPOWERSUPPLYANDINTERFACINGTHERELAYInbuildingthepowersupply,asillustratedinfigure4.2thefollowingcomponentswereused
220/9V500mA50Hztransformer,4700F,35Vcapacitor,bridgerectifier,and5Vvoltageregulator.Figure4.2:Thepowersupply50Voltage
regulatorCapacitorTransformerBridgerectifier
60. 60.Theprimarysideofthetransformerwasconnectedtoa220VACmainswhilethe9Vsecondarysidewasconnectedtothealternatingvoltageinputpinsofthebridgerectifier.The
DCoutputofthebridgerectifierwassenttothe5Vvoltageregulatorwhichsuppliestheconstant5VvoltagesupplyneededbythePIC4455andHIN232.4.2SERIAL
COMMUNICATIONBETWEENTHEMICROCONTROLLERANDNOKIA6021InmakingpossibletheserialcommunicationbetweenthePIC4455microcontrollerandtheNokia
6021mobilephone,thevoltagelevelsignalsfromtheRS232DB9datacableofthephonehadtobeconvertedtothecorrespondingTTL/CMOSvoltagelevelsignalsthatthe
microcontrollerunderstands.Indoingthis,HIN232whichisanRS232linedriver/receiverwasusedtoconverttheRS232signalstotheircorrespondingTTL/CMOSsignals.The
microcontrollertransmitpinC6andreceivepinC7wereconnectedtotheTTL/CMOSinputandoutputpins9and10,indoingthisconnectionitwasnecessarytoconnectthetransmit
pin(C6)ofthemicrocontrollertotheinputreceivepinoftheHIN232andthereceivepin(C7)ofthemicrocontrollertotheoutputtransmitpinoftheHIN232.Thisensuredthe
crossconnectionrequiredforserialcommunicationbetweentwoDCEs(DataCommunicationEquipment)forboththemicrocontrollerandtheNokia6021areDCEs.FortheDB9
cable,thetransmitpin2isconnectedtotheRS232outputpin7andthereceivepin3isconnectedtotheRS232inputpin8.Finally,theDTR(dataterminalready)pin4andRTS
(requesttosend)pin7oftheDB9cablewereconnectedtothe+5Vterminalwhilethesignalgroundpin551
61. 61.wasconnectedtothegroundterminal.Thecompleteconnectionisshowninfigure4.3.Figure4.3:TheRS232tomicrocontrollerportionofthedesign4.3PROGRAMMINGTHE
MICROCONTROLLERInprogrammingthemicrocontroller,CCSCcompilerwasusedtowritethePICCcodethatwasbuiltintoanhexadecimalcodetobeprogrammedinto
thePIC4455.ThePICCprogramcodeimplementedforthePIC4455microcontrollerwasdevelopedstepwiseasIncludetherequiredheaderfileswhichare18f4455.hand
string.hheaderfiles.Includetherequiredclassfilewhichisinput.c.52HIN232PIC4455microcontrollerRS232DB9connector
62. 62.Setthecommunicationparametersliketheclockrate(20MHz),thebaudrate(9600bits/s),thetransmitpin(PINC6)andthereceivepin(PINC7).#users232(baud=9600,
xmit=PIN_C6,rcv=PIN_C7)InitializethePIC4455portstobeused.PinC7wassetasaninputpinsinceitwasthereceivepin,theportDwasinitializedtolowsinceD4pinwould
beusedtocontroltherelay.SendtheATcommandsthatwillputthephoneintextmode(at+cmgf=1)andnotificationmode(at+cnmi=2,3,2,2,1).Thiswasrequiredforthephoneto
notifythemicrocontrollerofanincomingcall.printf(at+cmgf=1+cnmi=2,3,2,2,1r)Putthemicrocontrollerinawaitingmodesuchthatifitdetectsdataonitsreceivepin,itwill
executethemainfunctionalcodesthatwillcomparetheincomingdatawithsomepredetermineddatatodetermineifthephoneisringingandthecourseofactiontotakebefore
goingbacktothewaitingmode.if(kbhit()){...}4.4TESTINGTHECOMPLETEDESIGNANDCASING53
63. 63.Afterthecompletionofthehardwarecoupling,severaltestsweredoneonthedesign.Someobservationsandcorrectionsweremadeasfollows:1.Thesystemwouldnotwork
whenthephoneisconnectedafterpoweringit,evenafterareset.Thiswasduetothefactthatthesignalssentatfirstbythesystemtothephonedonotdieofthelineimmediatelyand
affectssubsequentsignalssentevenafterconnectingandresettingthesystem.Thiscanbepreventedbyconnectingthephonefirstbeforepoweringthesystem.Muchconcernwasnot
giventothisshortcomingbecausethesystemwasdesignedtohaveapermanentlyconnectedphone,makingitimpossibleforthisshortcomingtoarise.2.Itwasalsoobservedthatthe
systemwouldnotrespondafteraboutfourloopcycles(thiscorrespondstofourconcurrentswitchtoggle).Thiswasduetobufferoverflowonthemicrocontrollerwhichmakesit
notprocessnewdatasentitbythephoneafterthosecycles.Theattemptedsolutionwastofindawayofflushingthebufferaftereachcycle,butduetolittlehelpfoundfrombooks,
internetandfellowPICprogrammers,itssolutioncouldnotbeimplemented.Otherthanintheabovestatedsituations,thesystemworkedverywellandreliably.Indesigningthecase
forthesystem,utmostconcernwasgiventoguardingthesystemfromphysicalstrainandstressduringcarriageandprojectpresentation.Atransparentplasticmaterialwasusedfor
thecasingasagainstglassmaterialwhich54
64. 64.mayeasilybreak,apapermaterialwhichmaygiveintostrainandstress,orevenametallicmaterialwhichwillmaketheprojectworkquiteuneconomical,clumsyandheavy.The
casingwasmadeinamannerthatpermitsthewholecircuitboardtobedetachedfromthesystem.Thecompletehomeautomationsystemcircuitcontrollingalightingfixture,andthe
designedsystemareshowninfigure4.4and4.5.Figure4.4:Thecompletehomeautomationsystemcircuit(controllinglightingfixture)55
65. 65.Figure4.5:Theindividualcontrolhomeautomationsystem56
66. 66.CHAPTERFIVECONCLUSIONANDRECOMMENDATION5.1CONCLUSIONItisevidentfromthisprojectworkthatanindividualcontrolhomeautomationsystemcanbe
cheaplymadefromlowcostlocallyavailablecomponentsandcanbeusedtocontrolmultifarioushomeappliancesrangingfromthesecuritylamps,thetelevisiontotheair
conditioningsystemandeventheentirehouselightingsystem.Andbetterstill,thecomponentsrequiredaresosmallandfewthattheycanbepackagedintoasmallinconspicuous
container.Thedesignedhomeautomationsystemwastestedanumberoftimesandcertifiedtocontroldifferenthomeappliancesusedinthelightingsystem,airconditioningsystem,
heatingsystem,homeentertainmentsystemandmanymore(thisisaslongasthemaximumpowerandcurrentratingoftheappliancedoesnotexceedthatoftheusedrelay).Finally,
thishomeautomationsystemcanbealsoimplementedoverBluetooth,InfraredandWAPconnectivitywithoutmuchchangetothedesignandyetstillbeabletocontrolavarietyof
homeappliances.Hence,thissystemisscalableandflexible.5.2RECOMMENDATIONInconsonancewiththeprojectworkandinviewoftheresearchedmethodsandundertakings
intheprojectdesign,thefollowingarerecommended:57
67. 67.Thedepartmentshouldhelpthestudentsingettingcomponentsthatarenotlocallyavailable.Studentsshouldbetaughthowtomakeembeddedsystemsastheuseofcomputer
softwareinmostprojectworkmakesituneconomical,andtheuseoftheconventionalintegratedcircuitsandlogicgatesmakestheprojectworkclumsy.Finally,thisprojectcanbe
furtherdevelopedtocontrolmorethanonehomeapplianceatoncethroughtheuseofshortmessageservicetextsratherthanvoicedialthoughitwillbemoreexpensiveandwill
requiremorerelaycircuits,makingitadistributedcontrolhomeautomationsystem.Also,tocutthecostofmobilephone,theprojectmaybeimplementedusingstandaloneGSM
modemsthatonlyperformspecialisedfunctionsliketextmessagingand/orphonecalls.ThisGSMmodemsoftenarecheaperandmorereliablethanGSMmobilephones.58
68. 68.REFERENCESByteCraft(2002).FirstStepswithEmbeddedSystems.ByteCraftLimited,Canada.B&BElectronics(2003)RS232connectionsthatwork!DTE&DCEFAQ.
Fromhttp://www.bbelec.comRetrievedon29/03/2003Collins,T.J.(2008).Aprojectreportonthedesignandconstructionofalowvoltagepowerlinecommunicationsystem.
ProjectReport,FUTAAkure.Intersil(2008).HIN232datasheet.IntersilInc,USA.MartinBates(2006).InterfacingPICMicrocontrollersEmbeddedDesignbyInteractiveSimulation.
Newnes,London.Microchip(2007).PIC18F2455/2550/4455/4550DataSheet.MicrochipTechnology.Inc,USANigelGardner(1998).AnIntroductiontoprogrammingthe
MicrochipPICinC.CharacterPress,UK.Wikipedia(2009).Automation.Fromhttp://en.wikipedia.org/wiki/Automation.Retrievedon7/30/2009Wikipedia(2009).Bluetooth.From
http://en.wikipedia.org/wiki/Bluetooth.Retrievedon7/30/2009Wikipedia(2009).BuildingAutomation.Fromhttp://en.wikipedia.org/wiki/Building_automation.Retrievedon
7/30/2009Wikipedia(2009).Ethernet.Fromhttp://en.wikipedia.org/wiki/Ethernet.Retrievedon8/3/2009Wikipedia(2009).EuropeanHomeSystemsProtocol.
Fromhttp://en.wikipedia.org/wiki/European_Home_Systems_Protocol.Retrievedon8/3/2009Wikipedia(2009).GSM.Fromhttp://en.wikipedia.org/wiki/GSM.Retrieved
on8/7/2009Wikipedia(2009).HomeAutomation.Fromhttp://en.wikipedia.org/wiki/Home_automation.Retrievedon7/6/2009Wikipedia(2009).INSTEON.From
http://en.wikipedia.org/wiki/INSTEON.Retrievedon8/3/200959
69. 69.Wikipedia(2009).KNX(standard).Fromhttp://en.wikipedia.org/wiki/KNX_(standard).Retrievedon8/3/2009Wikipedia(2009).LonWorks.From
http://en.wikipedia.org/wiki/LonWorks.Retrievedon8/3/2009Wikipedia(2009).Microcontroller.Fromhttp://en.wikipedia.org/wiki/Microcontroller.Retrievedon8/3/2009Wikipedia
(2009).ONE.NET.Fromhttp://en.wikipedia.org/wiki/ONE.NET.Retrievedon8/3/2009Wikipedia(2009).RS232.Fromhttp://en.wikipedia.org/wiki/RS232.Retrieved
on7/21/2009Wikipedia(2009).X10(IndustryStandard).Fromhttp://en.wikipedia.org/wiki/X10_(industrystandard).Retrievedon8/3/2009Wikipedia(2009).ZigBee.From
http://en.wikipedia.org/wiki/ZigBee.Retrievedon8/3/2009Wikipedia(2009).ZWave.Fromhttp://en.wikipedia.org/wiki/ZWave.Retrievedon8/3/200960
70. 70.APPENDIXI:BillofcomponentsITEMSYMBOLVALUECOST(N)1B1BridgeRectifier502C11.0F103C21.0F104C31.0F105C41.0F106C51.0F107C6
4700F108C722pF109C822pF1010D1DB9RS232Cable80011F1Board10012F2Board10013H1HIN2327014L1LED515NINOKIA6021650016P1PIC4455
200017R110k518R2330519R3200520S16V10ARelay5021T1Transformer30022U1TIP41C5023U2TIP41C5024V1LM78055025V2LM78065026X1
CrystalOscillator7027Z1ResetButton20TOTAL1036061
71. 71.APPENDIXII:ThePICCcodeforprogrammingthePIC4455inCCSCcompiler#include<18f4455.h>#usedelay(clock=12000000)#users232(baud=9600,
xmit=PIN_C6,rcv=PIN_C7)#fusesHS,NOWRT,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOLVP,NOCPD,NODEBUG#usefast_io(A)//enhancesselfi/osettings#use
fast_io(B)#usefast_io(C)#include<string.h>//headerfile#include<input.c>inti,u,a,b,counter=1,togglechardata[20],data1[20],data2[20],data3[20],test[12],mem[12],req[12]void
main(){set_tris_c(128)set_tris_b(0)output_b(255)set_tris_d(0)output_d(0)delay_ms(500)printf("at+cmgf=1+cnmi=2,3,2,2,1r")/*Thisputsthephoneintextmodeandenables
notificationsending*/i=getch()//u=getch()//gets(data)////|Extractandsilenttheinitialsentinstructioni=getch()///u=getch()///gets(data1)///back:if(kbhit())//Runthe
subsequentcodeswhenthereisanewdata{welcome:if(counter==200)//_Reinitialisethecountercounter=0///gets(data2)62
72. 72.gets(data3)b=0for(a=1a<=6a++){req[b]=data3[a]b++}strncpy(mem,req,4)strcpy(test,"RING")/*Thecontrolstringwhichthephonesendswhenthereisaphonecall
*/if(strncmp(mem,test,4)==0)//checkifthenotificationisforphoneringing{counter++//Incrementthecountertoggle=counter%10if(toggle==5){output_high(PIN_D4)//put5Von
theD4pinprintf("at+cmgs="08064702218"r")printf("applianceisswitchedon")putc(26)}if(toggle==0){output_low(PIN_D4)//setpinD4to
0V//delay_ms(5)printf("at+cmgs="08064702218"r")//delay_ms(50)printf("applianceisswitchedoff")putc(26)//delay_ms(10)}}gotowelcome}gotoback}63
Recommended
Morefromthisauthor

WebTechnologyFundamentals

CMSFundamentals

CreatingaFirstWebSitewithDreamweaverCS6

Homeautomationusingandroidmobiles
Durairaja
24,619

PresentationSmartHomeWithHomeAutomation
Assistant365.org
36,270

Homeautomationpptkamallamichhane
KamalLamichhane
26,430

AminorprojectreportHOMEAUTOMATIONUSINGMOBILEPHONES
ashokkok
33,222

SmartHomeAutomationAnOverview
SmartAutomation
8,552

Gsmbasedhomeautomation
RAJNEESHKUMARSALGOTRA
15,574

HOMEAUTOMATIONSYSTEMVIAINTERNETUSINGANDROIDPHONE
IJRISEJournal
2,693

homeappliancecontrolusinggsm
ChinmoyJena
33,247

gsmbasedhomesecuritysystemprojectreport
somendradhayal
37,179

Homeautomation
ahmkashwa
5,218

HomeautomationusingGSMmodule
ChaitanyaKulkarni
8,111

Gsmbasedhome(ppt)
kjabraham007
6,807

Smarthomes
BradFitzpatrick
10,672

SmartHometechnologies
loggcity
9,906

GSMBASEDDEVICESCONTROLSYSTEMPROJECTREPORT
AvinashKannojia
7,251

UrBizEdgeMicrosoftExcelandBusinessDataAnalysisTraining
MichaelOlafusi
31

MicrosoftPowerBI
MichaelOlafusi
17

UrBizEdgeMicrosoftExcelandBusinessDataAnalysisTraininginLagos
MichaelOlafusi
261

MicrosoftPowerBI
MichaelOlafusi
179

Microsoftexceltrainingforprofessionals
MichaelOlafusi
180

Urbizedgemicrosoftexcelandbusinessdataanalysistraining
MichaelOlafusi
99

Zenithbankannualreport2014
MichaelOlafusi
389

Accessbankannualreport2014
MichaelOlafusi
239

Unileverannualreport2014
MichaelOlafusi
444

PZCussonsAnnualReport2013
MichaelOlafusi
306

GuinnessNigeriaPLCAnnualReport2014
MichaelOlafusi
309

UBAAnnualReport2014
MichaelOlafusi
842

SterlingBankAnnualReport2014
MichaelOlafusi
536

NigerianBreweriesAnnualReport2014
MichaelOlafusi
1,657

IHSAnnualReport2012
MichaelOlafusi
321
English
Espanol
Portugues
Franais
Deutsche
About
Dev&API
Blog
Terms
Privacy
Copyright
Support

LinkedInCorporation2015

ShareClipboard

Email

Enteremailaddresses
Addamessage

From
Send

Emailsentsuccessfully..
Facebook
Twitter
LinkedIn
Google+
Link
Publicclipboardsfeaturingthisslide

Nopublicclipboardsfoundforthisslide

SavethemostimportantslideswithClipping
Clippingisahandywaytocollectandorganizethemostimportantslidesfromapresentation.You
cankeepyourgreatfindsinclipboardsorganizedaroundtopics.
Startclipping
Nothanks.Continuetodownload.

Savethisdocument

Das könnte Ihnen auch gefallen