You are on page 1of 59

HOME AUTOMATION SYSTEM

Table of Content
1. Abstract----------------------------------------------------------------------------------------3 2. Literature Review -----------------------------------------------------------------------------4 3. Project Plan 3.1 Problem Statement --------------------------------------------------------------------------5 3.2 Operating Environment ----------------------------------------------------------------------5 3.3 Intended Users & Uses ----------------------------------------------------------------------5 3.4 Assumptions ---------------------------------------------------------------------------------6 4. Proposed Approach 4.1 Functional Requirements ---------------------------------------------------------------------6 4.2 Constraint Considerations -------------------------------------------------------------------7

GCOEC/INSTRUMENTATION/2012-13

Page 1

HOME AUTOMATION SYSTEM

4.3 Technology Considerations ------------------------------------------------------------------7 4.4 Technical Approach --------------------------------------------------------------------------7 5. Testing Requirements 5.1 GSM Receiver --------------------------------------------------------------------------------8 5.2 GSM to Microcontroller ----------------------------------------------------------------------8 5.3 Decoding of Remote Users commands -----------------------------------------------------9 5.4 I/O Commands Voltage ---------------------------------------------------------------------9 5.5 I/O Command Storage ----------------------------------------------------------------------9 5.6 Circuits Power Surge Protection ----------------------------------------------------------10 5.7 End Product Functionalities -----------------------------------------------------------------10 6. System Block diagram ------------------------------------------------------------------------11 7. Circuit Diagram
GCOEC/INSTRUMENTATION/2012-13 Page 2

HOME AUTOMATION SYSTEM

7.1 Circuit Diagram ------------------------------------------------------------------------------12 7.2 Power Supply Section -----------------------------------------------------------------------13 7.3 Relay Driver Circuit-------------------------------------------------------------------------13 8. PCB Layout -----------------------------------------------------------------------------------14 9. Microcontroller Programming ---------------------------------------------------------------15 10. Component List------------------------------------------------------------------------------32 11. Component Description 11.1 Resistors -----------------------------------------------------------------------------------33 11.2 Capacitors ---------------------------------------------------------------------------------33 11.3 LED -----------------------------------------------------------------------------------------34 11.4 Transistors ---------------------------------------------------------------------------------35 11.5 Transformer -------------------------------------------------------------------------------35

GCOEC/INSTRUMENTATION/2012-13

Page 3

HOME AUTOMATION SYSTEM

11.6 Diodes --------------------------------------------------------------------------------------36 11.7 Relay ----------------------------------------------------------------------------------------37 11.8 Microcontroller PIC16F676 11.8.1 Features ----------------------------------------------------------------------------------38 11.8.2 Pin Out -----------------------------------------------------------------------------------39 11.8.3 Block Diagram ----------------------------------------------------------------------------40 11.9 DTMF Decoder MT8870 11.9.1 Description & Features -------------------------------------------------------------------41 11.9.2 Pin Out Description -----------------------------------------------------------------------42 11.10 ULN 2003 IC -------------------------------------------------------------------------------43 11.11 Voltage Regulator IC MC7812 & LM7805 ----------------------------------------------------44 11.12 Diode IN4007 ------------------------------------------------------------------------------45

GCOEC/INSTRUMENTATION/2012-13

Page 4

HOME AUTOMATION SYSTEM

12. PCB Manufacturing Process ----------------------------------------------------------------46 13. Design Specification 13.1 PCB Designing ------------------------------------------------------------------------------47 13.2 LAYOUT Design -----------------------------------------------------------------------------47 13.3 Etching Process ---------------------------------------------------------------------------48 13.4 Component Assembly ----------------------------------------------------------------------49 13.5 Soldering ----------------------------------------------------------------------------------50 14. Working --------------------------------------------------------------------------------------51 15. Flowchart -----------------------------------------------------------------------------------52 16. Applications---------------------------------------------------------------------------------53 17. Chronology-----------------------------------------------------------------------------------54 18. Bibliography ---------------------------------------------------------------

----55

GCOEC/INSTRUMENTATION/2012-13

Page 5

HOME AUTOMATION SYSTEM

1. ABSTRACT

Our project Home Automation System is a setup or system in which we can easily switch ON/OFF the appliances used in home. The appliances are connected through a circuit which is connected to a GSM mobile phone via a DTMF Tone Decoder IC. The human mind always needs information of interest to control systems of his/her choice. In the age of electronic systems it is important to be able to control and acquire information from everywhere.Although many methods to remotely control systems have been devised, the methods have the problems such as the need for special devices and software to control the system. This project suggests a method for control using the DTMF tone generated when the user pushes mobile phone keypad buttons or when connected to a remote mobile system. The proposed work has been done experimentally and has been verified in real time. Our project offers a novel solution for this problem by using a GSM mobile phone, a common electronic gadget. This device is build around PSoC, a powerful system-on-chip. This uses DTMF (Dual Tone Multi frequency) signals from mobile phone keypad to attain its functionality. For decoding the DTMF tones, we are using MT8870, CMOS Integrated DTMF Receiver. FEATURES The main features of our device control system are:1) Easy control of devices through mobile phone 2) Can control (on/off) a maximum of 5 devices (by using decoder we can increase this number to 256)

GCOEC/INSTRUMENTATION/2012-13

Page 6

HOME AUTOMATION SYSTEM

2. Literature Review
Smart home is one of the recent fields in the context of computer science. The paper named as Remote mobile control of home appliances by F. Meija, M. Nikolova and P. Voorwinden depicts on the home controlling using WAP protocol. The architecture mentioned by them is much complex but it gives an initial idea about the remote home appliance controlling. Smart home studies sometimes affected by the concern about the possible harms to the humans health. A great research was done by Toril Laberg, Directorate for Health and Social Affairs of the Delta Centre, Norway. He later publish in his paper named Smart Home Technology: Technology supporting independent living - does it have an impact on health? that there is no harm on humans health by the technical setup required to support smart home technologies. Scott Davidoff, Min Kyung Lee, Charles Yiu, John Zimmerman, and Anind K. Dey in their journal named Principles of Smart Home Control describe the control that families want and suggest seven design principles that will help end-user programming systems deliver that control. Tatsuya Yamazaki in his journal The Ubiquitous Home suggests that automation should not become a goal of the smart home technologies. In this paper he represents a real-life test bed, called the Ubiquitous Home. In the Ubiquitous Home, a robot plays a role of interface for the residents. Three kinds of context-aware services have been implemented and a real-life living experiment was conducted. The experimental results were also reported.
GL OBUS ENGINEERING COLLEGE, BHOPAL

Page 3
Department of Electronics & Communication.

Recently some projects are organized for building the architecture of controlling home appliance using voice commands. VoiceXML is used for that purpose. A smart house system named NETVOX [18] based on the ZigBee standard is introduced recently. The system can use for home automation and industrial controls. It provides security, temperature, humidity, lighting, sensor, and multimedia control for comfort, convenience, and safety wirelessly. The system may be accessed and controlled over the telephone or over the Internet.
GCOEC/INSTRUMENTATION/2012-13 Page 7

HOME AUTOMATION SYSTEM

3. Project

Plan

This section will state the basic problem, and the basic characteristics of the project, such as operating environment, users, etc. 3.1 Problem Statement The objective of this project is to develop a device that allows for a user to remotely control multiple home appliances using a cellular phone. This system will be a powerful and flexible tool that will offer this service at any time, and from anywhere with the constraints of the technologies being applied. Possible target appliances include (but are not limited to) climate control systems, security systems, and lights; anything with an electrical interface. The proposed approach for designing this system is to implement a microcontroller-based control module that receives its instructions and commands from a cellular phone over the GSM(Global System for Mobile Communications) network. The microcontroller then will carry out the issued commands.

3.2 Operating Environment The control system will include two separate units: the cellular phone, and the receiving control unit. There will therefore be two operating environments. The cellular phone will operate indoors and outdoors whereas the receiving control unit will operate indoors within the temperature and humidity limits for proper operation of the hardware.
GL OBUS ENGINEERING COLLEGE, BHOPAL

Page 5
Dartcation

3.3 Intended Users and Uses This product is aimed toward average consumers who wish to control household appliances remotely from their cell phones provided that the appliances are electrically controllable. Example of feasible appliances and applications under consideration include; enable/disable security systems, fans, lights, kitchen appliances, and a heating/ventilation/air conditioning system.

GCOEC/INSTRUMENTATION/2012-13

Page 8

HOME AUTOMATION SYSTEM

3.4 Assumptions The following is a list of assumptions for the project:1. The user and receiver control unit will establish communication via GSM. 2. The cell phone and service provider chosen will support calling service. 3. The user is familiar with the call process & IVRS on cell phone. 4. Service charges from service provider may apply. 5. The controlled appliances will have to have an electrical interface in order to be controlled by microcontroller.

