Necessity of mother invention
1.1 The History of Technology and Automation
In saying "Necessity is the Mother of Invention" to conclude that man since the dawn of history has sought to facilitate his creativity to invite tools that helped him to live from Stone Age to Cooper, Bronze, and Iron Ages that each age developed the following age. He built growth of the ancient civilizations such as Egyptians that invented and used many simple machines and other ancient civilizations that improved many technologies for example Greek invented watermill which was the first human-devised motive force. The industrial revolution in Britain which is individuated by the promotions, in the areas of textile manufacturing, mining, metallurgy and transport driven by the development of the steam engine. That changed the whole course of man's life and the subsequent revolution in electricity, electronics and communications led to the development of technology.
Technology has transformed the lives of people world over, has saved us loads of time and has made life easier for all of us. 
The idea of remote control that controls machines after the World War 1 in Germany gave birth of automation. Automation can be defined as the use of control systems, Human activities and applications in all areas of life has rapidly expanded from the combination of automated devices with mathematical and organizational tools which created complex systems that have been used in industrial, commercial, economic, and social ranges of man's life. The evolution of controllers and automation has been developing and still continue to develop to these days. 
1.1.3 What is Home Automation?
Home is the word that refers to relaxing and rest after a long day of work, that when you get home you need all the reasons of relax, in the past man was coming home and was finding hit wife had created the comforts for him, but then women choose to be man's partner in all areas of life, so to find technology took the rule and start to create comfort for both man and woman at home.
The first appearance of home automation was the TV remote control and then inventions followed one another.
Home automation is a system in which user can control his home subsystems using an interface provided by the system to achieve the purpose of home automation.
188.8.131.52 The idea of home automation
The idea of home automation came from modern home which filled with electronic apparatus and appliances -which are the home subsystems foundation- to make life easier at home, more secure, and more comfortable that the user can control his house while he is relaxing or working.
184.108.40.206 The importance of home automation
When the user leaves his home to go on holiday, he loses all control over the functions of the house while he is away and cannot tell whether someone has punctured the security or whether he had left the living room light on. If the alarm has been triggered at his home, there is no way that the user can become aware of this unless he returns to his compromised home. In order for the system be useful, the appliances must be able to be moved around the house and still retain their ability to communicate with the system. A degree of automation is needed in a house so that certain functions in the house occur automatically, for example the outside light can turn on when it becomes dark outside.
There is a need for a reliable, secure and interactive system that exercises full control over the electric and electronic aspects of the house, with the potential to be accessed from across the globe.
220.127.116.11 The function of home automation
A home control system controls the user's whole house, triggering routines and events involving Home Subsystems. An automation system controls a collection of “Home Subsystems”.
A Home Subsystems includes light fixtures, the heating-cooling system, security components, entertainment, as well as devices like motorized drapes or any other condition that the user selects. Is a system that even when operating automatically provides benefits to the system user. A home automation system puts two or more Home-Subsystems under the control of one central controller which is PIC microcontroller and the user interface attached to the controller for example touch screen, key pad, handheld remotes, or a PC which we will describe it later in this chapter.
The Smart House system would adjust the power supplied to each appliance according to need. Each appliance is provided with sufficient power to provide for its peak use. In addition, the Smart House controllers could schedule the operation of heavy power consuming appliances (such as dishwashers, electric water heaters, and air conditioners) to take maximum advantage of off-peak electric rates. These adjustments could result in lower utility costs. 
1.2 The Purpose of the Project
The main purpose of the home automation project briefly is to make life easier.
To achieve the main purpose we need to design a control system for home appliances, the user can control real loads by a single touch on the touch panel , away from the traditional bush buttons remote control the user will use his finger to select any option on the touch panel whether it is a on/off button or next/previous command.
The user can choose the right arrow to select between the appliances (light, door open, door close, heater) then he will use the on/off button to toggle the load status.
To achieve the goal of this project the touch screen must be chosen so it can be interfaced to the microcontroller (PIC microcontroller) , the resistive touch screen can be used since the microcontroller has it own build in analog to digital converter,
The microcontroller will convert the output of the touch screen to digital value (x-position ,y- position) then it will decide the press location on what button (the buttons is drawn on a graphical LCD which is under the touch screen ) so the user will feel as if he press the button itself
After this the microcontroller will execute a certain routine to toggle the corresponding load depending on the pressed button.
1.4 System Block diagram
1.4.1 Block diagram source
As shown in figure above we have proposed a block diagram to achieve the project goal, the configuration and the connection of each components can found in the datasheet, for example the datasheet of the GLCD and the touch screen requires the use of PIC microcontroller so both of them must be connected directly to the PIC in the appropriate way. Also the web site. http://www.mikroe.com/en/tools/ provides learning kits with a full document and schematic diagrams for those kits, which was an addition information source to know how we can use the graphical LCD and the touch screen
The real loads driver circuit will take the command signal from the microcontroller so it also it will be connected directly to the microcontroller,
1.5 Features that provided by Home Automation
Home automation system can provide many benefits that make home safer, more comfortable, by employing sensors and control systems to monitor home and provide services.
- The home automation system can make the user be able to control his own home while he relaxing sleeping even while he is working.
- The home automation system makes the user be able to control lighting that he can change light with his mode and requirement.
- Security is one of the important benefits that can be provided by home automation system even during the absence of the user, that if there someone trying to breach house the system can release the alarm, lock all the exits until the user comes and reset the system.
- The home automation system can provide a system prevent fires by smoke sensors that senses for smoking if there the system release the alarm and the water sprinkles start spraying water.
- Home automation system can control the temperature of house by controlling AC.
- There is a large unexploited potential for using home automation for energy savings and comfort improvements.
1.6 Home Automation Components
- Central controller which is an inelegant device connected with the whole system, its job is to manage, process, and control the home automation system, it can be a PIC microcontroller, PC ....etc.
- User interface in which user can control the home automation system and choose the mode he need in any appliance of the system, it can be a touch screen, GLCD, remote control...etc.
- Appliances which are the devices that controlled by the system and it can be any device such as clean machine, AC, lighting as a sub system.....etc.
- Connection which is the type of connection between systems and it can be wired or wireless.
1.7 Wired vs. Wireless Home Automation
The medium through which communications occurs is crucial to the feasibility of a home automation system. So the types of home automation systems are:
1. Wired System
Traditionally, wiring consists of wires that get snaked through the walls. There are three wired systems: electricity, telephone, TV cable. Which have been earned by the home automation and the user more agree with, because it is provide reliability, it connect each appliance with central controller, signal between sent between devices is travelling through a physical medium .
Wired system provide reliability, but it is difficult to install, and it not easy for error detection and resolving, unless there is a smart central device and advanced physical medium and connections.
2. Wireless System
Each appliance is connected with a device as a receiver or transmitter that depends on the function of the appliance and what does it need, and for each sensor there is a transmitter and receiver device.
Transmitter device send a signal such as RF signal and the receiver receives the signal moves it to an intelligent device which detects if the signal for the device that connected with, if yes the intelligent device makes the attached device to act the suitable action for the situation.
The main difference between wired and wireless system that the communication between system components and devices in wired system using physical medium, but in the wireless system the signal is generated as Radio wave signal -for example- travels on the air and cached by receivers.
1.8 Software implementation
Since we are using a pic microcontroller then we need to use a compatible compiler and the easiest one is (MIKROBASIC) because it has a built in libraries for the graphical LCD also the used language is BASIC.
1.8.1 Why to use the mikrobasic instead of assembly (mp lab)
Using the graphical LCD in the project requires a lot o work in signaling the graphical lcd, so each picture or graph must be sent to the graphical lcd pixel by pixel which is a long work without any advantage because the mikroelctronica compiler (mikrobasic) comes with a built in libraries that support both (LCD, and graphical LCD) so the time needed for doing the libraries can be used to add more features to the main project.
Theoretical Back Ground
Description of the main blocks
2.1 PIC microcontroller
2.1.1 Microcontroller definition
PIC Microcontrollers (Figure (2.1)) are quickly replacing computers when it comes to programming robotic devices. These microcontrollers are small and can be programmed to carry out a number of tasks and are ideal for industrial projects. A simple program is written using a computer; it is then downloaded to a microcontroller which in turn can control a robotic device.
A microcontroller can be viewed as a set of digital logic circuits integrated on a single silicon ‘chip' whose connections and behavior can be specified and later altered when required, by the program in its memory.
The great advantage of this is that in order to change the circuit's structure and operation, all that is needed is a change in the program - very little, if any, circuit hardware modifications are necessary. An alternative view is that a microcontroller is a state machine whose logic states are defined by its program.
2.2.2 Microcontroller parts
- Processor that executes programs. It executes program digitally. All instruction given to the processor should be in digital form.
- Program memory to store the program that has been compiled successfully by the programmer.
- RAM (Random Access Memory) to store variables.
- IO port to connect sensor, keypad, led, relay and so on.
- Timer to count the time to execute some process.
PIC data RAM serves the role of registers and main memory i.e. there is no distinction between data accesses to registers and memory. And can think of the processor as having lots of registers and no additional data memory. it is used to store the cleaning path.
Using EEPROM (Electrically Erasable Programmable Read-Only Memory) is very important because data stored inside EEPROM will be retained when power supply is turned off.
There are 5 Input/ Output ports on PIC microcontroller (A, B, C, D, and E ) each of them have different functions. Most of them can be used as Input/ Output port.
2.2 Graphical LCD idea and background
2.2.1 GLCD implementation
- Graphical LCD , at which the graphics will be displayed
- The GLCD module is specially designed for microcontroller programmers who like an extra dimension in the projects.
- This module has a 128 X 64 pixel graphical LCD with touch screen,
- This LCD is controlled by KS0108 LCD controller via two segment drivers. LCD backlight colour is yellow-green.
- Touch panel, which will respond to the touches and convert it to analog voltages.
- Driving circuit which will take the control signal from the microcontroller and drive a real 220V ac loads.
- interfacing circuit: this circuit will take the four wires from the touch screen and fed the microcontroller with the analog voltage (x, y).
2.3 Driving circuit
Driving circuit is an electrical device used to make a device (such as the PIC microcontroller) to be able to control another devices.
Examples for driving circuits:
- Constant voltage circuit.
- High power transistor.
It is a term used to describe the electrical home devices, earlier the definition of appliance was ‘act of playing' which means to put to use for a practical purpose. The second definition was a piece of equipment (tool or device) "designed for a particular use or function" to enable the act of applying.
In our days appliance is any electrical device that can be used for a particular application such as refrigerator, TV, Dish washer, etc.
Appliances were considered as a luxury life requirements, but now it is a life demands. That we can't live without them.
2.2Part Two: Theory
2.2.1 How does the LCD work?
Liquid crystals are not liquid, also they are not solid but they are molecules can act like a liquid, and from there they had their name. The crystals in an LCD exist in a likely unique middle ground between solid and liquid form, this ground gives them the movement and flexibility to act as a liquid; also it lets them remain in place, like a solid. That can happened by heat which can quickly melt a solid to liquid, allowing it to move, on the other hand cool will make the liquid solidify almost instantly. The advantage of the liquid crystal is that it sensitive to the temperature or it can be a disadvantage. Its sensitivity to temperature allows for the highly successful use of liquid crystals in devices like thermometers, where temperature responsiveness is a boon; but this same property can unfortunately make LCD screens unreliable in extreme climates.
electric current in an LCD works at a microscopic level for controlling the amount of light that passes through the liquid crystal molecules, and molecules make up the moving layer of the screen. Molecules are located between two clear glass panels as a sandwich. Changing of the amount of light that pass from the bulb that is behind the glasses to the eye of the viewer happens by twisting molecules to unwind or coil tighter and that controlled by the current.
This process is like the sun light passes through the leaves of the tree, when a wind blow the tree we can see amount and placement of the light that comes through the leaves changes. This example is close to what happened inside the LCD, we can consider the sunlight as the small light of the bulb, and the leaves as the liquid crystal, and the wind made up by the electric current, and that will create the light changes in the LCD.
2.2.2 How to build home automation system:
The boon of designing home automation system is that we have a foundation electric and telephone connections that we will use in our system.
So to build a successful home automation system we need to document all electrical layouts, electronic systems layouts, communication layouts, lighting layouts, system distributions locations, cable routing locations.
Then we will start caballing and infrastructure. After caballing we will start to mange what we will expect from our system, do we need it for security, or for controlling, or for both.
Then we will start to interface the appliance and connect them to the control unit which we already planed where to locate it.
2.2.3 Working plan
- first step is to buy the needed components
- start testing interfacing the components as follows:
- connect the graphical LCD and display some pictures using the pic microcontroller
- connect the touch screen and test the output voltages when pressing on it, we will use the regular voltmeter to test the output voltages on each corner and it should be as follows
- design the output driving circuit to drive the real 220V loads by apply 1 5V on the input
Conclusion and Future Work
- Technology helped the man in all the areas of life, and gave the birth of automation.
- The idea of home automation came to make life easier and more secure.
- We are adding a system to an already built appliance, and to control these appliances we used driving circuits.
- There is two kinds of home automation systems: wired and wireless.
- The advantage of home automation system that we can use the electrical cables and connections that are already exist.
- This project is a wired system and we used GLCD to be the interface between the system and the user, that the user can control his home using the GLCD.