Your SlideShare is downloading. ×
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Mobile phone based domestic electrical equipment controller
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Mobile phone based domestic electrical equipment controller

9,697

Published on

Done by Amila Srimaal Gamage

Done by Amila Srimaal Gamage

Published in: Technology, Business
6 Comments
24 Likes
Statistics
Notes
No Downloads
Views
Total Views
9,697
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
6
Likes
24
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. i Acknowledgement “Engineering does not merely knowing and being knowledgeable, like a walking encyclopedia; engineering in not merely analysis; engineering is not merely the possession of the capacity to get elegant solutions to non-existent engineering problems; engineering is practicing the art of the organizing forcing the technological change. Engineers operate at the interface between science and society. “ - Dean Gordon Brown – In doing this design and project I got much kind of helps from many people. Without the help of them this project could be interrupted or couldn‟t achieve expected project goals. Among them, my special thanks must be awarded to Project Supervisors Dr. Asanka Rodrigo and Dr. Udayanga Hemapala for their great contribution and guidance in continuing the project and keeping the project quality. I must be thankful to my friends who helped me in various ways in doing design associated works and PCB printing. International College of Business and Technology Staff also gave me a great support and informed us about project writing techniques and News from Sunderland University. Finally, I must especially be thankful and pay my gratitude to my Parents for their priceless support and valuable advices. They helped me in various ways as motivating me, encouraging me and supplying all the requirements for the projects.
  • 2. ii Abstract This report consists of designing and implementing a domestic electrical equipment controller using mobile phone. Project introduction, background, problem identification and objectives are described in first chapter. The second chapter is about literature reviews of similar projects and project management concepts. At literature reviews of similar projects, those considered projects have been compared with each other under technologies, components, accuracy, cost and reliability factors. Project Management literature review, it‟s examined about main factors to be considered at a design a project scope and objectives. In third chapter is Industrial context. It‟s explained about similar projects in the market by today, specifications of those items and how this project design could overcome those project errors and how this project can be introduce to the market as a solution. Chapter 04 Methodology section describes optimum designs, premium design, design flow charts, block diagrams, component specifications and design and implementation operation of the design with schematic diagrams. Analysis parts have been inserted in Chapter 05. Software simulations, real testing, problem encountered and solutions are described and inserted in this section. Chapter 06 is Conclusion chapter and briefly described how design objectives are accomplished. Further works, modifications, suggestion are discussed under Chapter 07.
  • 3. iii Index CHAPTER 01............................................................................................................................. 1 INTRODUCTION...................................................................................................................... 1 1.1Background........................................................................................................................ 1 1.2 Problem Identification ...................................................................................................... 2 1.3 Objective........................................................................................................................... 2 1.4 Aim ................................................................................................................................... 2 CHAPTER 02............................................................................................................................. 3 LITERATURE REVIEW........................................................................................................... 3 2.1 Literature review for similar projects ............................................................................... 3 2.2 Literature Survey for Selecting Project according to Project Management ..................... 5 2.3 Design Overview .............................................................................................................. 7 CHAPTER 03............................................................................................................................. 9 INDUSTRIAL CONTEXT ........................................................................................................ 9 CHAPTER 04........................................................................................................................... 10 METHODOLOGY................................................................................................................... 10 4.1Conceptual Designs ......................................................................................................... 10 4.1.1 RF Based Domestic Electrical appliance controller ................................................ 10 4.1.2 Java-based automation system project monitor and control home appliances ........ 11 4.1.3 Home appliance control system project is based on GSM....................................... 11
  • 4. iv 4.1.4 PC based remote Controller using a mobile phone.................................................. 12 4.2 Optimum Design......................................................................................................... 13 4.3 Design and Implementation............................................................................................ 16 4.3.1 Electromagnetic Relay............................................................................................. 17 4.3.2 DTMF Decoder........................................................................................................ 18 4.3.3 Seven Segment Display Unit ................................................................................... 20 4.3.4 Microcontroller /Processor Unit .............................................................................. 21 4.3.5 Relay Driver............................................................................................................. 22 4.3.6 Opto-Isolator (Optocoupler) .................................................................................... 23 4.3.7 Power Supply........................................................................................................... 24 4.3.8 Shunt Resistor .......................................................................................................... 24 4.3.9 Voltage Regulator .................................................................................................... 24 4.3.10 Crystal Oscillator ................................................................................................... 25 4.3.11 Software Design..................................................................................................... 25 4.4 Main Circuit.................................................................................................................... 28 4.5 Feedback Circuit............................................................................................................. 32 CHAPTER 05........................................................................................................................... 37 ANALYSIS .............................................................................................................................. 37 5.1 Microcontroller Program ................................................................................................ 37 5.2 Electrical devices Load calculation ................................................................................ 43 5.3 Problems encountered and solutions .............................................................................. 44 5.4 Testing ............................................................................................................................ 45 5.4.1 Software Simulations............................................................................................... 45
  • 5. v 5.4.2 Real world Tasting................................................................................................... 46 CHAPTER 06........................................................................................................................... 48 CONCLUSION ........................................................................................................................ 48 CHAPTER 07........................................................................................................................... 50 SUGGESSTIONS AND FURTHER WORKS........................................................................ 50 References .................................................................................................................................. x Appendix I...............................................................................................................................xiii Proteus 8.0 Simulations.......................................................................................................xiii Appendix II......................................................................................................................... xxv PCB Design of Main Circuit .............................................................................................. xxv PCB Design of Feedback circuit ....................................................................................... xxvi Appendix III ......................................................................................................................... xxvii Lab Tests........................................................................................................................... xxvii Appendix IV.......................................................................................................................... xxxi MikroC PIC Program......................................................................................................... xxxi
  • 6. vi List of Figures Block Diagram 1: Design block diagram of RF Based Domestic Electrical appliance controller .................................................................................................................................. 10 Block Diagram 2: Design block diagram of Java-based automation system project monitor and control home appliances.................................................................................................... 11 Block Diagram 3: Design block diagram of Home appliance control system project is based on GSM. ................................................................................................................................... 11 Block Diagram 4: Design block diagram for PC based remote controller using mobile phone. .................................................................................................................................................. 12 Block Diagram 5: Design flow chart........................................................................................ 14 Block Diagram 6: Optimum design block diagram ................................................................. 15 Fig.4. 1: Apparatus map for the optimum design..................................................................... 16 Fig.4. 2: Schematic diagram of four types of electromagnetic relays...................................... 17 Fig.4. 3: Diagram of DTMF Keypad with relevant frequencies (Noor M, 2005).................... 18 Fig.4. 4: 18 pin, 20 pin SOIC models pin configuration. (Zarlink semiconductor, 2005)....... 19 Fig.4. 5: Function block diagram of MT8870D-1(Zarlink semiconductor , 2005).................. 20 Fig.4. 6: Pin Diagram of PIC16F877A at Proteus 8.0.............................................................. 21 Fig.4. 7: Internal pin connection of ULN2003A (STMicroelectronics, 2002)......................... 22 Fig.4. 8: Pin Configuration of PC817 ...................................................................................... 23 Fig.4. 9: Schematic Design at Proteus 8.0................................................................................ 27 Fig.4. 10: NPN Transistor based relay driving circuit. ............................................................ 28 Fig.4. 11: LM7805 schematic simulation on Proteus............................................................... 29 Fig.4. 12: RC filter configuration at EST pin (Zarlink semiconductor, 2005)......................... 30 Fig.4. 13: Differential Input amplifier (Zarlink semiconductor, 2005).................................... 30
  • 7. vii Fig.4. 14: Crystal oscillator configuration ............................................................................... 31 Fig.4. 15: Feedback unit schematic design (one device).......................................................... 32 Fig.4. 16: Pin assigning of optocoupler with feedback circuit................................................. 33 Fig.4. 17: When M. Controller output is “level 0” feedback signal is at level 1. .................... 34 Fig.4. 18: When M. Controller output at “Logic 1”, feedback input at “Logic 0”................... 34 Fig.4. 19: Named feedback Circuit part for one device ........................................................... 35 Fig.4. 20: Switching modes and operation of two way switch system .................................... 36 Fig.5. 1: Sound function declaration on MikroC ..................................................................... 37 Fig.5. 2: Ports and pin configuration on MikroC ..................................................................... 38 Fig.5. 3: ADCON1 register bit configuration (Microchip technology Inc., 2001) .................. 39 Fig.5. 4: AD port bit configuration of ADCON1. (Microchip technology Inc., 2001)............ 39 Fig.5. 5: Key 1 function configuration on MikroC .................................................................. 40 Fig.5. 6: Key 4 function configuration..................................................................................... 40 Fig.5. 7:“One beep is played only if, both ON key pressed and device is OFF” on MikroC. . 41 Fig.5. 8: “Two beeps re played only if both OFF key pressed and device is ON” on MikroC 41 Fig.5. 9: Program flowchart ..................................................................................................... 42 Fig.5. 10: Electro optical characteristics of PC817 Optocoupler (Sharp Electrionic, 2003) ... 43 Fig.5. 11: Key”1” is pressed and Device 01 is at ON state...................................................... 45 Fig.5. 12: Key “4” is pressed and Device 1 at OFF state......................................................... 45 Fig.5. 13: Key 1 pressed and Electrical device is switch ON .................................................. 46 Fig.5. 14: Key 4 is pressed and electrical device is OFF ......................................................... 46
  • 8. viii Appendix Fig. 1: Key”1” is pressed and Device 01 is at ON state........................................xiii Appendix Fig. 2: Key “2” is pressed and Device 2 at ON state.............................................. xiv Appendix Fig. 3: Key “3” is pressed and Device 3 at ON state............................................... xv Appendix Fig. 4: Key “4” is pressed and Device 1 at OFF state. ........................................... xvi Appendix Fig. 5: Key “5” is pressed and Device 2 at OFF state. .......................................... xvii Appendix Fig. 6: Key “6” is pressed and Device 3 at OFF state. .........................................xviii Appendix Fig. 7: Key “7” is pressed and Device 4 at ON state.............................................. xix Appendix Fig. 8: Key “8” is pressed and Device 5 at ON state............................................... xx Appendix Fig. 9: Key “9” is pressed and Device 6 at ON state.............................................. xxi Appendix Fig. 10: Key “0” is pressed and Device 5 at OFF state. ........................................ xxii Appendix Fig. 11: Key “*” is pressed and Device 4 at OFF state ........................................xxiii Appendix Fig. 12: Key “#” is pressed and Device 6 at OFF state. ....................................... xxiv Appendix Fig. 13: PCB design of the main circuit ................................................................ xxv Appendix Fig. 14: Design at the start (no key is pressed).................................................... xxvii Appendix Fig. 15: Key 1 is pressed and Light bulb is at ON state. ....................................xxviii Appendix Fig. 16: Key 4 is pressed and light bulb at OFF state........................................... xxix
  • 9. ix Nomenclature AC : Alternating Current. ADC : Analogue to Digital Conversion. BCD : Binary Coded Decimal. CMOS: Complementary Metal Oxide Semiconductor. CT : Current Transformer. DC : Direct Current. DTMF: Dual Tone Multi Frequency. EMF : Electromotive Force. GPRS : General Packet Radio Service. GSM : Global System for Mobile Communication. IC : Integrated Circuit. I.P : Internet Protocol. ITU : International Telecom Union. LED : Light Emitting Diode. LSB : Least Significant Bit. MSB : Most Significant Bit. PC : Personal Computer. PCB : Printed Circuit Board. SMS : Short Message System. SPDT: Single Pole Dual Throw. TTL : Transistor transistor logic
  • 10. 1 CHAPTER 01 INTRODUCTION 1.1Background With the development of technology, Electronic technology is being ameliorated rapidly. Because of that usage of electronic or electrical devices is higher by today compared to past. Electronic devices are applied in all kind of household operations. Operate some of those domestic electrical appliances such as electrical lights, other frequently used devices such as electrical kettle, iron, etc. are operated daily and those appliances or devices consume considerable electrical power. Unusual, inappropriate or over usage of those electrical devices mainly influences on power wasting and user has to pay a lot. In other hand, electrical power waste result for world power crisis. Even the renewable energy concept is carrying out; majority of electrical power is generated by coal, natural gases, petroleum, which tends to lead to inefficiency. Because of that, power is one of most concerned topic in the world due to the global power crisis and World looking for solutions in reducing unusual power usage and introducing new power sources. Maintain electrical devices can save lot of energy and reduce the power. In real life people have to use the own switch in the home or domestic to control relevant electrical devices. If user is not at home, it‟s unable to control the electrical devices. If those operations can be done by in remote way, that can take a solution for many troubles. Remote maintaining and acknowledging is one of most important criteria in enhancing system efficiency while, developing user‟s capabilities. Wireless technology is become as the basic behind remote controlling. With the innovation of Home Automation, home appliances or some tasks such as lightning, heating, and air conditioning are controlled according to programmed way or other
  • 11. 2 linked appliances. In that manner, combining Wireless technology with Home automation technology may increase the electrical system maintaining efficiency, security and safety standards. 1.2 Problem Identification  Have to be at home to operate electrical appliances/equipment which is usually operated daily or frequently.  Different able or elder people are unable or it‟s hard to them to move in home to operate electrical devices.  Power waste occurs due to bad maintain of electrical devices. 1.3 Objective The objective of this project is to manage/operate a Home automation system which, as switch on and switch off, consist incandescent light bulbs, an electric kettle or safety considering apparatus (likewise) using a mobile and receiving feedback message for operation (voice Message System). This system allows user to maintain the relevant electrical device in either manual way or remote way. Feedbacks depend on situation of operated device electrical line state and send real world feedback to the operator. 1.4 Aim The aim of the Domestic electrical equipment controller is to control most considerable or frequently used electrical apparatus from one place and from anywhere through mobile phone. As the scope, it can control (switch on or off) domestic electrical apparatus from anywhere, where GSM technology is available and obtain a feedback message to aware about operation status. Electrical equipment is connected with controller in wireless way. The project basically based on three themes as Low cost, Easy usage and unique requirement.
  • 12. 3 CHAPTER 02 LITERATURE REVIEW 2.1 Literature review for similar projects According to Malik Sikandar. Hayat Khiyal et al (2009), Home appliance control system project is based on Global system for Mobile communication (GSM) technology and used for transmission of SMS to the receiver as the operating command. SMS sending and receiving is used for have access to electrical appliances and allowing disconnect control at home. It is proposed two sub-systems to be included in this system as appliance control sub system and security alert sub system. Appliance control subsystem enables the user to control home appliances remotely whereas the security alert subsystem provides the remote security monitoring. Sending and receiving SMS to and from the system is done by a GSM Modem. Serial communication is done with the system via RS232 serial in communicating with the system. According to Teter D. (2011) Radio frequencies are used as the signal transmitting medium. It can control up to four electrical appliances. 433MHz radio frequency transmitter and receiver (RF module) named, STT 433 which, is operated in 1.5 to 12V supply and used in connecting remote controller and electrical appliances. This module is ideal for remote control applications where the low cost and long range required. It‟s Designed as four switched connected to RF encoder and to transmit over RF signals and decode at the receiving end. As the devices, up to 7A devices can be driven. The transmitter consists of saw-stabilized oscillator, ensuring accurate frequency control for best range performances. Decoded signals by RF decoder supply to transistor drivers. Relays are driven by these drivers. In this project it‟s used 5V voltage, 750mA of current power supply. A voltage regulator called LM7805 is
  • 13. 4 applied in regulating voltage. Its utilized full wave bridge rectifier and 230/18V step down transformer to be operated the entire project by domestic 230V ac supply. According to Al Ali (2004), Java-based automation system project monitor and control home appliances via web page (http protocol). The entire project consists of embedded circuit and computer based server. Home appliances which, need to be controlled are connected via input and output ports of the embedded circuit and status are passed to the PC server. Basically, the monitoring and control software part is based on the combination of JavaBeans, Java Server pages and interactive C. it‟s able to control relevant electrical appliances remotely through web browser from anywhere, where is available internet access or locally. Password protection can be applied also to be avoided from unauthorized users‟ access. According to Fadhil T. Aula (2005), project responsible for, PC based remote Controller using a mobile phone through accessing the serial and parallel PC ports as Serial port for transferring data from mobile phone to PC and parallel port for interfacing PC with electrical apparatus. The system is operated by SMS. As the remote switching device, it is used another mobile phone. According to project scopes, “The common controlled appliances are; PC Shutdown, TV on/off, Light on/off in this project”. Microsoft Visual C++ version 6 has been used as the C++ programming software. PC is worked as the main Hub and all the real time controlling devices.
  • 14. 5 According to Potamitis, Georgila et al (2003), “An Integrated System for smart home control of appliances based on remote speech interaction” project it‟s used “speech as a natural input modality to provide user-friendly access to information and entertainment devices installed in a real home environment”. Beam forming technique and voice recognition are the main techniques involved with the system designing. Speaker and home appliances are linked through a PC. Speech operated system is installed in the PC and control home appliances can be done through a mike of telephone. DOA and TDOA estimations are done to avoid the functions from surround noises. The system integrated a linear microphone array to supply spatial sound selectivity, adaptive noise cancellation to deal with appliances that emit noise with the same statistical behavior as the desired speech signal, a word spotter that provides a robust gate to the far-end speaker recognition system, a speaker recognition module that allows interaction of only registered users and finally a speech recognition system. 2.2 Literature Survey for Selecting Project according to Project Management According to Rory Burke (1999), many factors to be concern in choosing project, project estimating, project planning and so on. Selecting the right project achieve many benefits while wrong selections bring bad results even project scope is less. Basically, selection of a project should be done under five headings.  Production.  Marketing.  Financial.  Personal.  Administration.
  • 15. 6 Especially, first four heading considerations must be followed at individual project because project is done /demonstrated by owner of that . Under Production heading there are some considerations to be done in choosing a project. Method of implementing, time to be up and running, time until product is saleable, interfacing equipment requirements, safety of the system, other applications of the project are some of considerations to be done. Numbers of potential users, market share, impact on current system, customer acceptance, estimated life of new innovation, ability to control quality of information are marketing considerations in choosing a project. Financial considerations are also valuable in choosing a project to be implemented. Cost of new system, level of financial risk, cost of mistakes, and cost of implementation are some considerations of that. Choosing a project is also must be done with personal considerations. Especially an individual project totally depends on one person. Skills requirements and availability, impact on working conditions, results on internal communication, skill enhancements from the project, and impact on morale are some of main considerations and expectations by a project.
  • 16. 7 2.3 Design Overview By consider above designs, projects and project Management requirements, choose below technologies/methods and apparatus as relevant part or unit. As the signal transceiver technology, it is selected GSM technology over Radio frequency and PC server based high level language technologies such as C#.net, JavaScript, PHP. In selecting Radio Frequency, there can be utilized two RF modules with two processing units for each transmitting and receiving when needs a feedback. It‟s possible that, RF transmitter range lies within less than kilo meter range in domestically. In PC based systems, there must be a PC or Laptop as a connecting node of apparatus. Although Under GSM technology it‟s possible to operate system under wide range with higher reliability and accuracy. As commanding technology, selected voice calls as the operating signal over SMS or GPRS due to fast handling and easy controlling in sending voice message. It‟s required higher data rate in GPRS controlling. Sending SMS takes higher time compared to voice message and errors can be occurred due to misplacement of one letter of the command message. As signal inputting part, it is designed to DTMF technology in voice call operating (giving commands for the operation) over real voice commands due to higher accuracy of DTMF technology and easy commanding ability and transmitter also consists a DTMF keypad as the dial pad and hence there is no need of interfacing external keypad or control pad to the system. As system feedback technology, it is designed the System with a feedback part to the user in ensuring the system security and accuracy and in getting feedback; it‟s designed to get it tone feedback instead of SMS. SMS cannot be read by some users because of low visibility or perhaps user might not much informed/aware about relevant programmed message. It‟s
  • 17. 8 expected to generate number of number beeps according to relevant node activated or deactivated. In other hand, to have SMS feedback, there should be a GSM module instead of mobile phone and this is not easy or practically to be achieved by every user. As the system processing unit, designed to utilize Microchip® PIC microcontroller due to easy programming instructions, low cost, plenteous types available in market. Usually there are many free PIC microcontroller source code compilers, debuggers can be easy found for PIC microcontroller programming. ICs are also can be used as processing unit although it may create drawbacks such as takes much space, design get complex and low accuracy. As the Switching method, electromagnetic relays are used as switches in switching the microcontroller outputs with Domestic electrical system over TRIACs. TRIACs are solid state and consume much power compared to electromechanical relays. Relays can tolerated variations of the system and bring more safety as no leakage when open because of insulated two terminals each other. If it‟s necessary, relays can work with DC also while TRIACs don‟t sensitive for DC As Feedback Detection method, it‟s designed to use opto-isolators (optocouplers or photocouplers) in the system and shunt resistors over Current Transformers (CT), current sensors and potential detectors (resistor based voltage/current). Current transformer usage is expensive and more additional components should be utilized.
  • 18. 9 CHAPTER 03 INDUSTRIAL CONTEXT Residential Electrical device control managing or “Home automation” concept is being introduced and improved by now in the Technical world. Operate electrical devices in remote way can be introduced as a further development of that concept. Remote controlling provides many advantages for disable or elder people and power saving. There are different types of electrical device remote controllers in the industry with different technologies such as web pages, Bluetooth, radio signals and GSM. Radio signal method is being used in the industry and low operating range is identified as a drawback. Web page systems and Bluetooth systems are expensive systems available in the Market. According to project Management theories, high reliable, securable, low cost, majority required, Easy maintenance, easy operating Product is considered as most suitable product to the industry. “GSM technology is considered as the mainly used telecommunication technology and widest coverage technology with 6.8 billion mobile subscriptions by the end of 2012. This is approximately 96 percent of 7.1 billion world population” as mentioned in ITU statics document (2013). Apply GSM technology as the remote controlling technology; product can be introduced for Majority of people. Users are allowed to operate electrical devices in their homes by their own mobile phone and operation could be done at anywhere of the World. Transmitter and keypad is free and receiver is low cost makes the project is low cost one and even poor people are allowed to use this product. Feedback system aware the user about current operating state of currently operated electrical device and higher security can be achieved by that compared to other products available in the market.
  • 19. 10 CHAPTER 04 METHODOLOGY 4.1Conceptual Designs 4.1.1 RF Based Domestic Electrical appliance controller Block Diagram 1: Design block diagram of RF Based Domestic Electrical appliance controller  Problems identified o Complex design. o Low accuracy. o Low operating range. o No feedback signal available. In this design, it need more space in setting and operating range is limited for number of meters. Interfacing of radio frequencies limits the number of devices can be controlled and system errors can be occurred also. It‟s hard to find out and operate radio modules compared to mobile phone while, radio module needs advance addressing methods. There‟s no any feedback acknowledging system for the user to aware about operation.
  • 20. 11 4.1.2 Java-based automation system project monitor and control home appliances Block Diagram 2: Design block diagram of Java-based automation system project monitor and control home appliances  Problems identified: o Another PC or Smart phone is required. o Higher cost needed. o Internet facility is needed for the operation. In this design, it‟s needs to place a PC in the house or near area to be interfaced with electrical appliances. PC must be connected with operator through a web page (I.P addressing) and Phone with internet facility or Computer is needed for the operator. 4.1.3 Home appliance control system project is based on GSM Block Diagram 3: Design block diagram of Home appliance control system project is based on GSM.
  • 21. 12  Problem identified: o Higher cost needed. o Design get complex. o Occurring problems in giving commands. o Low speed of operating. In Sensing SMS command it need to high cost GSM module (SIMCON 300) and advance program part. Giving SMS commands bring problems in the system due to wrong commands. It take higher time compared with voice calls to give commands and operating speed is decreased (number of apparatus can be controlled in given time period). 4.1.4 PC based remote Controller using a mobile phone Block Diagram 4: Design block diagram for PC based remote controller using mobile phone.  Problem Identified: o More equipment needed for the design. o No feedback signal to the operator. o Higher cost. This Project needs two mobiles and one PC and design cost is higher. Due to connect mobile and circuit serial and parallel ports must be configured and project get complex (RS232 communication). There‟s no feedback signal to the operator and because of that security level of the project is reduced.
  • 22. 13 4.2 Optimum Design As the optimum design, it‟s designed a cell phone based domestic electrical equipment controller by keypad commands (DTMF based tones) and gives a tone feedback to the user. DTMF technology is used as the command input technology while, PIC microcontroller is placed as the system processing unit. It‟s expectable to design the system to control six apparatuses and can be extendable up to twelve apparatuses if necessary. Design is based on Higher Security, low cost and easy handling themes basically. In controlling A/C devices, Electromagnetic relays are used through relay driver. In synchronizing input data system with system processing system a DTMF decoder is utilized. The designed system is basically driven by domestic AC voltage supply (230V single phase in Sri Lanka) and because of that step down transformer and full wave rectifier is utilized. System feedback comes to the user according to state of the device (on /off) as tones (beeps) with relevant consecutive times. System electrical appliances can be controlled either manual way or remote way. Key operations for electrical devices controlling is done as follows. Key 1: Device 01 ON. Key 4: Device 01 OFF. Key 2: Device 02 ON. Key 5: Device 02 OFF. Key 3: Device 03 ON. Key 6: Device 03 OFF. Key 7: Device 04 ON. Key *: Device 04 OFF. Key 8: Device 05 ON. Key 0: Device 05 OFF. Key 9: Device 06 ON. Key #: Device 06 OFF.
  • 23. 14 Block Diagram 5: Design flow chart
  • 24. 15 Design is based on mobile communication and hence a transmitter and a receiver are utilized. Two mobile phones are used as transmitter and receiver. Electromagnetic relays are used as switching device and relays are driven through a relay driver. Two-way switch is connected with the relay and relevant appliance connected with the two-way switch. Opt couplers and shunt resistors are placed to detect current state of the electrical device and send a feedback signal to the operator. Block Diagram 6: Optimum design block diagram
  • 25. 16 4.3 Design and Implementation Fig.4. 1: Apparatus map for the optimum design System is designed for two circuits as main unit and feedback unit. Main unit consist of processing unit, receiving unit, decoding unit and switching unit. Command of the user is received to DTMF decoder. Decoder decodes the input signal and 4 bit output sends to the microcontroller. According to key pressed, Microcontroller switch on port and hence electromagnetic relay is driven through relay driver. According to relay operation electrical apparatus is operated. Device electrical line is connected though a shunt resistor. According to electrical line states (current flow or not), voltage is out. That voltage is rectified by a bridge rectifier and
  • 26. 17 smoothed by capacitor. That output is connected with Infrared LED of optocoupler. Illuminate the LED allowed to photo transistor to be driven and work as closed switch. That transistor output is connected though pull up resistor with microcontroller input in main unit by interfacing the two circuits. Because of Pull Up configuration of that resistor, if there‟s no current flow in device electrical line, relevant microcontroller input at logic level 1. After switch on a device user get tone feedback of one beep. Switch on another time that device (when device is at ON state) inform user by one beep another time. If device is at OFF state (Manually OFF or error of device) user doesn‟t allowed switch OFF that device remotely and no tone feedback comes to user. If the device at ON state, the user gets two beeps tone feedback when switch OFF that device remotely. Feedback depends on the external electrical line and feedback accuracy is higher. Design Components are described below 4.3.1 Electromagnetic Relay In this project, it‟s designed to use attracted armature type relay which, is the most common relay type used in domestic applications because can be used as either a magnetic relay or ratio relay. There are two types of attracted armature type as plunger type and hinged armature type. SPDT relay consist two poles and due to manual operations, its chosen 12V SPDT relays. Fig.4. 2: Schematic diagram of four types of electromagnetic relays. Single pole single throw Single pole dual throw Dual pole single throw Dual pole dual throw
  • 27. 18 In designing the circuit, circuit was designed into two parts as work only with circuit and work with both circuit and manually. 12V SPDT relays are placed in the circuit and it can connect with two-way manual switch (AB switch), usually used in domestic and industrial applications. SPDT relay involve in automatic switching and SPDT relay with two-way switch able to control both manual and remote operations. 4.3.2 DTMF Decoder As mentioned in Zarlink semiconductor (2005), DTMF represent “Dual Tone Multi Frequency” which is encoding/decoding technology, used in Telecommunication. The main term of DTMF is “Touch Tone” under AT & T trademark. Mobile Phones, Telephones use DTMF pad as the keypad. When any key is pressed, it creates two frequencies (tones) regarding to that key as row (high frequency) and column (low frequency) tone. Each and every key of keypad has specific frequency combination. As an example, when a mobile user dials any number, service provider identifies that number to be dialed by DTMF technology. Even in Customer care services DTMF technology utilized to identify pressed key by user. Fig.4. 3: Diagram of DTMF Keypad with relevant frequencies (Noor M, 2005)
  • 28. 19 As an example, if key “5” is pressed, it generates 770Hz and 1336Hz frequencies. Because of that telephone operator can determine that, key “5” was pressed. Usually, DTMF keypad consists of totally 16 keys although telephone keypad consists of 12 keypads. Rest four keys used by telephone operators in preventing standard telephone codes from being used to control remote devices. DTMF Decoder in this project responsible for decode tones, generated at user‟s keypad into 4 bit signal and synchronize Microcontroller with voice input. In this project it‟s used an Integrated DTMF receiver named MT8870D-1. Fig.4. 4: 18 pin, 20 pin SOIC models pin configuration. (Zarlink semiconductor, 2005) DTMF receiver consists of two sixth order capacitor band pass filters, four comparators and digital decoder basically. There is a block diagram of MT8870D-1 IC function. I this project, 18 pin IC is used. 20 pin SOIC model18 pin SOIC model
  • 29. 20 Fig.4. 5: Function block diagram of MT8870D-1(Zarlink semiconductor , 2005) IN+ and IN- are the inputs for the DTMF receiver which, directly connected with receiver mobile phone headset. In the decoding unit, filters are used to avoid the system operation from unusual to non-identical frequencies. Dial tone frequencies are also eliminated during identify the frequencies. This is a digital counting technique and only standard DTMF frequencies allowed to be decoded. When two identical frequencies are detected, receiver checks for valid signal duration. 4.3.3 Seven Segment Display Unit According to Shella Nugraheni (2012), a seven segment display is placed in this circuit and it indicates latest command given by the user. This is important in testing whether devices connected to relevant pins (commands assign). In domestic, this display can be used to aware user about command he/she has given (daily routing operations). Common cathode type Red seven segment display and 74LS48 BCD to seven segment decoder is utilized in the project. Outputs from DTMF decoder use as the inputs to seven segment decoder and its seven outputs are connected to the display.
  • 30. 21 Motorola Inc. (2000) mentioned that, 74LS48 IC consists of NAND gates, input buffers and seven AND-OR-NOT gates. IC consist 16 pins and three of them used for special functions. RBI and RB0 pins used for automatic leading or trailing edge zero-blanking control. When BI or RBO pin get high, Lamp Test (LT) is activated. BI pin is used to control the lamp intensity by varying the frequency and duty cycle of the BI input signal. A, B, C and D are four inputs and represent 20 , 21 , 22 and 23 . Display consists of seven blocks and each output represents one block of the display. 4.3.4 Microcontroller /Processor Unit As the Processing unit of the project, it‟s used a microcontroller. Compared to other analog systems like comparators or Operational amplifiers, microcontroller provides easy, more accurate processing. Among microcontrollers, Microchip PIC microcontroller is used due to easy programming and availability. As the microcontroller, PIC 16F877A is used in this project. According to Microchip Technology Inc (2001), it Consist of 40 pins included in five ports. This is an 8 bit CMOS mid-range type PIC microcontroller which, provide many internal facilities, compared to other mid-range microcontrollers. By now this microcontroller is being used at many designs because of easy in usage and many features. Fig.4. 6: Pin Diagram of PIC16F877A at Proteus 8.0
  • 31. 22 4.3.5 Relay Driver Electromagnetic relays are responsible in operating high current by a little current. To make relay operation, relay can be connected with Microcontroller output (port C and port D) directly. Although due to resistance, there may occur faults in relay operating due to relay is operated by 12V DC. According to STMicroelectronics (2002), it‟s is used as the relay driver in this project and it consist of seven pairs of Darlington arrays. ULN2003A IC consists of 16 pins included seven possible individual channel and tolerate up to 600mA current through each channel. The Darlington pairs may be paralleled for higher current capability. Applications include relay drivers, hammer drivers, lamp drivers, display drivers, line drivers, and logic buffers. The ULN2003 has a 2.7kW series base resistor for each Darlington pair for operation directly with TTL or 5V CMOS devices. As Michael Moulton (2010) says, in coil energizing and de-energizing inductance may occur on coil line and that back E.M.F influence on the microcontroller. Relay driver included diodes for inductive load suppression and provide protection to the microcontroller. Fig.4. 7: Internal pin connection of ULN2003A (STMicroelectronics, 2002).
  • 32. 23 4.3.6 Opto-Isolator (Optocoupler) Optocoupler is a two circuit isolator and transfer signal between those two circuits using light. According to Wayne Storr (2011), it also can be described as circuit interconnector by optical medium. Optocoupler usually consist of LED and a light sensitive signal transfer device. Basically, optocoupler used in on/off the system although, can be used in analog signal transmitting (variable switching). Optocouplers are available in different formats can be used at different operations. There are four basic types of optocouplers as,  Photo Transistor.  Photo Darlington.  Photo SCR.  Photo TRIAC. In DC circuits, Photo-transistor and photo-Darlington types are used and other two types used at AC circuits basically. PC817 photo transistor type octocouplers are used in the project. PC817 is a four pin IC according to Sharp Electrionic [2003]. Fig.4. 8: Pin Configuration of PC817
  • 33. 24 4.3.7 Power Supply This project is driven by both AC and DC. This project, it‟s included an AC port to supply 230V to electrical appliances which need to be controlled. All the other electronic and passive devices are driven by 12V DC voltage. It‟s expected to achieve all the power required by domestic electrical system. In Sri Lanka, the general domestic (single phase) voltage is 230V. Project is designed to directly connect with domestic AC line. In getting 12V DC supply, power pack is used. 4.3.8 Shunt Resistor Shunt resistor concept is mainly used in current measurement. Here, a small resistance is connected with the load and take the voltage drop due to the resistor. If resistance is known, by ohm‟s law, current in the branch can be measured. In this project it‟s used power resistors as shunt resistors and system feedback is expected to be taken by using voltage drop. “SQP5 Ceramic case” type power resistors are utilized as shunt resistors. As mentioned in TTelectronics (2007), SPQ5 category has 5W power consumption and resistance range is between 1Ωto 200Ω. It‟s expected to apply 200Ω SQP5 power resistors 4.3.9 Voltage Regulator A voltage regulator is used to control or regulate the voltage according to design specifications of that regulator. Regulator may be a simple "feed-forward" design or may include negative feedback control loops. It may use an electromechanical mechanism, or electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages. Usually 5V, 12V, 24V regulators are available. In this project 5V regulator was used. As the voltage LM7805 is used.
  • 34. 25 4.3.10 Crystal Oscillator It‟s designed to use two crystal oscillators as one for DTMF decoder IC and other for microcontroller unit. Crystal oscillator provide electrical signal with predefined frequency. This signal work as a clock input to digital circuits and hence, digital integrated circuits are operated at predefined operating speed. In this project, one 3.57945MHz crystal oscillators and one 20MHz oscillator are used. 4.3.11 Software Design Software simulation of the design is done by Proteus Design Suite 8.0 Software. In the simulation, it‟s taken PORT B in interfaced with DTMF decoder, PORT D as the output port and PORT C as the feedback input port due to reduce the schematic area of design template and to achieve a better vision of schematic screen shots. Optocouplers are placed separately to the circuit and connected those with the microcontroller by Input and output terminals option in software. Light bulbs were taken as electrical devices in the simulation to get clear indication of each operation. As DTMF inputs at PortB, it‟s taken four individual switches due to there‟s no MT8870 IC or relevant functional IC available in Proteus 8.0 Design software. Instead of automatic bit operations, manual bit operations done by switching in the software design. According to functional decode table in Zarlink Semiconductor (2005), switch operations are done to get relevant key pressed signal.
  • 35. 26 Instead of shunt resistor, bridge rectifier circuit unit (feedback circuit), optocouplers used along for the simulations. This operation is further described in next sections of this chapter. Relay driver wasn‟t grounded due to there‟s no any terminal for ground in simulation software. No crystal oscillator was used for the design purpose. Input and Output indicators were used for easy linking without connecting devices by wires in the software design. There are some differences between Schematic design ports pins and real circuit pins ports. In software simulations ports and pin selected to have clear layout. In real design, it‟s mainly considered about connection line design in PCB and in software design mainly considered about easy understandable designing to the viewer.
  • 36. 27 Fig.4. 9: Schematic Design at Proteus 8.0
  • 37. 28 4.4 Main Circuit In implementation, DTMF receiver IC pin 11 to 14 (Q1 to Q4) are interfaced with PIC 16F877A Microcontroller portA bit1 to bit4 pins (pin no.3, 4, 5, 6). Port C and port D is used as the output ports. LSB of port C (RC0) assigned with piezo buzzer and respectively RC1, RC2, RC3, RD0, RD1, RD2 pins (pin no.16, 17, 18, 19, 20, 21) used as 6 signal outputs for six appliances and interfaced with relay driver inputs2 to input7. (Pin no.2 to 7 in ULN2003A). Six MSB bits of the port B used for feedback input signal (opto-isolators interfacing) as RB7, RB6, RB5, RB4, RB3, and RB2. Optocoupler input to the microcontroller made across 1K resistors as “pull up” resistors. When relay is no operated input signal to microcontroller indicate as level 1. RA0 make logic 1 to toggle with the input data bits. VDD pins (Pin no. 11 and 32) are connected with 5V line of the PCB and VSS pins (pin no. 12 and 31) are connected to common neutral, ground path. In this project, pin 9 is connected with 12V and pin 8 is grounded of ULN2003A IC. Fig.4. 10: NPN Transistor based relay driving circuit. In
  • 38. 29 Connect one terminal of coil to supply voltage (12V) directly and isolate the circuit path when required can reduce fault level. Relay driver provide low circuitry with current control through the electromagnetic relay. Outputs from the relay driver IC pin no. 10 to 15 connected with one terminal of each relay coils. Other terminal of each relay coil is powered up by 12V DC supply which, rectified from 230V AC supply. Throw terminal (common terminal) is connected to 230V AC domestic supply live terminal. Regulator gives out 5V DC voltage as the output. GND can be taken for both 12V and 5V paths commonly. Two 100nF Capacitors are placed parallel to both 12V and 5V lines to disconnect voltage regulator from high frequencies. 100nF is a little capacitance and used that to achieve better accuracy. Fig.4. 11: LM7805 schematic simulation on Proteus In designing the decoder section, used external RC filter time constant only when EST pin at high. It‟s used 100nF capacitor and 390KΩ resistor for RC filter. DTMF receiver clock part is done by an external oscillator of 3.57MHz. This oscillator is coupled with 30nF capacitors in this design.
  • 39. 30 Fig.4. 12: RC filter configuration at EST pin (Zarlink semiconductor, 2005) TOE pin represent three state outputs enable. In this project TOE pin must be given High input to make four bit output. This pin is pulled up internally. As declared in the data sheet, it can identify, what are the outputs according key pressed. TOE, EST pins must be high. Inputs to the decoder come from the receiver phone, through the headset. In setting input signal pins, those signals are amplified in the circuit by operational amplifiers. Amplification factor is depended on the passive components which, manually fitted to input terminals. Fig.4. 13: Differential Input amplifier (Zarlink semiconductor, 2005) Decoder IC
  • 40. 31 IN+ is connected to non-inverting terminal as IN- connected with inverting terminal of the amplifier. This configuration can be identified as differential amplifier. R2 and R3 used as biasing resistors and R5 is used as feedback resistor. Biasing is done for keep reference voltage (Vref ) at half of supply voltage (VDD). Values for capacitors and resistors are proposed in the Data sheet. For R1 and R3, used 100K resistors and 100nF capacitor was applied for C1. Two capacitors were used with each crystal oscillator to damp down unwanted oscillations. Due to such oscillations, harmonics may occur and clock input frequency may be changed. 22nF capacitors connected with each crystal oscillator according to below diagram. Fig.4. 14: Crystal oscillator configuration According to activity is done (port B pin values), Piezo electric buzzer is operated and plays beeps. Operator allowed hears that beeps through the voice call and can identify the state of considered operation. One terminal of piezo buzzer is connected with portB bit 0 and other terminal is grounded. BCD to seven segment decoding IC pin no 1, 2, 6 and 7 connected with DTMF receiver IC pin no.7,6,5 and 8 respectively. 3, 4, 5 and 16 pins of 74LS48 IC are connected to 5V supply. Making 3, 4, 5 pins required to display all the hexadecimal values according to below chart in datasheet.
  • 41. 32 Red color common cathode type seven segment display is used in this project. Display pins are connected with BCD decoder IC pins as follows. BCD IC pin 15 with display pin 9 BCD IC pin 14 with display pin 10 BCD IC pin 13 with display pin 7 BCD IC pin 10 with display pin 2 BCD IC pin 12 with display pin 6 BCD IC pin 9 with display pin 1 BCD IC pin 11 with display pin 4 An amber LED is connected to the “STD” pin (pin no.15) of MT8870 IC as an indicator. It‟s designed to blink the LED two times when any key is pressed (DTMF tones are decoded). 4.5 Feedback Circuit Fig.4. 15: Feedback unit schematic design (one device) Feedback unit
  • 42. 33 This circuit consist all the feedback detection components. At each feedback part SQP5 power resistor connected series with power line and voltage across shunt resistor connected with bridge rectifier. Bridge rectifier is made of four 1N4147 diodes configured as above diagram. 330uF (C1) capacitor connected parallel with two outputs of the bridge rectifier to smooth the output signal. A 240Ω resistor connected series with one output terminal of bridge rectifier which, is connected with anode of optocoupler. Pin No. 4 of PC817 optocoupler connected with 5V DC supply trough 1KΩ resistor. That resistor set as Pull up resistor as above figure. Feedback consist five feedback parts for five devices and designed as one device is directly operated with electromagnetic relay. Design is done to operate up to 7A device without connect with external feedback due to 5W shunt resistors couldn‟t tolerate heavy load. In software simulation, it‟s taken as P terminal above diagram is connected 5V supply and N terminal of above diagram is connected with relay driver output terminal of below diagram instead of simulating feedback unit of above diagram for simulation task. Fig.4. 16: Pin assigning of optocoupler with feedback circuit.
  • 43. 34 Fig.4. 17: When M. Controller output is “level 0” feedback signal is at level 1. Fig.4. 18: When M. Controller output at “Logic 1”, feedback input at “Logic 0”. According to Figure X and Figure Y, Emitter of phototransistor is connected with relevant pin in portB (feedback input) of Microcontroller. (This connection is done by linking two circuits.) If any “device on” key is pressed, relevant output pin of portC or portD get logic 1
  • 44. 35 and relevant ULN2003A input pin set as logic 1. It allows to connect the non-powered (relay driver connected) relay coil terminal to be grounded and relay to be operated in the main circuit. Because of connected optocoupler pin 2 with ULN2003A connected relay coil terminal, infrared LED is not illuminated when relay is not at operate mode. Voltage of considered coil terminal is indicates as „null”. Connection with the ground of relay coil, make voltage to zero and infrared LED path is connected and illuminate the LED. That make relevant microcontroller pin of portB logic 0. Manual operation could be done by setting a two way switch with each device. Whatever the circuit switching state, user allows to operate each device as desire. If required, current state can be changed by remote system. In real circuit same the phenomena is done at biasing the infrared LED of the optocoupler. It‟s placed an amber LED for each feedback units in feedback circuit part. It‟s designed to illuminate the LED when the infrared LED of optocoupler is biased. Hence, amber LED is designed to illuminate when electrical device at ON state and Microcontroller feedback input at level 0. Fig.4. 19: Named feedback Circuit part for one device Power Resistor (Shunt Resistor) Smoothing capacitor Rectifier diodes NPN Transistor Amber LED Optocoupler
  • 45. 36 Two poles of electromagnetic relay are directly connected with two terminals two-way switch. Common terminal of two-way switch is connected to neutral terminal across controlled electrical appliance. Fig.4. 20: Switching modes and operation of two way switch system Circuit Designs (PCB designs) of main circuit and feedback circuit are included in appendix II.
  • 46. 37 CHAPTER 05 ANALYSIS 5.1 Microcontroller Program PIC 16F877A microcontroller program is compiled by “MikroC for PIC” compiler. Pickit 2 programmer is used to program the source code which was compiled. PIC Mikro C compiler was used because of easy coding, low number of instructions and its library function helps. Proteus Design Suite 8.0 software is used for software simulations. Fig.5. 1: Sound function declaration on MikroC It‟s designed the circuit to play one beep for switch ON key is pressed and that device at OFF state when switch ON key pressed. Also designed to play two beeps for switch OFF key is pressed and that device at ON state when switch OFF key pressed. Declaring those two functions reduce program space due to reduce program lines. “sound1” function responsible for switch on buzzer connected pin (Port C pin 0 or RC0) for 0.5 seconds. “sound2” function
  • 47. 38 responsible for play sound1 function for two times (two beeps). For that “for” loop is used. Value of integer j is increased two times from 0 till lower than 2 (0 and 1) and sound1 function paly two times because of that. Fig.5. 2: Ports and pin configuration on MikroC Main Function is declared as “void main ( )”. Main function is executed first when program is running. Under the main function Ports and pins of microcontroller which, are going to be used are allocated for functions. TRISB = 0xFF command allow all the pins of portB as inputs. Binary value of 0XFF is 11111111 and hence all the pins are reserved as inputs. Likewise, all the bits of PORTA are reserved as outputs. Set TRIS value of a pin to 1 indicates that pin is an input and TRIS value 0 indicates that pin is an output. Because of that, last four bits of PORTC and last three bits of PORTD are reserved as outputs as, TRISD=0x07; TRISC=0x0E;
  • 48. 39 In the program, all the portA, portC and portD pin values are set as 0 at beginning of the program. PORTA=0x00 says, all the pin values are zero (level 0) Unlike PIC16F887or PIC16F688, PIC16F877A doesn‟t response for ADSEL/ADSELH commands. Because of that, to make portA pin as digital, it‟s designed to make portA pins digital by ADCON1 register which, is a register in ADC module. Fig.5. 3: ADCON1 register bit configuration (Microchip technology Inc., 2003) In this register, bit0 to bit3 (PCFG0, PCFG1, PCFG2 and PCFG3) bits declare AD port configuration control bits. Analog pins, digital pins, reference voltages depend on value, assigned to these four bits. Fig.5. 4: AD port bit configuration of ADCON1. (Microchip technology Inc., 2003)
  • 49. 40 To make all pins of portA, it‟s declared that, value of above mentioned four bits must be 011X. Because of that by assigning decimal 6 or decimal 7 to ADCON1, make all portA pins digital. CMCON resister value assigned for decimal 7(0x07 or 0b00000111) to make comparators off at portA. Fig.5. 5: Key 1 function configuration on MikroC Its set bit 0 of portA as one for the triggering function and next last four bits (RA1, RA2, RA3, and RA4) interfaced with DTMF decoder. According to datasheet of DTMF decoder IC, if key “1” pressed DTMF decoder out “0001” bit pattern. Because of that, program is written if portA value is 000 0001 1, switch on the allocated output pin RC0. For the latch operation, it‟s written as, while (portA value at 00000011). Fig.5. 6: Key 4 function configuration It‟s designed to switch ON the device 1 by key 1 and switch OFF device 1 by key 4. 0100 bit pattern output from DTMF decoder if key 4 pressed. Because of that, it‟s programmed to switch OFF the portC pin 1 (device 1 allocated pin) when key 4 pressed.
  • 50. 41 Fig.5. 7:“One beep is played only if, both ON key pressed and device is OFF” on MikroC. As system designed, it‟s expected to play one beep when device ON key is pressed when that device at OFF state. PortB pin 2 set as feedback input pin of device 1. Only if that device at OFF state when key ON key pressed, one beep played according to above program. “&&” indicates logical AND logic. Fig.5. 8: “Two beeps re played only if both OFF key pressed and device is ON” on MikroC These codes shows that if switch OFF key pressed when device is at ON state, play two beeps. Tow beeps play if only that condition is fulfilled. Two beeps playing is done by sound2 function.
  • 51. 42 Fig.5. 9: Program flowchart
  • 52. 43 5.2 Electrical devices Load calculation According to Sharp Electrionic (2003), the typical forward voltage is 1.2V and maximum forward voltage is 3V. Fig.5. 10: Electro optical characteristics of PC817 Optocoupler (Sharp Electrionic, 2003) Because of 5W power resistors (shunt resistors) are used, ; P is the power of electrical device in W. P The devices which are going to be used must be lower than 950W approximately for this design. It‟s estimated duration between two operations must be at least 5 seconds for the safety and accuracy operations.
  • 53. 44 5.3 Problems encountered and solutions In the demonstrating the design, there were some problem occurred. In this design it‟s used PortA pin 1 to 4 (RA1, RA2, RA3 and RA4) as inputs from the DTMF decoder. PortA pin 0 (RA0) directly set to 5V supply and set as logic 1. RA4 pin of PIC16F877A wasn‟t reacted for commands given. As mentioned in Electro tech online portal (2006), RA4 pin is an open collector pin as then set RA4 pin through a pull up resistor of 10K to avoid from that problem. In software simulation, 7 segment display didn‟t indicate values over 9. There wasn‟t any indications for * and # keys. In real design, it‟s indicated the 0 at the startup of the circuit even without pressed 0 key. PCB lines weren‟t enough to work with high power AC appliances at the beginning. All the relevant pin connections to PCB are welded strongly and could be avoided from that problem.
  • 54. 45 5.4 Testing 5.4.1 Software Simulations Fig.5. 11: Key”1” is pressed and Device 01 is at ON state Fig.5. 12: Key “4” is pressed and Device 1 at OFF state.
  • 55. 46 5.4.2 Real world Tasting Fig.5. 13: Key 1 pressed and Electrical device is switch ON Fig.5. 14: Key 4 is pressed and electrical device is OFF
  • 56. 47 Design Simulations were done as software simulations and real world simulations. For the software simulations, Proteus design suite version 8.0 was used. Simulations done for all twelve keys and obtained operations (light on or off) done according to switch pressed Real world testing s were done in the Laboratory and home . Current, voltage measurements were taken at engineering laboratory and DC power supply also used instead of the power pack to get 12V DC. For the real world testing s, 100W incandescent bulbs were taken as demonstrating devices. In this chapter, it‟s included both software and real simulations of only key 1 and key 4 operations (Device 01 operation).
  • 57. 48 CHAPTER 06 CONCLUSION According to project researches and designs, it‟s aimed to design a circuit to control domestic electrical devices and get a tone feedback using a mobile phone. Operate domestic electrical devices as switch ON or switch OFF is task is accomplished as described in objectives. Circuit was designed to operate six separate electrical appliances separately. It‟s designed in the circuit to operate one of six appliances with the feedback from the electromagnetic relay instead of receiving the feedback from device electrical line. Up to 7A load device can be connected that terminal and other five appliances loads must be less than 950W. Manual operating operations were synchronized with the circuit and user allowed to control any device remotely or manually as desired. Attention on Feedback system part was higher in the design and designed to get feedback according to current situation of device electrical line (domestic line). This method allowed user to be informed about operation done and current situation. If that device is burnt of not operated due to internal technical problems of that device or device is not there, user can be informed about that by this method. Power of Five devices of System is at lower level in the design. Because of low power consuming electronic components usage that limitation occurred. Low cost mobile phone was utilized as the receiver and without receiver cost, approximately LKR. 4400.00 of cost disserved for the project.
  • 58. 49  Design for control (ON/OFF) six individual electrical appliances was successfully achieved.  Design for Manual operation and remote operation ability was successfully achieved.  Design for tone feedback according to current situation of the electrical device at remote operating (under either remote way or manual way operations) was successfully achieved. Electrical Device Status ON OFF ON No beep One beep OFF Two beeps One beep System operation chart is shown above. Due to above configuration, all the detections can be obtained and user can get real idea about current situation of the system. Switchoperation
  • 59. 50 CHAPTER 07 SUGGESSTIONS AND FURTHER WORKS Design can be further developed to operate high power electrical devices in three phase system. Number of Controlled individual electrical devices up to twelve as one pressed for device ON and next press for device OFF. Furthermore, system can be designed to control individual section (Room, Stair) security operations such as open close gates. System can be protected by using a password. Password is applied to the system and user only allowed to operate the system after password is inserted. Design can be modified for industrial applications by increasing load capacity of each device. If design is not powered up when, Domestic electrical Supply is not available, there‟s no way to detect that moment. Because of circuit 12V DC taken by domestic supply circuit is not driven at that time. System can be developed to be operated by 12V DC supply (Battery pack)
  • 60. x References Al Ali (2004). „Java-based home automation system‟, IEEE Consumer Electronics Society, ISSN 0098-3063, page no: 498 - 504.Available at http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=1309414&url=http%3A%2F%2Fieeex plore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D1309414. [Accessed on 17 February 2013] Electro tech online portal (2006) „How to use pin RA4 as digital I/O port? plz help‟, Electrotech Forum. [Online]. Available at: http://www.electro-tech- online.com/microcontrollers/25516-how-use-pin-ra4-digital-i-o-port-plz-help.html (Accessed: 06 July 2013) Fadhil T. Aula (2005), Using SMS in Mobile Phone for Home Appliances Controlling Through PC Parallel Port Interfacing, University of Salahaddin, College of Engineering, Electrical Engineering Department. Available at http://www.scribd.com/doc/25296268/Using- SMS-in-Mobile-Phone-for-Home-Appliances-Controlling-Through-PC-Parallel-Port- Interfacing [Accessed on 24 February 2013] International Telecom Union (2013) „ ITU Statics‟, ICT Facts Figures 2013,pp 1-2, [online]. Available at: http://www.itu.int/en/ITUD/Statistics/Documents/facts/ICTFactsFigures2013.pdf (Accessed: 02 May 2013) Malik, S. H. K., Aihab, K. and Erum, S. (2009) „SMS Based Wireless Home Appliance Control System (HACS) for Automating Appliances and Security. Issues in Informing Science and Information Technology, 6, 887-894. Available at: http://iisit.org/Vol6/IISITv6p887-894Khiyal592.pdf . [Accessed on 17 February 2013] Michael Moulton (2010) „Using Switches and Relays for Automatic or Manual Modes‟, Issues and Resolutions, pp. 4-5. [Online ]. Available at: http://www.egr.msu.edu/classes/ece480/capstone/spring10/group03/documents/AN_Michael Moulton.pdf (Accessed: 19 March 2013)
  • 61. xi Microchip Technology Inc. (2001). “PIC16F87XA datasheet, pp. 42-49. [Online ]. Available at: http://ww1.microchip.com/downloads/en/devicedoc/39582b.pdf (Accessed: 15 March 2013) Motorola Inc. (2000). “74LS48 datasheet” . [Online ]. Available at: http://html.alldatasheet.com/html-pdf/5727/MOTOROLA/74LS48/257/1/74LS48.html (Accessed: 21 March 2013) Noor M.(2005). ‘CONTROLING OF ROBOTIC CAR BY DTMF & 3G MOBILE PHONE TECHNOLOGY & APPLICATION OF DTMF TECHONOLOGY IN WIRELESS COMMERCIAL ENERGY METER‟, Rachna College of Business and Teechnology, pp.14 [online]. Available at: http://dc202.4shared.com/doc/Tb5LTlm4/preview.html (Accessed on 7 June 2013) Potamitis, I.et al (2003), An integrated system for smart-home control of appliances based on remote speech interaction. EUROSPEECH 2003, 8th European Conference on Speech Communication and Technology, pp. 2197-2200, Geneva, Switzerland, Sept. 1-4, 2003 [online]. Available at: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.78.2851 is14.pdf. [Accessed on 13 February] Rory Burk. (1999) Project Management Planning and control Techniques. 3rd edn. John Willy and sons: West Sussex. Shella Nugraheni.(2012), Basic microcontroller: 7 segment [online]. Available at: http://shellaudini.blogspot.com/ (Accessed: 14 may 2013) Sharp Electrionic (2003).” PC817 Datasheet” [online]. Available at: http://pdf1.alldatasheet.com/datasheet-pdf/view/43371/SHARP/PC817.html (Accessed: 30 march 2013) STMicroelectronics (2002).” ULN2003A datasheet” [online]. Available at: http://www.doyoung.net/video/DATASHEET/PDF/ULN2003.pdf (Accessed: 12 march 2013) Teter D. (2011) „Radio frequency based remote industrial appliances control system‟ LATEST PROJECT TITLES & PROJECTS. 2013. Radio frequency based remote industrial appliances control system ~ LATEST PROJECT TITLES & PROJECTS. [ONLINE]
  • 62. xii Available at:http://projecttitles4free.blogspot.com/2011/12/radio-frequency-based-remote- industrial.html. [Accessed: 13 February 2013]. Accessed with http://www.engineeringminiprojects.com/wp-content/uploads/2011/08/Radio-frequency- based-remote-industrial-appliances-control-system.pdf TTelecronics ( 2007 ). SQP5 Ceramic Case Resisters datasheet Available at: http://pdf1.alldatasheet.com/datasheet-pdf/view/199168/WELWYN/SQP5.html (Accessed: 04 April 2013) Wayne S. (2011) „Optocoupler‟, optocoupler Introduction available at: http://www.electronics-tutorials.ws/blog/optocoupler.html (Accessed: 18 march 2013) Zarlink semiconductor (2005).” MT8870D-1 datasheet” [Online]. Available at: http://www.natalnet.br/~aroca/afron/mt8870.pdf (Accessed: 12 March 2013)
  • 63. xiii Appendix I Proteus 8.0 Simulations Appendix Fig. 1: Key”1” is pressed and Device 01 is at ON state
  • 64. xiv Appendix Fig. 2: Key “2” is pressed and Device 2 at ON state
  • 65. xv Appendix Fig. 3: Key “3” is pressed and Device 3 at ON state
  • 66. xvi Appendix Fig. 4: Key “4” is pressed and Device 1 at OFF state.
  • 67. xvii Appendix Fig. 5: Key “5” is pressed and Device 2 at OFF state.
  • 68. xviii Appendix Fig. 6: Key “6” is pressed and Device 3 at OFF state.
  • 69. xix Appendix Fig. 7: Key “7” is pressed and Device 4 at ON state.
  • 70. xx Appendix Fig. 8: Key “8” is pressed and Device 5 at ON state.
  • 71. xxi Appendix Fig. 9: Key “9” is pressed and Device 6 at ON state.
  • 72. xxii Appendix Fig. 10: Key “0” is pressed and Device 5 at OFF state.
  • 73. xxiii Appendix Fig. 11: Key “*” is pressed and Device 4 at OFF state
  • 74. xxiv Appendix Fig. 12: Key “#” is pressed and Device 6 at OFF state.
  • 75. xxv Appendix II PCB Design of Main Circuit Appendix Fig. 13: PCB design of the main circuit
  • 76. xxvi PCB Design of Feedback circuit Appendix Fig. 14:PCB Design of Feedback circuit PCB is designed for two parallel shunt resistors and one shunt resistor is used in the project. PCB design consists of six individual feedback units.
  • 77. xxvii Appendix III Lab Tests Appendix Fig. 15: Design at the start (no key is pressed)
  • 78. xxviii Appendix Fig. 16: Key 1 is pressed and Light bulb is at ON state.
  • 79. xxix Appendix Fig. 17: Key 4 is pressed and light bulb at OFF state.
  • 80. xxx Appendix Fig. 18: of Decode testing circuit with a rectifier
  • 81. xxxi Appendix IV MikroC PIC Program int j; //declare integer for function void sound1( ) // declare one beep tone { PORTC.F0==1; delay_ms(500); PORTC.F0==0; } void sound2( ) // declare two beeps tone { for(j=0;j<2;j++) { PORTC.F0==1; delay_ms(500); PORTC.F0==0; } } void main( ) { //main program //port configuration TRISB=0xFF; //set portB as input TRISD=0x07; //set 3 LSBs as outputs. CMCON=0x07; //comparators off. TRISC=0x0E; //Set 4 LBSs as outputs. PORTC=0x00; //initially no output
  • 82. xxxii TRISA=0xFF; //set portA as input. ADCON1=0x07; //set all PortA pins as Digital. ADCON0=0x00; //ADC off PORTA=0x00; //initially no input portD=0x00; //initially no output TRISD0_bit = 0; TRISD1_bit = 0; TRISD2_bit = 0; TRISC0_bit = 0; TRISC1_bit = 0; TRISC2_bit = 0; TRISC3_bit = 0; //start the program loop do { if (portA==0b00000011) //if key 1 pressed { portC.F1=1; while(portA==0b00000011); } else if(portA==0b00000101) //if key 2 pressed
  • 83. xxxiii { portC.F2=1; while(portB==0b00000101); } else if(portA==0b00000111) //if key 3 pressed { portC.F3=1; while(portB==0b00000111); } else if(portB==0b00001001) //if key 4 pressed { portC.F1=0; while(portB==0b00001001); } else if(portB==0b00001011) //if key 5 pressed { portC.F2=0; while(portB==0b00001011); } else
  • 84. xxxiv if(portB==0b00001101) //if key 6 pressed { portC.F3=0; while(portB==0b00001101); } else if(portB==0b00001111) //if key 7 pressed { portD.F0=1; while(portB==0b00001111); } else if(portB==0b00010001) //if key 8 pressed { portD.F1=1; while(portB==0b00010001); } else if(portB==0b00010011) // if key 9 pressed { portD.F2=1; while(portB==0b00010011);
  • 85. xxxv } else if(portB==0b00010101) //if key 0 pressed { portD.F1=0; while(portB==0b00010101); } else if(portB==0b00010111) //if key * pressed { portD.F0=0; while(portB==0b00010111); } else if(portB==0b00011001) // if key # pressed { portD.F2=0; while(portB==0b00011001); } //call sound else if(portC.F1==1&& RB2==1) // if key 1 pressed when device 1 OFF {
  • 86. xxxvi sound1; // play one beep delay_ms(100); } else if(portC.F2==1&& RB3==1) // if key 2 pressed when device 2 OFF { sound1; // play one beep delay_ms(100); } else if(portC.F3==1&& RB4==1) // if key 3 pressed when device 3 OFF { sound1; // play one beep delay_ms(100); } else if(portD.F0==1&& RB5==1) // if key 7 pressed when device 4 OFF { sound1; // play one beep delay_ms(100); } else if(portD.F1==1&& RB6==1) // if key 8 pressed when device 5 OFF { sound1; // play one beep delay_ms(100); } else if(portD.F2==1&& RB7==1) // if key 9 pressed when device 6 OFF { sound1; // play one beep delay_ms(100);
  • 87. xxxvii } else if (portC.F1==0&&RB2==0) // if key 4 pressed when device 1 is ON { sound2; // play two beeps delay_ms(100); } else if (portC.F2==0&&RB3==0) // if key 5 pressed when device 2 is ON { sound2; // play two beeps delay_ms(100); } else if (portC.F3==0&&RB4==0) // if key 6 pressed when device 3 is ON { sound2; // play two beeps delay_ms(100); } else if (portD.F0==0&&RB5==0) // if key * pressed when device 4 is ON { sound2; // play two beeps delay_ms(100); } else if (portD.F1==0&&RB6==0) // if key 0 pressed when device 5 is ON { sound2; // play two beeps delay_ms(100); } else if (portD.F2==0&&RB7==0) // if key # pressed when device 6 is ON
  • 88. xxxviii { sound2; // play two beeps delay_ms(100); } } while (1); // endless loop } // end the project
  • 89. xxxix

×