4. Proposed approach This section outlines the criteria that will be considered in the development of the control system. 4.1 Functional Requirements The following is a list of functional requirements of the control unit/module. The Cellular Unit will have the ability to connect to the cellular network automatically. The Cellular Unit will be able to receive call and will be able to send DTMF tone to the DTMF Decoder IC. The DTMF Decoder IC will decode the (pressed no. by users cell phone & received on Cellular Unit) DTMF tone into the 4bit BCD output signal. The microcontroller connected to the DTMF decoder IC will receive the BCD output. The logic programmed in microcontroller drive the signal to the O/P ports of microcontroller as per the BCD O/P. Microcontroller will issue its command to the electrical appliances through a simple control circuit.

GCOEC/INSTRUMENTATION/2012-13

Page 9

HOME AUTOMATION SYSTEM

4.2 Constraint Considerations The following is a list of constraint considerations: The controlled appliances will need an electrical control interface. This simple system is only capable of controlling electrical devices. The control module will need to be shielded against electrostatic discharges. This will increase reliability of the system.

4.3 Technology Considerations The considerations for this system will include a choice of networks, communication protocols, and interfaces. Cellular Networks: The widely available networks are based on GSM. This network provides a wide area of coverage and can be utilized more cost-effectively for this project. Communication protocols: The available communication protocols are DTMF, GPRS and SMS. The DTMF is the most efficient because this project requires a cellular communication and only by pressing keys we can control appliances. I/O interfaces between microcontroller and devices: Serial or parallel I/O will be considered as options for connection between the GSM receiver and the microcontroller. Using the microcontroller,a control circuit will be implemented to control the electrical appliances. 4.4 Technical Approach Assuming that the control unit is powered and operating properly, the process of controlling a home device will proceed through the following steps: The remote user makes a call to the GSM cellular unit and commands to the receiver. GSM receiver receives call automatically from user cell phone by auto answering mode. After receiving call by GSM cellular unit user press the keys on his cell phone. GSM receiver receives the appropriate DTMF tone.
GCOEC/INSTRUMENTATION/2012-13 Page 10

HOME AUTOMATION SYSTEM

The DTMF decoder IC connected to GSM receiver detects the pressed DTMF tone & converts it to the 4 bit BCD O/P. DTMF decoder IC sends the BCD O/P to the microcontroller. Microcontroller issues commands to the appliances via relays connected to its O/P ports.

5. Testing Requirements
The following testing requirements will be indicators that the system can successfully be implemented. 1) The GSM receiver will be tested for successful communication with network. This will test include automation and consistency of the connection and will be conducted by team members in the following way: The cellular phone will dial the GSM receivers number.Once the connection is established a stream of data will be send to the GSM receiver. The GSM receiver will be given data to be transmitted to the cellular phone. Success/Failure criteria: The data received will be observed on both ends to verify its consistency. The test will be considered successful if the integrity of the sent and received data is maintained upstream. It will be considered a failure otherwise. 2) The GSM to microcontroller driver will be tested by verifying the integrity of command strings sent from the remote user. The following procedure will be performed by team members for this phase: The remote user will send a command to the control module. The contents of the data stream will be observed at the GSM communication port. These contents will be compared with those received and stored at the microcontrollers corresponding communication port. Success/Failure criteria: The test will be considered successful if the integrity of the data sent upstream is maintained. It will be considered a failure otherwise.

GCOEC/INSTRUMENTATION/2012-13

Page 11

HOME AUTOMATION SYSTEM

3) Proper decoding of the remote users commands and issuance of the equivalent commands to the controlled device will be performed by team members using the following procedure: A simulated instruction will be fed to the microcontroller communication port. The output command at the I/O interface with the corresponding controlled device will be observed. Success/Failure criteria: The test will be considered a success if the resulting command issued from the microcontroller is sent to the right I/O address for the desired controlled device and if that command is consistent with the command which is expected. The test will be considered a failure otherwise. 4) The I/O commands voltage will be tested to meet the levels required to actuate the individual devices. The following procedure will be performed by team members: A simulated command from the microcontroller will be written to its I/O port. The output voltage at the desired devices control interface will be measured to verify its strength. Success/Failure criteria: The test will be considered successful if the simulated command from the microcontroller causes the proper voltage to be observed at the desired devices control interface. 5) The ability of I/O to detect an input voltage and store a value in the microcontrollers memory will be tested by team members: Test voltages to the input of the I/O will be applied. The contents of the memory shall be checked for validity. Success/Failure criteria: The testing will be considered successful if the values of the memory are as expected. The test will be considered a failure otherwise.

GCOEC/INSTRUMENTATION/2012-13

Page 12

HOME AUTOMATION SYSTEM

6) The circuits power surge protection will be tested for acceptable performance by all team members using the following procedure: The circuits power supply will be removed from the circuit and connected to a dummy load. A simulated voltage spike will be inputted by using a step signal from a signal generator. The output voltage and current will be measured at the load. Success/Failure criteria: The success of the test will be determined by verifying that the output signal to the dummy load falls with the tolerance indicated by the microcontroller and the GSM chips manufacturers. The test will be considered a failure if the measured characteristics of the power supplys output do not meet the manufacturers requirements. 7) The end-product functionalities will be tested by team members and non-team members in the following way: Team members will ensure that all subsystems function properly together from remote user command to execution and back to completion status notification. Non-team members from the general public will be allowed to access and use the control unit for a frame of time. Afterward, the non-team member testing subjects will fill out a survey on the end-products functionalities, ease of use, difficulties, etc. Success/Failure criteria: The testing will be considered a success if the testing subjects find the end-product user friendly, and easy to figure out.

GCOEC/INSTRUMENTATION/2012-13

Page 13

HOME AUTOMATION SYSTEM

6. System Block Diagram


The block diagram of the system is given below:

GCOEC/INSTRUMENTATION/2012-13

Page 14

HOME AUTOMATION SYSTEM

7.CIRCUIT DIAGRAM

GCOEC/INSTRUMENTATION/2012-13

Page 15

HOME AUTOMATION SYSTEM

RELAY DRIVER CIRCUIT

POWER SUPPLY SECTION

GCOEC/INSTRUMENTATION/2012-13

Page 16

HOME AUTOMATION SYSTEM

8. PCB LAYOUT

GCOEC/INSTRUMENTATION/2012-13

Page 17

HOME AUTOMATION SYSTEM

9. Microcontroller Programming
The microcontroller executes the program loaded in its Flash memory. This is the so called executable code comprised of seemingly meaningless sequence of zeros and ones. It is organized in 12-, 14- or 16-bit wide words, depending on the microcontrollers architecture. Every word is considered by the CPU as a command being executed during the operation of the microcontroller. For practical reasons, as it is much easier for us to deal with hexadecimal number system, the executable code is often represented as a sequence of hexadecimal numbers called a Hex code. It used to be written by the programmer. All instructions that the microcontroller can recognize are together called the Instruction set. As for PIC microcontrollers the programming words of which are comprised of 14 bits, the instruction set has 35 different instructions in total. PIC16F676 IC is programmed by the MicroC (Programming software). We have used this Software for programming the 4 bit input coming into microcontroller to drive the appropriate relays.

Programming Codes
; ADDRESS OPCODE ASM ; ---------------------------------------------$0000 $288D GOTO _main $0004 $ _calculateporta: $0004 $ Home_Automation_L_3: $0004 $1303 BCF STATUS, RP1 $0005 $1283 BCF STATUS, RP0 $0006 $082B MOVF FARG_calculateporta, 0 $0007 $3A00 XORLW 0 $0008 $1D03 BTFSS STATUS, Z $0009 $280C GOTO Home_Automation_L_4 ;Home_Automation.pbas,56 :: $008D $ _main_main: $008D $008E $008F $0090 $0091 $0093 $0094 $0095 $0096 $0097 $0098 $0099 $009A $1303 $1683 $0187 $303F $0085 $30FF $1283 $0099 $3007 $1683 $009F $1283 $0187 BCF BSF CLRF MOVLW MOVWF MOVLW BCF MOVWF MOVLW BSF MOVWF BCF CLRF main: STATUS, RP1 STATUS, RP0 TRISC, 1 63 TRISA 255 STATUS, RP0 CMCON 7 STATUS, RP0 ADCON1 STATUS, RP0 PORTC, 1

GCOEC/INSTRUMENTATION/2012-13

Page 18

HOME AUTOMATION SYSTEM


