The evolution of information technologies has led to fast changes in human lifestyle. The use of electricity is significant as one of the key source of energy that is vital in current modern life. Some types of mechanism based on available technology could be used to decrease wastage in electricity consumption .
Smart home impression includes almost all technical services inside home using intelligent or smart system which is commonly based on a suitable communication system. It confirms the economic, safe and useful operation of the home and includes a high degree of good performance and flexibility. The main advantages of smart home systems are, basically, better comfort and personal care, and lower the costs of energy, and simplified establishment and flexibility .
Smart system is a term of the new technology that will be found in many applications in our daily lives for examples in the field of energy management, medical applications and industrial automation and automotive. The key subject of smart systems is the new inventions in the fields of nanotechnology, biotechnology, optical technology, advanced materials technology and nano electronics .
Energy saving technologies becomes more facilely available for residential purposes. These technologies can be categorized into two broad types: power generation systems and solutions to reduce consumption. They are being developed smart devices that allow the devices to switch o off for an energy saving condition when not in use .
Modern homes may be equipped with many developed devices, for example, digital televisions and personal computers, refrigerators, washing machines, bells doors , light switches, heaters, and so on. Reporting activities are needed to make intelligent decisions. For example, turning off lights in empty rooms, while the sensor does not have any activity.
They also include alarms burglar, surveillance cameras that may observe the state of doors. Electronic energy meters, gas meters and water meters can operate and record how many they are used periodically and automatically without human intervention .
Today the “energy” is necessary and fundamental human need. With the latest development of technology energy consumption is increasing day by day. The demand of energy becomes much greater than supply in almost all countries. Therefore, the energy is to be considered one of the basic infrastructures for the growth of any economy and an essential factor to evaluate the progress of any state or country .
Home Energy Management (HEM) depict a class of technologies, including sensors, smart heater, appliances searching to manage the profiles of the energy consumption in the residential strip to decrease peak electric request .
The number of HEM products has incurred and related companies have appeared over the past decade, ranging from fundamental energy displays to entire- home control systems and intelligent phones [7, 8].
1.2 Literature Survey
Although there is a lot of published work related to home energy management, including smart home and smart system. The following studies had been selected to refer as follows:
Conte and Scaradozzi (2003) Noticed home control systems as Multiple Agent Systems (MAS). In this paper, home control system has been suggested including home devices that are organized and preserved for home management .
Alkar and Buhur (2005) Suggested:
‘An Internet Based Wireless Home Automation System for Multifunctional Devices’
This paper offers a low cost and flexible web-based solution, but this system has some restrictions such as the distances and power failure .
Delgado, Picking and Grout (2006) explored the problems with the application of home control systems. Moreover the probable solutions are invented through several network technologies. Numerous issues affecting home control systems such as absence of robustness, compatibility subject and satisfactoriness among older and disabled people are debated .
Armando Roy Delgado, et al (2006) Defined an exploration into the possible for distant organized process of home control systems. They took in to consideration problems with their implementation, debated the possible solutions through different network technologies and specified how to optimize the use of such systems .
N. P. Jawarkar, Vasif Ahmed and R. D. Thakare (2007), Advanced a mobile phone that can assist as a great tool for world-wide communication for even traveling user. A system is developed to range the ability of mobile phone for distant watching and control of devices .
Jawarkar Ahmed, Ladhake, and Thakare (2008) Suggested distant watching through movable phone concerning the use of oral commands.
The oral commands are created and transmitted in the form of text SMS to the control system and then the microcontroller on the root of SMS takes a decision of a particular job .
Wael M. El-Medany and Mahmoud R. El-Sabry (2008) offered the design and execution of a distant sensing, control, and home safety system based on Global System for Mobile. Their system offers a complete, low cost, great and user friendly way of 24 hours real-time watching and distant control of a home safety. The design has been decided using VHSIC Hardware Description Language and implemented in hardware using Field Programmable Gate Array .
Malik Sikandar Hayat Khiyal, Aihab Khan and Erum Shehzadi (2009) focused on the controlling of home appliances remotely and providing security when the user is away from the place. The system is SMS based and uses wireless technology to revolutionize the standards of living. This system provides an ideal solution to the problems faced by home owners in daily life .
Mohd Helmy Abd Wahab, et al (2010) Offered the development of GSM- founded switch home appliances for intelligent home system. The key object of the investigation is to decrease the electricity consumption. GSM module was used for receiving Short Message Service from the user’s portable phone that spontaneously enable the controller to take any further action such as to alter the situation of the home appliance .
Manouchehr Ghahramanian Golzar and Hamid Reza Tajozzakerin (2010) Debated a design and employment of an internet- founded intelligent remote control system for home automation, devoted to power management that adjusts power consumption of available power incomes according to user ease and cost standards .
R. A., et al (2011) Dedicated on a design and execution of a GSM founded household power organization system to distantly control at most ten appliances via a portable phone connected to an automated device’s microcontroller using wireless technology. The proposed system authorizes to change the states of the appliances using SMS message from afar and sends back to inform the user the status (on/off) of the required devices .
Mansour H. Assaf, et al (2012) Offered the design and employment specifics of home control and safety system based on Field Programmable Gate Array using their system, the user can react directly with the system through a web-founded interface over the Internet, while home appliances are distantly changed by a user. A further feature that increases the security aspect of the system was its capability of monitoring entry points such as doors and windows so that in the event any breach, an alerting email message is sent to the home owner instantly .
Hyung-ChulJo, et al (2013) Debated the intelligent heating and air conditioning that considers customer fittingness in addition to characteristics of thermal appliances in an intelligent home environment. The prototype software founded on the recommended manner for HEMS is also executed .
F. Baig, et al, (2013) suggested a method by which the consumer can simply change its appliances distantly using the microcontroller interface with the Zigbee transceiver is on standard RS232 interface. A graphical user interface is delivered to the user where the data of its consumption are kept in a file .
It is clear that the above researches have used the wireless technologies to monitor or control the home appliances manually, while the system proposed in this thesis has been designed to operate automatically according to a predefined operation schedule as well as manually by using GSM network.
1.3 Aim of the Work
The aim of the present project is to design and implement a prototype of a home energy management system based on a microcontroller connected to a GSM network. The proposed system can remotely monitor and control the home appliances using a mobile phone through SMS service. Hence the electrical energy saving in daily life can be made more efficient and effective by turning off remotely unneeded appliances and lighting as required.
Therefore the objectives of the present thesis are:
(a) Design a home system consists of a microcontroller connecting with home appliances and lighting through sensors and relays. The microcontroller is also connected with a GSM module to support this system operate with an existing GSM network.
(b) Implement the proposed system by using a GSM module connecting with the personal computer representing the designed microcontroller.
The home appliances, sensors and relays are modeled and simulated using Visual Basic software.
(c) Develop programs to control the home appliances and monitor their status on the user mobile phone according to user request using SMS service. The programs are developed to operate the proposed system remotely in two modes: manual mode by switching ON or OFF the home appliances instantaneously or automatic mode (self-operation) according to a simple algorithm and predefined operation schedule customized by the home user.
1.4 Thesis Organization
The thesis is organized into five chapters as follows:
‘ Chapter One includes an introduction to home energy management system, literature review of related research, thesis objectives in addition to the organization of the present thesis.
‘ Chapter Two offers the background theory needed for the proposed system.
‘ Chapter Three presents design and implementation of the proposed system using GSM module and PC (personal computer) representing the modeled and simulated home appliances, lighting, sensors and relays.
‘ Chapter Four introduces the system evaluation with the main system tests in addition to results and discussion.
‘ Chapter Five summarizes the main conclusions of the accomplished work and offers some suggestions for future work.
2.1 Description of Proposed System
The proposed system consists of a home unit representing a microcontroller unit MCU is connected with GSM module, sensors, relays and home appliances in addition to a mobile unit representing the user’s mobile phone as shown in Figure (2.1). The function of MCU is to monitor the status of home appliances and send these data to the user mobile phone through the GSM module in the form of SMS message. Also, MCU receives the command message from the user mobile phone through the GSM module to activate and control home appliances. The home appliances are considered to be HVAC, Lighting, power plugs, boiler, etc.
Figure (2.1): The proposed system block diagram.
2.2 Global System for Mobile Communications GSM
Security is regarded a main matter when it moves toward home automation. Old-style methods of alarm based security have added much publicity in previous decades. Recently, many systems were presented for safety measurements founded on wired networks. In works, investigators proposed a number of security systems depended on new techniques like GSM, General Packet Radio Service (GPRS), internet, Ubiquitous Sensor Network (USN) and executed through Field Programmable Gate Arrays (FPGA), Application Specific Integrated Circuit (ASICs), Digital Signal Processor (DSP), and Microcontroller Unit (MCU) .
In 1982 the GSM descriptions began with an objective of realizing a European moveable radio network that is digital and able of handling traveling. This work on the description continued until 1990, where the first stage of the GSM picture was stationary. The first formal GSM network was published in Germany in 1992, and at the end of 1997 almost 98% of the people were accessible.
GSM was a vast success and extent very quickly not only within Europe but in the word. GSM is also familiar as the 2nd generation cellular wireless system (2G). The properties were completed on the last of the 1990s and this system was named International Mobile Telecommunication-2000 (IMT-2000). Then the 3GPP completed the first type of their mobile communication system next GSM which was known as Universal Mobile Telecommunication System (UMTS) .
In 2004 the 3GPP had begun working on the following mobile system which is named Long Term Evolution (LTE) .
GSM employs a mixture of Frequency Division Multiple Access (FDMA) and Time Division Multiple Access (TDMA) on the air-interface. senior standards of mobile systems employ only FDMA. In a FDMA system, one particular frequency is assigned for each consumer through a call, which quickly leads to overload states in cases of high demand. In the two-dimensional structure, each frequency has eight Time Slots (TSs); each user employs one TS, this grows the ability of the system and decreases the likelihood of call crowding .
The 900-MHz band is named the main band and comprises two sub- bands of 25MHz each. The Mobile Station (MS) sends to the Base Transceiver Station (BTS) by the Up-Link channels (UL), while the BTS sends to the MSs by the Down-Link channels (DL). The UL is a 25MHz band ranging from 890-915MHz and the DL is 25MHz band extending from 935-960MHz. Each 25MHz-band is distributed into 125 channels of 200 kHz bandwidth. They are numbered from 0 to 124; each channel has a number that is named the Absolute Radio Frequency Channel Number (ARFCN). Inside the system only the channels from 1 to 124 are utilized. Channel number 0 is employ as a protector band between GSM and other services at lower frequencies. There are 45MHz duplex frequency separation between UL and DL. Then, if a mobile station sends a definite frequency to the BTS, it will receive from the BTS, a carrier frequency shifted by 45 MHz from the sent channel carrier .
2.3 GSM Network Architecture
The GSM technology has considered the fundamental key and guidelines for other next generations of mobile network. The GSM radio network employ several radio cells, each controlled by a Base Transceiver Station (BTS).
A cell is a geographical form of the coverage area within which a BTS can transmit and receive data. Cells are usually characterized by hexagonal figures for ease. Each BT assists a number of MS (users), and a number of BTSs are organized by the Base Station Controller (BSC). Figure (2.3) shows the overall GSM network architecture. The GSM network architecture is consist of four key functional parts :
‘ Mobile Station (MS): is also known as User Equipment (UE), this unit based on the Subscriber Identity Module (SIM) and the terminal equipment.
‘ Base Station Subsystem (BSS): this unit grips the radio access functions, like radio source management. It joins the UEs with the core network.
‘ Core Network (CN): comprises the passage functions, management of motion, subscriber databases with their info, controlling services, billing, etc.
‘ External Network: with which the UEs can communicate and that the mobile network has to be linked to.
The architecture illustrated in figure (2.2) represents the public telephone network or any other GSM network.
MT: Mobile Terminal BSC: Base Station Controller HLR: Home Location Registry
TE: Terminal Equipment MSC: Mobile Switching Center AUC: Authentication Center
BTS: Base Transceiver VLR: Victors Location Registry PSTN: Public Switched Telephone Network
Figure (2.2): GSM network architecture .
2.4 Short Message Services
GSM includes three categories of services. The first category of services is related to the transmission of data to or from an ISDN terminal.
These services are indicated to as bearer services. The second category of services is indicated to as Tele-services. This category includes services such as telephony and SMS. The third category of services is indicated to as supplementary services. This contains services such as caller identification, call forwarding, call waiting, multiparty conversations, and barring of outgoing calls. Next to voice services, which have been the main focus of GSM from the start, SMS has proven to be extremely public and successful in GSM .
The GSM mobile telephony system provides text messaging through an very popular service called the SMS.
Nowadays, the people who use the GSM have exceeded more than 900 million, where the exchanged messages between them are almost 15 billion every month .
Short Messaging Service is the propagation of short text messages to and from a mobile phone, fax machine, and/or IP address. Messages must be no longer than 160 alphanumeric characters .
Short Messaging Service is a relatively simple messaging system provided by the mobile phone networks. SMS messages are supported by GSM (using TDMA and CDMA techniques) based mobile phone networks currently in use. Although services based on SMS have been feasible for many years, the recent mobile phone penetration and large scale adoption of the existing services by users have made the SMS based services even more attractive to service providers . Short Messaging Service is a globally accepted wireless service that allows mobile subscribers to send and receive alphanumeric messages of up to 140 bytes in length. A distinguishing characteristic of the service is the guaranteed delivery of SMS by the network via a store-and forward mechanism. Temporary failures are identified, and the SMS is stored in the network until the destination becomes available. Despite the enormous popularity of SMS, the content that can be transmitted is limited to short text messages, ring tones, and small graphics .
Standard SMS messaging uses 140bytes (octets) per message, which translates to 160 characters (7 bits bytes) of the English alphabet using 7-bit encoding or as few as 70 characters for languages using non-Latin alphabets using UTF-16 encoding. The commonly cited limit of 140 characters is imposed by some services like twitter that reserve 20 characters for non-message content, like addressing .
The advantages of SMS to subscriber center on suitability, flexibility, and the integration of messaging services and data access. From this perspective, the main feature is the ability to use the phone as an extension of the computer. These benefits normally based on the applications that the service provider offers .
2.5 Mobile Station (Phone)
The MS is a grouping of terminal equipment and subscriber data. The terminal equipment as such is called ME (Mobile Equipment) and the subscriber’s data is stored in a separate module called a Subscriber Identity Module (SIM) . SIM is a card that fits in the receiver and is one of two sizes – either size (same size as a credit card) or small version of a piece . A cellular telephone system links mobile station (MS) subscribers into the public telephone system or to another cellular system’s MS subscriber .
2.6 Microcontroller Unit (MCU)
With the advancement of semiconductor fabrication technology manufacturers are able to integrate memory, input/output interfacing circuits, timer, serial com port and analog to digital conversion and other peripherals into the microcontroller.
Thus, it is essentially an entire chip fabricated on a sole chip. The sole chip microcontrollers are used in consumer products like washing machines, copiers, AC machines, printers, etc., high speed data processing like video conference, real time compression and security system, image processing, etc., automotive systems like electronic power steering system, antilock braking systems etc., different industrial applications like AC and DC motor drives, position control, motion control etc. .
Due to the integration of all function blocks on a sole chip microcontroller IC, the sizes of control boards and power consumption are reduced; system reliability increased and also provides flexibility. The other advantages of using such microcontroller based systems are easy troubleshooting and maintenance. All of the overhead mentioned fields of applications depend on the several factors of selecting the right microcontroller unit for specific applications .
It has volatile RAM for data storage, ROM, EPROM, EEPROM, flash memory for programming as well as storage of the processing parameters, bi-directional I/O pins allowing control and detection of logic state, UART, and peripherals like timer, counter, PWM generator, watchdog timer, clock generator, ADC, DAC and finally in circuit software design and debugging support . As such the microcontroller is a very flexible electronic ‘tool’ to be applied in a very wide ambit of product and process applications. Microcontrollers show a low cost computing solution .
The typical functional block diagram of the microcontroller is shown in Figure (2.3) below.
Figure (2.3): Typical functional block diagram of the microcontroller.
The MCU could be used in the proposed system is a standard one and similar to that is shown in Figure (2.4). This figure shows a PIC18F4620 that has 40 pins of different inputs/outputs could be used according to design requirements. In the implemented system, the MCU has been modeled and simulated as will be described later.
Figure (2.4): The block diagram of PIC18F4620 .
2.7 Occupancy Sensors
Occupancy sensors are motion detectors that have an integrated timing device. They are most commonly used to control indoor lighting. Old-style occupancy sensors turn illuminations on when an area becomes occupied and turn illuminations off after the area becomes unoccupied .
A motion detector is a device that discovers moving objects, especially people. A motion detector is predominating integrated as a consist of a system that automatically performs a task or alerts a user of motion in an area. Motion detectors form a vital component of security, automated lighting control, home control, energy efficiency, and other useful systems .
Motion detectors have found great application in domestic and commercial applications. Some of these applications consist of motion-activated outdoor lighting systems, motion sensor street lamps and motion sensor lanterns. An electronic motion detector comprises a motion sensor that transforms the detection of motion into an electric signal .
Different technologies are used for detecting motion, usually based on the application. Most sensors designed for interior applications employ ultrasonic or Passive Infrared (PIR) technologies, or dual-sensing technologies (e.g., both ultrasonic and PIR), to help reduce the occurrence of false positives that incorrectly invoke a response .
A relay is usually an electromechanical device that is motivated by an electrical current. The current flowing in one circuit causes the opening or closing of another circuit.
Relays are like remote control switches and are used in many applications because of their relative simplicity, long life, and proven high reliability. Relays are used in a wide variety of applications throughout industry, such as in telephone exchanges, digital computers and automation systems. In the home, relays are used in refrigerators, washing machines, dishwashers, and heating and air-conditioning controls. Although the relays are generally associated with electrical circuitry, there are many other types, such as pneumatic and hydraulic. The input of the relay may be electrical signal and the output directly mechanical, or vice versa .
Figure (2.5) shows an electronic circuit diagram for the relay/MCU interface. Inside a relay is an inductor (a wire coil) that, when energized with a current passing through a transistor (fed with 5 volts), will generate a magnetic field. This magnetic field activates a second part of the relay (metallic arm) to make up the physical contacts of the appliance switch to be ON. The relay is off, when no current is passing through the transistor (fed by zero volt), and the arm of the switch makes the appliance to be OFF .
The concept of operation will be modeled and simulated in the proposed system.
Figure (2.5): Electronic circuit diagram for relay/MCU interface .
2.8 AT Commands of GSM Modem
AT commands are utilized to control modems. AT is the abbreviation for Attention. These commands arrive from Hayes commands that were utilized by the Hayes smart modems. The Hayes commands began with AT to indicate the attention from the modem. The dial up and wireless modems (devices that involve machine to machine communication) need AT commands to interact with a computer. These include the Hayes command set as a subset, along with other extended AT commands.
AT commands with a GSM/GPRS modem or a mobile phone can be used to access following information and services :
a) Information and configuration pertaining to mobile device, modem, and SIM card.
b) SMS services.
c) MMS services.
d) Fax services.
e) Data and Voice link over mobile
The Hayes subset commands are called the basic commands and the commands specific to a GSM network are called extended AT commands. There are four types of AT commands, as shown in Figure (2.6) .
Figure (2.6): AT commands types .
2.8.1 Test Commands
Test commands used to check whether a command is supported or not by the modem.
SYNTAX: AT<command name>=?
For example: ATD=?
2.8.2 Read Commands
Read commands used to get mobile phone or modem settings for an operation.
SYNTAX: AT<command name>?
For example: AT+CBC?
2.8.3 Set Commands
Set commands used to modify mobile phone or MODEM settings for an operation.
SYNTAX: AT<command Name>=value1, value2,’, value N
For example: AT+CSCA=’+9876543210′, 120
2.8.4 Execution Commands
Execution commands used to carry out an operation.
SYNTAX: AT<command Name>=parameter1, parameter2,’, parameter N
For example: AT+CMSS=1,’+ 9876543210′, 120
The read commands are not available to get value of last parameter assigned in execution commands because the parameters of execution commands are not stored. The detailed AT commands can be found in the Datasheets of the GSM modems. The AT commands that used in our work are the SMS AT commands and they are available in Appendix (A).
2.8 Visual Basic.6 (VB.6)
It is a great level language grown from the earlier DOS version called BASIC. BASIC means Beginners’ All-purpose Symbolic Instruction Code. Different software companies produced dissimilar version of BASIC, such as Microsoft QBASIC, QUICKBASIC, GWBASIC, and IBM BASICA and so on. In VISUAL BASIC, programming is done in a picturesque environment. Because users may click on a certain object and each object has to be programmed independently to respond to those actions (events).
Therefore, it is a VISUAL BASIC program consists of several sub-programs, each has its own program codes, and each can be executed independently and at the same time each can be linked together in one way or another .
Since Visual Basic was designed to be simply educated and used by beginner programmers, the language not only allows programmers to create simple Graphical User Interface GUI applications, but can also evolve complex applications.
Programming in VB is a combination of visually arrangement components or controls on a form, specifying attributes and actions of those components, and writing additional lines of code for more functionality. Since default attributes and actions are defined for the components, a simple program can be created without the programmer having to write many lines of code .