$009B $009C $009D $009E $009F $00A0 $00A1 $00A2 $00A3 $00A4 $00A5 $00A6 $00A6 $00A7 $00A7 $00A8 $00A9 $00AA $00AB $00AB $00AC $00AC $00AD $00AE $00AF $00B0 $00B1 $00B2 $00B3 $00B4 $00B5 $00B6 $00B7 $00B8 $00B9 $00BA $00BB $00BC $00BC $00BD $00BE $00BF $00C0 $00C1 $00C2 $00C3 $00C4 $00C5 $30BD $00A1 $301E $00A2 $01A3 $01A4 $01A5 $01A6 $01A7 $01A8 $01A9 $ $01A9 $ $0829 $3C05 $1C03 $28D1 $ $1687 $ $3082 $00DB $30FF $00DA $0BDB $28B3 $28B6 $0BDA $28B3 $28B0 $3087 $00DA $0BDA $28B8 $0000 $1287 $ $3041 $00DB $30FF $00DA $0BDB $28C3 $28C6 $0BDA $28C3 $28C0 _main_chkpw: CLRF Home_Automation_L_42: MOVF SUBLW BTFSS GOTO Home_Automation_L_46: BSF Home_Automation_L_47: MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ GOTO NOP BCF Home_Automation_L_49: MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO _delaywait, 1 _delaywait, 0 5 STATUS, C Home_Automation_L_45 PORTC, 5 130 STACK_11 255 STACK_10 STACK_11, F $+2 $+4 STACK_10, F $-1 $-5 135 STACK_10 STACK_10, F $-1 PORTC, 5 65 STACK_11 255 STACK_10 STACK_11, F $+2 $+4 STACK_10, F $-1 $-5 MOVLW MOVWF MOVLW MOVWF CLRF CLRF CLRF CLRF CLRF CLRF CLRF 189 _pw 30 _pw+1 _digitno, 1 _temppw _temppw+1 _tempdeviceno, 1 _deviceno, 1 _getresponse, 1 _delaywait, 1

GCOEC/INSTRUMENTATION/2012-13

Page 19

HOME AUTOMATION SYSTEM


$00C6 $00C7 $00C8 $00C9 $00CA $00CB $00CC $00CD $00CE $00CF $00CF $00D0 $00D1 $00D1 $00D2 $00D3 $00D4 $00D5 $00D5 $00D6 $00D7 $00D8 $00D9 $00DA $00DA $00DB $00DC $00DD $00DE $00DF $00E0 $00E1 $00E2 $00E2 $00E3 $00E4 $00E5 $00E6 $00E7 $00E8 $00E9 $00EA $00EB $00EC $00ED $00EE $00EF $00F0 $00F1 $00F2 $30C3 $00DA $0BDA $28C8 $0000 $0829 $3A05 $1903 $28D1 $ $0AA9 $28A7 $ $01A4 $01A5 $3001 $00A3 $ $0823 $3C04 $1C03 $2971 $01A9 $ $0A29 $00D2 $0852 $00A9 $0852 $3A64 $1D03 $28E6 $ $01A4 $01A5 $1287 $ $3082 $00DB $30FF $00DA $0BDB $28ED $28F0 $0BDA $28ED $28EA $3087 $00DA $0BDA MOVLW MOVWF DECFSZ GOTO NOP MOVF XORLW BTFSC GOTO Home_Automation_L_43: INCF GOTO Home_Automation_L_45: CLRF CLRF MOVLW MOVWF Home_Automation_L_50: MOVF SUBLW BTFSS GOTO CLRF Home_Automation_L_54: INCF MOVWF MOVF MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_59: CLRF CLRF BCF Home_Automation_L_63: MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ _delaywait, 0 STACK_2 STACK_2, 0 _delaywait STACK_2, 0 100 STATUS, Z Home_Automation_L_60 _temppw _temppw+1 PORTC, 5 195 STACK_10 STACK_10, F $-1 _delaywait, 0 5 STATUS, Z Home_Automation_L_45 _delaywait, 1 Home_Automation_L_42 _temppw _temppw+1 1 _digitno _digitno, 0 4 STATUS, C Home_Automation_L_53 _delaywait, 1

130 STACK_11 255 STACK_10 STACK_11, F $+2 $+4 STACK_10, F $-1 $-5 135 STACK_10 STACK_10, F

GCOEC/INSTRUMENTATION/2012-13

Page 20

HOME AUTOMATION SYSTEM


$00F3 $00F4 $00F5 $00F5 $00F6 $00F7 $00F8 $00F9 $00FA $00FB $00FC $00FD $00FD $00FE $00FE $00FF $00FF $00FF $00FF $0100 $0101 $0102 $0103 $0104 $0105 $0106 $0107 $0107 $0108 $0108 $0109 $0109 $0109 $010A $0119 $011A $011A $011B $011C $011D $011E $011F $0120 $0121 $0122 $0123 $0123 $0124 $0125 $0126 $28F2 $0000 $ $3000 $1A85 $3001 $00D2 $0852 $3A01 $1D03 $28FE $ $28FF $ $28DA $ $ $ $3000 $1A85 $3001 $00D2 $0852 $3A00 $1D03 $2908 $ $2909 $ $28FF $ $ $1687 $ $1287 $ $0805 $00AA $082A $00AB $2004 $0820 $3A0A $1D03 $2926 $ $01A4 $01A5 $28A6 $ GOTO NOP Home_Automation_L_55: MOVLW BTFSC MOVLW MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_58: GOTO Home_Automation_L_57: GOTO Home_Automation_L_56: Home_Automation_L_64: Home_Automation_L_65: MOVLW BTFSC MOVLW MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_68: GOTO Home_Automation_L_67: GOTO Home_Automation_L_66: Home_Automation_L_69: BSF Home_Automation_L_70: BCF Home_Automation_L_72: MOVF MOVWF MOVF MOVWF CALL MOVF XORLW BTFSS GOTO Home_Automation_L_73: CLRF CLRF GOTO Home_Automation_L_74: 0 PORTA, 5 1 STACK_2 STACK_2, 0 0 STATUS, Z Home_Automation_L_67 Home_Automation_L_66 Home_Automation_L_64 $-1

0 PORTA, 5 1 STACK_2 STACK_2, 0 1 STATUS, Z Home_Automation_L_57 Home_Automation_L_56 Home_Automation_L_54

PORTC, 5 PORTC, 5 PORTA, 0 _tempporta _tempporta, 0 FARG_calculateporta _calculateporta _inporta, 0 10 STATUS, Z Home_Automation_L_74 _temppw _temppw+1 _main_chkpw

GCOEC/INSTRUMENTATION/2012-13

Page 21

HOME AUTOMATION SYSTEM


$0126 $0126 $0126 $0127 $0128 $0129 $012A $012A $012B $012C $012D $012E $012F $0130 $0131 $0132 $0133 $0134 $0135 $0136 $0137 $0138 $0139 $0139 $0139 $013A $013B $013C $013D $013D $013E $013F $0140 $0141 $0142 $0143 $0144 $0145 $0146 $0147 $0148 $0149 $014A $014B $014B $014B $014C $014D $014E $014F $014F $0150 $0151 $0152 $0153 $ $ $0823 $3A01 $1D03 $2939 $ $0820 $00D0 $01D1 $30E8 $00D4 $3003 $00D5 $2062 $0850 $07A4 $0851 $1803 $3F01 $07A5 $296B $ $ $0823 $3A02 $1D03 $294B $ $0820 $00D0 $01D1 $3064 $00D4 $01D5 $2062 $0850 $07A4 $0851 $1803 $3F01 $07A5 $296B $ $ $0823 $3A03 $1D03 $295D $ $0820 $00D0 $01D1 $300A $00D4 Home_Automation_L_75: Home_Automation_L_78: MOVF XORLW BTFSS GOTO Home_Automation_L_77: MOVF MOVWF CLRF MOVLW MOVWF MOVLW MOVWF CALL MOVF ADDWF MOVF BTFSC ADDLW ADDWF GOTO Home_Automation_L_79: Home_Automation_L_81: MOVF XORLW BTFSS GOTO Home_Automation_L_80: MOVF MOVWF CLRF MOVLW MOVWF CLRF CALL MOVF ADDWF MOVF BTFSC ADDLW ADDWF GOTO Home_Automation_L_82: Home_Automation_L_84: MOVF XORLW BTFSS GOTO Home_Automation_L_83: MOVF MOVWF CLRF MOVLW MOVWF _digitno, 0 1 STATUS, Z Home_Automation_L_79 _inporta, 0 STACK_0 STACK_0+1 232 STACK_4 3 STACK_4+1 _mul_16x16_u STACK_0, 0 _temppw, 1 STACK_0+1, 0 STATUS, C 1 _temppw+1, 1 Home_Automation_L_76

_digitno, 0 2 STATUS, Z Home_Automation_L_82 _inporta, 0 STACK_0 STACK_0+1 100 STACK_4 STACK_4+1 _mul_16x16_u STACK_0, 0 _temppw, 1 STACK_0+1, 0 STATUS, C 1 _temppw+1, 1 Home_Automation_L_76

_digitno, 0 3 STATUS, Z Home_Automation_L_85 _inporta, 0 STACK_0 STACK_0+1 10 STACK_4

GCOEC/INSTRUMENTATION/2012-13

Page 22

HOME AUTOMATION SYSTEM


$0154 $0155 $0156 $0157 $0158 $0159 $015A $015B $015C $015D $015D $015D $015E $015F $0160 $0161 $0161 $0162 $0163 $0164 $0165 $0166 $0167 $0168 $0169 $016A $016B $016B $016B $016C $016D $016E $016F $016F $0170 $0171 $0171 $0172 $0173 $0174 $0175 $0176 $0177 $0177 $0178 $0179 $0179 $017A $017B $017C $019B $019C $01D5 $2062 $0850 $07A4 $0851 $1803 $3F01 $07A5 $296B $ $ $0823 $3A04 $1D03 $296B $ $0820 $00D0 $01D1 $0850 $07A4 $0851 $1803 $3F01 $07A5 $296B $ $ $0823 $3A04 $1903 $2971 $ $0AA3 $28D5 $ $0825 $0622 $1D03 $2977 $0821 $0624 $ $1D03 $299C $ $01A4 $01A5 $1287 $ $299F $ CLRF CALL MOVF ADDWF MOVF BTFSC ADDLW ADDWF GOTO Home_Automation_L_85: Home_Automation_L_87: MOVF XORLW BTFSS GOTO Home_Automation_L_86: MOVF MOVWF CLRF MOVF ADDWF MOVF BTFSC ADDLW ADDWF GOTO Home_Automation_L_88: Home_Automation_L_76: MOVF XORLW BTFSC GOTO Home_Automation_L_51: INCF GOTO Home_Automation_L_53: MOVF XORWF BTFSS GOTO MOVF XORWF L_main_0: BTFSS GOTO Home_Automation_L_89: CLRF CLRF BCF Home_Automation_L_93: GOTO Home_Automation_L_90: STATUS, Z Home_Automation_L_90 _temppw _temppw+1 PORTC, 5 _main_showstatus STACK_4+1 _mul_16x16_u STACK_0, 0 _temppw, 1 STACK_0+1, 0 STATUS, C 1 _temppw+1, 1 Home_Automation_L_76

_digitno, 0 4 STATUS, Z Home_Automation_L_88 _inporta, 0 STACK_0 STACK_0+1 STACK_0, 0 _temppw, 1 STACK_0+1, 0 STATUS, C 1 _temppw+1, 1 Home_Automation_L_76

_digitno, 0 4 STATUS, Z Home_Automation_L_53 _digitno, 1 Home_Automation_L_50 _temppw+1, 0 _pw+1, 0 STATUS, Z L_main_0 _pw, 0 _temppw, 0

GCOEC/INSTRUMENTATION/2012-13

Page 23

HOME AUTOMATION SYSTEM


$019C $019D $019E $019F $019F $01A0 $01A1 $01A1 $01A2 $01A3 $01A4 $01A5 $01A6 $01A7 $01A7 $01A8 $01A9 $01AA $01AB $01AC $01AD $01AE $01AF $01B0 $01B0 $01B1 $01B2 $01B3 $01B4 $01B5 $01B6 $01B6 $01B7 $01B8 $01B9 $01BA $01BB $01BB $01BC $01BD $01BE $01BF $01C0 $01C1 $01C1 $01C2 $01C3 $01C4 $01C5 $01C5 $01C5 $01C6 $01C6 $01C7 $01C8 $01A4 $01A5 $28A6 $ $01A4 $01A5 $ $0825 $3C00 $1D03 $29A7 $0824 $3C04 $ $1C03 $2A31 $3001 $00D2 $0824 $00D3 $0852 $00D0 $0853 $ $1903 $29B6 $0DD0 $1050 $3FFF $29B0 $ $0807 $05D0 $0850 $00D2 $0853 $ $1903 $29C1 $0CD2 $13D2 $3FFF $29BB $ $0852 $3A00 $1D03 $29E6 $ $ $1687 $ $3003 $00DC $30FF CLRF CLRF GOTO _main_showstatus: CLRF CLRF Home_Automation_L_94: MOVF SUBLW BTFSS GOTO MOVF SUBLW L_main_1: BTFSS GOTO MOVLW MOVWF MOVF MOVWF MOVF MOVWF MOVF L_main_2: BTFSC GOTO RLF BCF ADDLW GOTO L_main_3: MOVF ANDWF MOVF MOVWF MOVF L_main_4: BTFSC GOTO RRF BCF ADDLW GOTO L_main_5: MOVF XORLW BTFSS GOTO Home_Automation_L_98: STACK_2, 0 0 STATUS, Z Home_Automation_L_99 STATUS, Z L_main_5 STACK_2, 1 STACK_2, 7 255 L_main_4 PORTC, 0 STACK_0, 1 STACK_0, 0 STACK_2 STACK_3, 0 STATUS, Z L_main_3 STACK_0, 1 STACK_0, 0 255 L_main_2 _temppw _temppw+1 _temppw+1, 0 0 STATUS, Z L_main_1 _temppw, 0 4 STATUS, C Home_Automation_L_97 1 STACK_2 _temppw, 0 STACK_3 STACK_2, 0 STACK_0 STACK_3, 0 _temppw _temppw+1 _main_chkpw

Home_Automation_L_101: BSF PORTC, 5 Home_Automation_L_102: MOVLW MOVWF MOVLW 3 STACK_12 255

GCOEC/INSTRUMENTATION/2012-13

Page 24

HOME AUTOMATION SYSTEM


$01C9 $01CA $01CB $01CC $01CD $01CE $01CF $01D0 $01D1 $01D2 $01D3 $01D4 $01D5 $01D6 $01D7 $01D8 $01D9 $01DA $01DB $01DC $01DD $01DE $01DF $01E0 $01E1 $01E2 $01E3 $01E4 $01E5 $01E6 $01E6 $01E6 $01E7 $01E7 $01E8 $01E9 $01EA $01EB $01EC $01ED $01EE $01EF $01F0 $01F1 $01F2 $01F3 $01F4 $01F5 $01F6 $01F7 $01F8 $01F9 $01FA $01FB $01FC $01FD $01FE $01FF $00DB $30FF $00DA $0BDC $29CF $29D6 $0BDB $29D2 $29D5 $0BDA $29D2 $29CF $29CC $308C $00DB $30FF $00DA $0BDB $29DD $29E0 $0BDA $29DD $29DA $30A1 $00DA $0BDA $29E2 $0000 $2A05 $ $ $1687 $ $3002 $00DC $30FF $00DB $30FF $00DA $0BDC $29F0 $29F7 $0BDB $29F3 $29F6 $0BDA $29F3 $29F0 $29ED $3006 $00DB $30FF $00DA $0BDB $29FE $2A01 $0BDA $29FE MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO DECFSZ GOTO GOTO GOTO MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ GOTO NOP GOTO Home_Automation_L_99: Home_Automation_L_103: BSF PORTC, 5 Home_Automation_L_104: MOVLW MOVWF MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO DECFSZ GOTO GOTO GOTO MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO 2 STACK_12 255 STACK_11 255 STACK_10 STACK_12, $+2 $+8 STACK_11, $+2 $+4 STACK_10, $-1 $-5 $-9 6 STACK_11 255 STACK_10 STACK_11, $+2 $+4 STACK_10, $-1 STACK_11 255 STACK_10 STACK_12, $+2 $+8 STACK_11, $+2 $+4 STACK_10, $-1 $-5 $-9 140 STACK_11 255 STACK_10 STACK_11, $+2 $+4 STACK_10, $-1 $-5 161 STACK_10 STACK_10, $-1

F F F

F F

Home_Automation_L_100

F F F

F F

GCOEC/INSTRUMENTATION/2012-13

Page 25

HOME AUTOMATION SYSTEM


$0200 $0201 $0202 $0203 $0204 $0205 $0205 $0206 $29FB $300A $00DA $0BDA $2A03 $ $1287 $ GOTO MOVLW MOVWF DECFSZ GOTO Home_Automation_L_100: BCF PORTC, 5 Home_Automation_L_106: $-5 10 STACK_10 STACK_10, F $-1

$0225 $0226 $0227 $0228 $0229 $022A $022B $022B $022C $022D $022D $022E $022F $0230 $0231 $0231 $0231 $0232 $0233 $0233 $0234 $0235 $0236 $0237 $0238 $0239 $0239 $023A $023B $023C $023D $023E $023F $0240 $0241 $0242 $0243 $0243 $0243 $0243 $0244 $0245 $0246

$3000 $0625 $1D03 $2A2B $3004 $0624 $ $1903 $2A31 $ $0AA4 $1903 $0AA5 $29A1 $ $ $01A4 $01A5 $ $0825 $3C00 $1D03 $2A39 $0824 $3C64 $ $1C03 $2A6E $3000 $1A85 $3001 $00D2 $0852 $3A01 $1D03 $2A53 $ $ $ $3000 $1A85 $3001 $00D2

MOVLW XORWF BTFSS GOTO MOVLW XORWF L_main_6: BTFSC GOTO Home_Automation_L_95: INCF BTFSC INCF GOTO Home_Automation_L_97: _main_selectdevice: CLRF CLRF Home_Automation_L_107: MOVF SUBLW BTFSS GOTO MOVF SUBLW L_main_7: BTFSS GOTO MOVLW BTFSC MOVLW MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_111: Home_Automation_L_114: Home_Automation_L_115: MOVLW BTFSC MOVLW MOVWF

0 _temppw+1, 0 STATUS, Z L_main_6 4 _temppw, 0 STATUS, Z Home_Automation_L_97 _temppw, 1 STATUS, Z _temppw+1, 1 Home_Automation_L_94

_temppw _temppw+1 _temppw+1, 0 0 STATUS, Z L_main_7 _temppw, 0 100 STATUS, C Home_Automation_L_110 0 PORTA, 5 1 STACK_2 STACK_2, 0 1 STATUS, Z Home_Automation_L_112

0 PORTA, 5 1 STACK_2

GCOEC/INSTRUMENTATION/2012-13

Page 26

HOME AUTOMATION SYSTEM


$0247 $0248 $0249 $024A $024B $024B $024C $024C $024D $024D $024E $024F $0250 $0251 $0252 $0253 $0253 $0253 $0254 $0255 $0256 $0257 $0258 $0259 $025A $025B $025C $025D $025E $025F $0260 $0261 $0262 $0263 $0264 $0265 $0266 $0267 $0268 $0268 $0269 $026A $026A $026B $026C $026D $026E $026E $026F $026F $0270 $0271 $0852 $3A00 $1D03 $2A4C $ $2A4D $ $2A43 $ $0805 $00AA $082A $00AB $2004 $2A6F $ $ $3082 $00DB $30FF $00DA $0BDB $2A5A $2A5D $0BDA $2A5A $2A57 $3087 $00DA $0BDA $2A5F $0000 $3000 $0625 $1D03 $2A68 $3064 $0624 $ $1903 $2A6E $ $0AA4 $1903 $0AA5 $2A33 $ $28A6 $ $0820 $3A0B $1D03 MOVF XORLW BTFSS GOTO Home_Automation_L_118: GOTO Home_Automation_L_117: GOTO Home_Automation_L_116: MOVF MOVWF MOVF MOVWF CALL STACK_2, 0 0 STATUS, Z Home_Automation_L_117 Home_Automation_L_116 Home_Automation_L_114 PORTA, 0 _tempporta _tempporta, 0 FARG_calculateporta _calculateporta

GOTO _main_selecteddevicestatus Home_Automation_L_112: Home_Automation_L_113: MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ GOTO NOP MOVLW XORWF BTFSS GOTO MOVLW XORWF L_main_8: BTFSC GOTO Home_Automation_L_108: INCF BTFSC INCF GOTO Home_Automation_L_110: GOTO STATUS, Z Home_Automation_L_110 _temppw, 1 STATUS, Z _temppw+1, 1 Home_Automation_L_107 _main_chkpw 130 STACK_11 255 STACK_10 STACK_11, F $+2 $+4 STACK_10, F $-1 $-5 135 STACK_10 STACK_10, F $-1 0 _temppw+1, 0 STATUS, Z L_main_8 100 _temppw, 0

_main_selecteddevicestatus: MOVF XORLW BTFSS _inporta, 0 11 STATUS, Z

GCOEC/INSTRUMENTATION/2012-13

Page 27

HOME AUTOMATION SYSTEM


$0272 $0273 $0273 $0274 $0275 $0276 $0276 $0276 $0277 $0278 $0279 $027A $027A $027B $027C $027C $027C $027D $027E $027F $0280 $0280 $0281 $0281 $2A76 $ $30FF $0087 $299F $ $ $0820 $3A0C $1D03 $2A7C $ $0187 $299F $ $ $0820 $3A0A $1D03 $2A81 $ $28A6 $ $ GOTO Home_Automation_L_120 Home_Automation_L_119: MOVLW MOVWF 255 PORTC

GOTO _main_showstatus Home_Automation_L_120: Home_Automation_L_121: MOVF XORLW BTFSS GOTO Home_Automation_L_122: CLRF _inporta, 0 12 STATUS, Z Home_Automation_L_123 PORTC, 1

GOTO _main_showstatus Home_Automation_L_123: Home_Automation_L_124: MOVF XORLW BTFSS GOTO Home_Automation_L_125: _inporta, 0 10 STATUS, Z Home_Automation_L_126

GOTO _main_chkpw Home_Automation_L_126: Home_Automation_L_127:

$02A0 $02A1 $02A2 $02A2 $02A3 $02A4 $02A5 $02A6 $02A7 $02A8 $02A9 $02AA $02AA $02AB $02AC $02AD $02AE $02AF $02B0 $02B1 $02B2

$3002 $00A6 $ $0826 $3C06 $1C03 $2B32 $0826 $0620 $1D03 $2B2C $ $0826 $00A7 $3002 $0226 $00D0 $3001 $00D2 $0850 $00D3

MOVLW MOVWF Home_Automation_L_128: MOVF SUBLW BTFSS GOTO MOVF XORWF BTFSS GOTO Home_Automation_L_132: MOVF MOVWF MOVLW SUBWF MOVWF MOVLW MOVWF MOVF MOVWF

2 _tempdeviceno _tempdeviceno, 0 6 STATUS, C Home_Automation_L_131 _tempdeviceno, 0 _inporta, 0 STATUS, Z Home_Automation_L_133 _tempdeviceno, 0 _deviceno 2 _tempdeviceno, 0 STACK_0 1 STACK_2 STACK_0, 0 STACK_3

GCOEC/INSTRUMENTATION/2012-13

Page 28

HOME AUTOMATION SYSTEM


$02B3 $02B4 $02B5 $02B6 $02B6 $02B7 $02B8 $02B9 $02BA $02BB $02BC $02BC $02BD $02BE $02BF $02C0 $02C1 $02C1 $02C2 $02C3 $02C4 $02C5 $02C6 $02C7 $02C7 $02C8 $02C9 $02CA $02CB $02CB $02CB $02CC $0852 $00D0 $0853 $ $1903 $2ABC $0DD0 $1050 $3FFF $2AB6 $ $0807 $05D0 $0850 $00D2 $0853 $ $1903 $2AC7 $0CD2 $13D2 $3FFF $2AC1 $ $0852 $3A00 $1D03 $2AEC $ $ $1687 $ MOVF MOVWF MOVF L_main_9: BTFSC GOTO RLF BCF ADDLW GOTO L_main_10: MOVF ANDWF MOVF MOVWF MOVF L_main_11: BTFSC GOTO RRF BCF ADDLW GOTO L_main_12: MOVF XORLW BTFSS GOTO Home_Automation_L_135: STACK_2, 0 0 STATUS, Z Home_Automation_L_136 STATUS, Z L_main_12 STACK_2, 1 STACK_2, 7 255 L_main_11 PORTC, 0 STACK_0, 1 STACK_0, 0 STACK_2 STACK_3, 0 STATUS, Z L_main_10 STACK_0, 1 STACK_0, 0 255 L_main_9 STACK_2, 0 STACK_0 STACK_3, 0

Home_Automation_L_138: BSF PORTC, 5 Home_Automation_L_139:

$030C $030D $030E $030F $0310 $0311 $0312 $0313 $0314 $0315 $0316 $0317 $0318 $0319 $031A $031B $031C $031D $031E $031F $0320 $0321 $0322 $0323 $0324

$3003 $00DC $30FF $00DB $30FF $00DA $0BDC $2B15 $2B1C $0BDB $2B18 $2B1B $0BDA $2B18 $2B15 $2B12 $308C $00DB $30FF $00DA $0BDB $2B23 $2B26 $0BDA $2B23

MOVLW MOVWF MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO DECFSZ GOTO GOTO GOTO MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO

3 STACK_12 255 STACK_11 255 STACK_10 STACK_12, $+2 $+8 STACK_11, $+2 $+4 STACK_10, $-1 $-5 $-9 140 STACK_11 255 STACK_10 STACK_11, $+2 $+4 STACK_10, $-1

F F F

F F

GCOEC/INSTRUMENTATION/2012-13

Page 29

HOME AUTOMATION SYSTEM


$0325 $0326 $0327 $0328 $0329 $032A $032C $032D $032E $032F $0330 $0330 $0331 $0332 $0332 $0333 $0333 $0334 $0335 $0335 $0336 $0337 $0338 $0339 $033A $033B $033B $033C $033D $033E $033F $0340 $0341 $0342 $0343 $0344 $0345 $0345 $0345 $0345 $0346 $0347 $0348 $0349 $034A $034B $034C $034D $034D $034E $034E $034F $2B20 $30A1 $00DA $0BDA $2B28 $0000 $0826 $3A06 $1903 $2B32 $ $0AA6 $2AA2 $ $299F $ $01A4 $01A5 $ $0825 $3C00 $1D03 $2B3B $0824 $3C64 $ $1C03 $2BE5 $3000 $1A85 $3001 $00D2 $0852 $3A01 $1D03 $2BCA $ $ $ $3000 $1A85 $3001 $00D2 $0852 $3A00 $1D03 $2B4E $ $2B4F $ $2B45 $ GOTO MOVLW MOVWF DECFSZ GOTO NOP MOVF XORLW BTFSC GOTO Home_Automation_L_129: INCF GOTO Home_Automation_L_131: GOTO _main_makeonoff: CLRF CLRF Home_Automation_L_144: MOVF SUBLW BTFSS GOTO MOVF SUBLW L_main_13: BTFSS GOTO MOVLW BTFSC MOVLW MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_148: Home_Automation_L_151: Home_Automation_L_152: MOVLW BTFSC MOVLW MOVWF MOVF XORLW BTFSS GOTO Home_Automation_L_155: GOTO Home_Automation_L_154: GOTO Home_Automation_L_153: 0 PORTA, 5 1 STACK_2 STACK_2, 0 0 STATUS, Z Home_Automation_L_154 Home_Automation_L_153 Home_Automation_L_151 _temppw _temppw+1 _temppw+1, 0 0 STATUS, Z L_main_13 _temppw, 0 100 STATUS, C Home_Automation_L_147 0 PORTA, 5 1 STACK_2 STACK_2, 0 1 STATUS, Z Home_Automation_L_149 $-5 161 STACK_10 STACK_10, F $-1

_tempdeviceno, 0 6 STATUS, Z Home_Automation_L_131 _tempdeviceno, 1 Home_Automation_L_128 _main_showstatus

GCOEC/INSTRUMENTATION/2012-13

Page 30

HOME AUTOMATION SYSTEM


$034F $0350 $0351 $0352 $0353 $0354 $0355 $0356 $0357 $0358 $0358 $0359 $035A $035B $035C $035C $035D $035D $035D $035D $035D $035E $035F $0360 $0361 $0361 $0362 $0363 $0364 $0365 $0366 $0367 $0368 $0369 $036A $036B $036B $036C $036D $036E $036F $0370 $0371 $0371 $0372 $0373 $0374 $0393 $0394 $0394 $0805 $00AA $082A $00AB $2004 $0820 $3C01 $1803 $2B5D $ $0820 $3A0A $1903 $2B5D $ $2A6F $ $ $ $ $0820 $3A0A $1D03 $2B94 $ $3002 $0227 $00D4 $3001 $00D3 $0854 $00D2 $0853 $00D0 $0852 $ $1903 $2B71 $0DD0 $1050 $3FFF $2B6B $ $09D0 $0850 $0587 $ $299F $ $ MOVF MOVWF MOVF MOVWF CALL MOVF SUBLW BTFSC GOTO Home_Automation_L_156: MOVF XORLW BTFSC GOTO Home_Automation_L_159: PORTA, 0 _tempporta _tempporta, 0 FARG_calculateporta _calculateporta _inporta, 0 1 STATUS, C Home_Automation_L_157 _inporta, 0 10 STATUS, Z Home_Automation_L_160

GOTO _main_selecteddevicestatus Home_Automation_L_160: Home_Automation_L_161: Home_Automation_L_157: Home_Automation_L_158: MOVF XORLW BTFSS GOTO Home_Automation_L_162: MOVLW SUBWF MOVWF MOVLW MOVWF MOVF MOVWF MOVF MOVWF MOVF L_main_14: BTFSC GOTO RLF BCF ADDLW GOTO L_main_15: COMF STACK_0, F MOVF STACK_0, 0 ANDWF PORTC, 1 Home_Automation_L_166: GOTO _main_showstatus Home_Automation_L_163: Home_Automation_L_164: STATUS, Z L_main_15 STACK_0, 1 STACK_0, 0 255 L_main_14 _inporta, 0 10 STATUS, Z Home_Automation_L_163 2 _deviceno, 0 STACK_4 1 STACK_3 STACK_4, 0 STACK_2 STACK_3, 0 STACK_0 STACK_2, 0

GCOEC/INSTRUMENTATION/2012-13

Page 31

HOME AUTOMATION SYSTEM


$0394 $0395 $0396 $0397 $0398 $0398 $0399 $039A $039B $039B $039C $039D $039E $039F $03A0 $03A1 $03A2 $03A2 $03A3 $03A4 $03A5 $03A6 $03A7 $03A8 $03A8 $03A9 $03AA $03AA $03AB $03AC $03AD $03AE $03AF $03B0 $03B1 $03B2 $03B3 $03B4 $03B5 $03B6 $03B7 $03B8 $03B9 $03BA $03BB $03BC $03BD $03BE $03BF $03C0 $03C1 $03C2 $03C3 $03C4 $03C5 $03C6 $03C7 $03C8 $0820 $3A01 $1D03 $2BCA $ $3002 $0227 $00D4 $ $3001 $00D3 $0854 $00D2 $0853 $00D0 $0852 $ $1903 $2BA8 $0DD0 $1050 $3FFF $2BA2 $ $0850 $0487 $ $3003 $00DC $30FF $00DB $30FF $00DA $0BDC $2BB3 $2BBA $0BDB $2BB6 $2BB9 $0BDA $2BB6 $2BB3 $2BB0 $308C $00DB $30FF $00DA $0BDB $2BC1 $2BC4 $0BDA $2BC1 $2BBE $30A1 $00DA $0BDA $2BC6 $0000 MOVF XORLW BTFSS GOTO Home_Automation_L_167: MOVLW SUBWF MOVWF Home_Automation_L_170: MOVLW MOVWF MOVF MOVWF MOVF MOVWF MOVF L_main_16: BTFSC GOTO RLF BCF ADDLW GOTO L_main_17: MOVF IORWF Home_Automation_L_171: MOVLW MOVWF MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO DECFSZ GOTO GOTO GOTO MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ GOTO NOP _inporta, 0 1 STATUS, Z Home_Automation_L_168 2 _deviceno, 0 STACK_4 1 STACK_3 STACK_4, 0 STACK_2 STACK_3, 0 STACK_0 STACK_2, 0 STATUS, Z L_main_17 STACK_0, 1 STACK_0, 0 255 L_main_16 STACK_0, 0 PORTC, 1 3 STACK_12 255 STACK_11 255 STACK_10 STACK_12, $+2 $+8 STACK_11, $+2 $+4 STACK_10, $-1 $-5 $-9 140 STACK_11 255 STACK_10 STACK_11, $+2 $+4 STACK_10, $-1 $-5 161 STACK_10 STACK_10, $-1

F F F

F F

GCOEC/INSTRUMENTATION/2012-13

Page 32

HOME AUTOMATION SYSTEM


$03C9 $03CA $03CA $03CA $03CA $03CA $03CB $03CC $03CD $03CE $03CF $03D0 $03D1 $03D2 $03D3 $03D4 $03D5 $03D6 $03D7 $03D8 $03D9 $03DA $03DB $03DC $03DD $03DE $03DF $03DF $03E0 $03E1 $03E1 $03E2 $03E3 $03E4 $03E5 $299F $ $ $ $ $3082 $00DB $30FF $00DA $0BDB $2BD1 $2BD4 $0BDA $2BD1 $2BCE $3087 $00DA $0BDA $2BD6 $0000 $3000 $0625 $1D03 $2BDF $3064 $0624 $ $1903 $2BE5 $ $0AA4 $1903 $0AA5 $2B35 $ GOTO _main_showstatus Home_Automation_L_168: Home_Automation_L_169: Home_Automation_L_149: Home_Automation_L_150: MOVLW MOVWF MOVLW MOVWF DECFSZ GOTO GOTO DECFSZ GOTO GOTO MOVLW MOVWF DECFSZ GOTO NOP MOVLW XORWF BTFSS GOTO MOVLW XORWF L_main_18: BTFSC GOTO Home_Automation_L_145: INCF BTFSC INCF GOTO Home_Automation_L_147: STATUS, Z Home_Automation_L_147 _temppw, 1 STATUS, Z _temppw+1, 1 Home_Automation_L_144 130 STACK_11 255 STACK_10 STACK_11, F $+2 $+4 STACK_10, F $-1 $-5 135 STACK_10 STACK_10, F $-1 0 _temppw+1, 0 STATUS, Z L_main_18 100 _temppw, 0

GCOEC/INSTRUMENTATION/2012-13

Page 33

HOME AUTOMATION SYSTEM

Image of window while Programming Microcontroller with MicroC

LOGIC
The basic logic used that configure the IC MT8870 through making the port D as input. The 4 bit BCD input taken from PinD0, PinD1, PinD3, PinD4. The O/P port is PORTB to drive the relays are port pins PORTB 1 PORTB 5.As depending on input signals we used the IF ELSE conditions to drive the relays 1-5, when signal input is 1. Whereas there is no signal input means no BCD input to microcontroller.

GCOEC/INSTRUMENTATION/2012-13

Page 34

HOME AUTOMATION SYSTEM

10.COMPONENT LIST

Component Name GSM Mobile Phone Transformer[0-15V, 750mA] Microcontroller IC PIC16F676 DTMF Decoder IC Driver IC ULN2003 Regulating IC MC7812 Regulating IC LM7805 Relays [SPDT, 12V] Diode IN4007 Capacitor [1000 F, 25V] Capacitor [100 F,25V] Capacitor [10 F, 50V] Capacitor[0.1 F, 50V] Capacitor[22pF] Crystal Oscillator 11.0592 MHz Crystal Oscillator 3.57MHz Red LED Green LED Resistance 1K Resistance 560 Resistance 330K Resistance 100K Wire main cord Connecting wires bundle Solder wire CCB-18[6*6]

Quantity 1 1 1 1 1 1 1 5 4 1 1 1 6 2 1 1 8 1 9 1 1 2 1 1 50 gram 1 50 gram 1 1 5

Price(Amount) `1000 `190 `150 `38 `35 `20 `18 `126 `8 `25 `20 `15 `30 `4 `15 `15 `16 `2 `4.50 `0.50 `0.50 `1 `25 `30 `75 `40 `35 `100 `120 `30

FeCl3
Soldering Iron Hand Drill 0.8mm bit

GCOEC/INSTRUMENTATION/2012-13

Page 35

HOME AUTOMATION SYSTEM


1mm bit 1 `35 `2223.50

Total

GCOEC/INSTRUMENTATION/2012-13

Page 36

HOME AUTOMATION SYSTEM

11. COMPONENT DESCRIPTION


11.1 RESISTORS: -

A Resistor is a heat-dissipating element and in the electronic circuits it is mostly used for either controlling the current in the circuit or developing a voltage drop across it, which could be utilized for many applications. There are various types of resistors, which can be classified according to a number of factors depending upon: (I) Material used for fabrication (II) Wattage and physical size (III) Intended application (IV) Ambient temperature rating (V) Cost Basically the resistor can be split in to the following four parts from the construction viewpoint. (1) Base (2) Resistance element (3) Terminals (4) Protective means. Resistors may be classified as (1) Fixed (2) Semi variable (3) Variable resistor. (4) In our project carbon resistors are being used. 11.2 CAPACITORS

The fundamental relation for the capacitance between two flat plates separated by a dielectric material is given by:GCOEC/INSTRUMENTATION/2012-13 Page 37

HOME AUTOMATION SYSTEM

C=0.08854KA/D Where: C= capacitance in pf. K= dielectric constant A=Area per plate in square cm. D=Distance between two plates in cm Design of capacitor depends on the proper dielectric material with particular type of application. The dielectric material used for capacitors may be grouped in various classes like Mica, Glass, air, ceramic, paper, Aluminum, electrolyte etc. The value of capacitance never remains constant. It changes with temperature, frequency and aging. 11.3 LED (Light Emitting Diodes)

As its name implies it is a diode, which emits light when forward biased. Charge carrier recombination takes place when electrons from the N-side cross the junction and recombine with the holes on the P side. Electrons are in the higher conduction band on the N side whereas holes are in the lower valence band on the P side. During recombination, some of the energy is given up in the form of heat and light. In the case of semiconductor materials like Gallium arsenide (GaAs), Gallium phoshide (Gap) and Gallium arsenide phoshide (GaAsP) a greater percentage of energy is released during recombination and is given out in the form of light. LED emits no light when junction is reverse biased.

GCOEC/INSTRUMENTATION/2012-13

Page 38

HOME AUTOMATION SYSTEM

11.4 TRANSISTOR: A transistor consists of two junctions formed by sandwiching either ptype or n-type semiconductor between a pair of opposite types. Accordingly, there are two types of transistors namely: (1) n-p-n transistor (2) p-n-p transistor

An n-p-n transistor is composed of two n-type semiconductors separated by a thin section of p type. However a p-n-p transistor is formed by two p sections separated by a thin section of n-type. In each type of transistor the following points may be noted. 1. There are two p-n junctions; therefore a transistor may be regarded as combination of two diodes connected back to back. 2. There are three terminals taken from each type of semiconductor. 3. The middle section is a very thin layer, which is the most important factor in the functioning of a transistor. Transistor can be used as an Amplifier also. A transistor raises the strength of a weak signal and thus acts as an amplifier. The weak signal is applied between emitter base junction and output is taken across the load RC connected in the collector circuit (in common emitter configuration). 11.5 TRANSFORMER

Definition: - The transformer is a static electro-magnetic device that transforms one alternating voltage (current) into another voltage (current). However, power remains the same during the transformation. Transformers play a major role in the transmission and distribution of ac power.
GCOEC/INSTRUMENTATION/2012-13 Page 39

HOME AUTOMATION SYSTEM Principle: - Transformer works on the principle of mutual induction. A transformer consists of laminated magnetic core forming the magnetic frame. Primary and secondary coils are wound upon the two cores of the magnetic frame, linked by the common magnetic flux. When an alternating voltage is applied across the primary coil, a current flows in the primary coil producing magnetic flux in the transformer core. This flux induces voltage in secondary coil. Transformers are classified as: (a) Based on position of the windings with respect to core i.e. (1) Core type transformer (2) Shell type transformer (b) Transformation ratio: (1) Step up transformer (2) Step down transformer (a) Core & shell types: Transformer is simplest electrical machine, which consists of windings on the laminated magnetic core. There are two possibilities of putting up the windings on the core. (1) Winding encircle the core in the case of core type transformer (2) Cores encircle the windings on shell type transformer. (b) Step up and Step down: In this Voltage transformation takes place according to whether the Primary is high voltage coil or a low voltage coil. (1) Lower to higher-> Step up (2) Higher to lower-> Step down

11.6 DIODES

It is a two terminal device consisting of a P-N junction formed either of Ge or Si crystal. The P and N type regions are referred to as anode and cathode respectively. Commercially available diodes usually have some means to indicate which lead is P and which lead is N.

GCOEC/INSTRUMENTATION/2012-13

Page 40

HOME AUTOMATION SYSTEM

11.7 RELAY

In this circuit a 12V sugar cube relay is used. In sugar cube relay, insulated copper wire coil is used to magnetize and attract the plunger .The plunger is normally connected to N/C terminal. A spring is connected to attract the plunger upper side. When output is received by relay, the plunger is attracted and the bulb glows.

GCOEC/INSTRUMENTATION/2012-13

Page 41

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 42

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 43

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 44

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 45

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 46

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 47

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 48

HOME AUTOMATION SYSTEM

GCOEC/INSTRUMENTATION/2012-13

Page 49

HOME AUTOMATION SYSTEM

12 P.C.B. MANUFACTURING PROCESS It is an important process in the fabrication of electronic equipment. The design of PCBs (Printed Circuit Boards) depends on circuit requirements like noise immunity, working frequency and voltage levels etc. High power PCBs requires a special design strategy. The fabrication process to the printed circuit board will determine to a large extent the price and reliability of the equipment. A common target aimed is the fabrication of small series of highly reliable professional quality PCBs with low investment. The target becomes especially important for customer tailored equipments in the area of industrial electronics. The layout of a PCB has to incorporate all the information of the board before one can go on the artwork preparation. This means that a concept which clearly defines all the details of the circuit and partly defines the final equipment, is prerequisite before the actual lay out can start. The detailed circuit diagram is very important for the layout designer but he must also be familiar with the design concept and with the philosophy behind the equipment. PCB BOARD TYPES: The two most popular PCB types are: 1. Single Sided Boards The single sided PCBs are mostly used in entertainment electronics where manufacturing costs have to be kept at a minimum. However in industrial electronics cost factors cannot be neglected and single sided boards should be used wherever a particular circuit can be accommodated on such boards. 2. Double Sided Boards Double-sided PCBs can be made with or without plated through holes. The production of boards with plated through holes is fairly expensive. Therefore plated through hole boards are only chosen where the circuit complexities and density of components does not leave any other choice.

GCOEC/INSTRUMENTATION/2012-13

Page 50

HOME AUTOMATION SYSTEM

13. DESIGN SPECIFICATION


(I) STEPS TAKEN WHILE PREPARING CIRCUIT 13.1 PCB DESIGNING The main purpose of printed circuit is in the routing of electric currents and signal through a thin copper layer that is bounded firmly to an insulating base material sometimes called the substrate. This base is manufactured with integrally bounded layers of thin copper foil which has to be partly etched or removed to arrive at a pre-designed pattern to suit the circuit connections or other applications as required. From the constructors point of view, the main attraction of using PCB is its role as the mechanical support for small components. There is less need for complicated and time consuming metal work of chassis contraception except perhaps in providing the final enclosure. Most straight forward circuit designs can be easily converted in to printed wiring layer the thought required to carry out the inversion cab footed high light an possible error that would otherwise be missed in conventional point to point wiring .The finished project is usually neater and truly a work of art. Actual size PCB layout for the circuit shown is drawn on the copperboard. The board is then immersed in FeCl3 solution for 12 hours. In this process only the exposed copper portion is etched out by the solution. Now the petrol washes out the paint and the copper layout on PCB is rubbed with a smooth sand paper slowly and lightly such that only the oxide layers over the Cu are removed. Now the holes are drilled at the respective places according to component layout as shown in figure. 13.2) LAYOUT DESIGN: When designing the layout one should observe the minimum size (component body length and weight). Before starting to design the layout we need all the required components in hand so that an accurate assessment of space can be made. Other space considerations might also be included from case to case of mounted components over the printed circuit board or to access path of present components. It might be necessary to turn some components around to a different angular position so that terminals are closer to the connections of the
GCOEC/INSTRUMENTATION/2012-13 Page 51

HOME AUTOMATION SYSTEM

components. The scale can be checked by positioning the components on the squared paper. If any connection crosses, then one can reroute to avoid such condition. All common or earth lines should ideally be connected to a common line routed around the perimeter of the layout. This will act as the ground plane. If possible try to route the outer supply line to the ground plane. If possible try to route the other supply lines around the opposite edge of the layout through the center. The first set is tearing the circuit to eliminate the crossover without altering the circuit detail in any way. Plan the layout looking at the topside to this board. First this should be translated inversely; later for the etching pattern large areas are recommended to maintain good copper adhesion. It is important to bear in mind always that copper track width must be according to the recommended minimum dimensions and allowance must be made for increased width where termination holes are needed. From this aspect, it can become little tricky to negotiate the route to connect small transistors. There are basically two ways of copper interconnection patterns underside the board. The first is the removal of only the amount of copper necessary to isolate the junctions of the components to one another. The second is to make the interconnection pattern looking more like conventional point wiring by routing uniform width of copper from component to component.

13.3) ETCHING PROCESS: Etching process requires the use of chemicals. Acid resistant dishes and running water supply. Ferric chloride is mostly used solution but other etching materials such as ammonium per sulphate can be used. Nitric acid can be used but in general it is not used due to poisonous fumes. The pattern prepared is glued to the copper surface of the board using a latex type of adhesive that can be cubed after use. The pattern is laid firmly on the copper using a very sharp knife to cut round the pattern carefully to remove the paper corresponding to the required copper pattern areas. Then apply the resistant solution, which can be a kind of ink solution for the Purpose of maintaining smooth clean outlines as far as possible. While the board is drying, test all the components. Before going to next stage, check the whole pattern and cross check

GCOEC/INSTRUMENTATION/2012-13

Page 52

HOME AUTOMATION SYSTEM

with the circuit diagram. Check for any free metal on the copper. The etching bath should be in a glass or enamel disc. If using crystal of ferricchloride these should be thoroughly dissolved in water to the proportion suggested. There should be 0.5 lt. of water for 125 gm of crystal.To prevent particles of copper hindering further etching, agitate the solutions carefully by gently twisting or rocking the tray. The board should not be left in the bath a moment longer than is needed to remove just the right amount of copper. Inspite of there being a resistive coating there is no protection against etching away through exposed copper edges. This leads to over etching. Have running water ready so that etched board can be removed properly and rinsed. This will halt etching immediately. Drilling is one of those operations that call for great care. For most purposes a 0.5mm drill is used. Drill all holes with this size first those that need to be larger can be easily drilled again with the appropriate larger size.

13.4) COMPONENT ASSEMBLY: From the greatest variety of electronic components available, which runs into thousands of different types it, is often a perplexing task to know which is right for a given job. There could be damage such as hairline crack on PCB. If there are, then they can be repaired by soldering a short link of bare copper wire over the affected part. The most popular method of holding all the items is to bring the wires far apart after they have been inserted in the appropriate holes. This will hold the component in position ready for soldering. Some components will be considerably larger .So it is best to start mounting the smallest first and progressing through to the largest. Before starting, be certain that no further drilling is likely to be necessary because access may be impossible later. Next will probably be the resistor, small signal diodes or other similar size components. Some capacitors are also very small but it would be best to fit these afterwards. When fitting each group of components mark off
GCOEC/INSTRUMENTATION/2012-13 Page 53

HOME AUTOMATION SYSTEM

each one on the circuit as it is fitted so that if we have to leave the job we know where to recommence. Although transistors and integrated circuits are small items there are good reasons for leaving the soldering of these until the last step. The main point is that these components are very sensitive to heat and if subjected to prolonged application of the soldering iron, they could be internally damaged. All the components before mounting are rubbed with sand paper so that oxide layer is removed from the tips. Now they are mounted according to the component layout. 13.5) SOLDERING: This is the operation of joining the components with PCB after this operation the circuit will be ready to use to avoid any damage or fault during this operation following care must be taken. 1. A longer duration contact between soldering iron bit & components lead can exceed the temperature rating of device & cause partial or total damage of the device. Hence before soldering we must carefully read the maximum soldering temperature & soldering time for device. 2. The wattage of soldering iron should be selected as minimum as permissible for that soldering place. 3. To protect the devices by leakage current of iron its bit should be earthed properly. 4. We should select the soldering wire with proper ratio of Pb & Tn to provide the suitable melting temperature. 5. Proper amount of good quality flux must be applied on the soldering point to avoid dry soldering.

GCOEC/INSTRUMENTATION/2012-13

Page 54

HOME AUTOMATION SYSTEM

14. WORKING HOW TO USE? We have to maintain the uninterrupted power supply to the receiver unit. The mobile phone is connected with the control unit via DTMF decoder IC by means of Headphone of mobile phone. The battery of mobile phone should regularly charge and mobile phone withcontrol unit is kept at the pace where the receiver gets perfect signal strength.The appliances connected are also kept connected with power supply. WORKING: The user dials the mobile number of the receiver unit cell phone by his mobile phone. Once the connection is established by the GSM service provider the call is automatically attended by receiving unit cell phone because of auto answering mode. When the call connected user presses the key from 1-7 one by one & send control to the receiving unit. The receiving unit cell phone is connected with DTMF decoder MT8870 hence received DTMF signals are decoded & converted into 4 bit o/p. The 4bit converted O/P sent to microcontroller IC where it drives appropriate relay & hence connected appliance. The appliances connected are being ON/OFF by pressing same keys. We could ON/OFF all appliances at once by pressing key 1 & 0.

GCOEC/INSTRUMENTATION/2012-13

Page 55

HOME AUTOMATION SYSTEM

15. FLOWCHART

GCOEC/INSTRUMENTATION/2012-13

Page 56

HOME AUTOMATION SYSTEM

16. APPLICATIONS
Our project is very useful in controlling home appliances. Some other applications are listed below1. As a complementary option of Industrial Automation. 2. For security & other equipment control. 3. Military & Intelligence operations for switching equipments at distance. Advantages: 1. No need to go on field. 2. Higher reliability. 3. Cost effective. 4. Fast efficient. 5. Five devices can be controlled by single key command .

FURTHER DEVELOPEMENT The device can be used in very advance manner. It can develop the device as data saving facility, remote applications & user authentication and with smart biometric access services.

GCOEC/INSTRUMENTATION/2012-13

Page 57

HOME AUTOMATION SYSTEM

17. CHRONOLOGY
The following steps have been followed in carrying out the project. 1. Study the books on the relevant topic. 2. Understand the working of the circuit. 3. Prepare the circuit diagram. 4. Prepare the list of components along with their specification. Estimate the cost and procure them after carrying out market survey. 5. Plan and prepare PCB for mounting all the components. 6. Fix the components on the PCB and solder them. 7. Test the circuit for the desired performance. 8. Trace and rectify faults if any. 9. Give good finish to the unit. 10. Prepare the project report.

GCOEC/INSTRUMENTATION/2012-13

Page 58

HOME AUTOMATION SYSTEM

18. BIBILIOGRAPHY REFERENCE FOR FOLLOWING BOOKS: TECHNICAL INFORMATION FROM

1. DTMF Based Remote Control System - R. Sharma, K. Kumar, and S. Viq, IEEE International Conference ICIT, pp. 2380-2383,December 2006. 2. A phone based Remote Controller for Home- I. Coskun and H.Ardam IEEE Trans.Consumer , vol.44,no. 4,pp. 1291-1297,November 1998 3. Electronics For You 4. Integrated Electronics by Millman & Hawlkiwas. 5. Basic Electronics by J. B. Gupta 6. High Performance Printed Circuit Board Charles Harper 7. Industrial automation Magazine REFERENCE FOR ARTICLES & TECHNICAL INFORMATION ON REMOTE ACCESS TERMINAL FROM FOLLOWING SITES: http://www.google.co.in (Google search engine) http://www.whereisdoc.com http://www.electronicsforu.com http://electrosofts.com/dtmf http://www.electronicprojects.com www.atmel.com/dyn/resources/prod_documents/doc2543.pdf www.datasheetcatalog.net/

GCOEC/INSTRUMENTATION/2012-13

Page 59

You might also like