Implementation of a Microcontroller Based Wireless Control of Domestic Electrical Appliances using the GSM Network

In this paper, the automatic control of domestic electrical appliances using a wireless network is presented. The wireless network of choice is the Global system for mobile communication, GSM. This paper presents a methodology that the communication can be extended even to inanimate devices like domestic electrical appliances such as radio, refrigerator, TV, light bulbs etc. the methodology entails the use of the feature of the GSM phone known as dual tone multi frequency DTMF. This DTMF tones are automatically generated when the buttons of a mobile phone is pressed. A DTMF to binary converter integrated circuit was used to convert the DTMF tones into binary format which is fed into the I/O ports of an 8052 microcontroller. A resident program enables the DTMF codes that are received to be used to control electrical appliances. The system also has a unique feature that after an action is performed; it sends back an audio tone to inform the user about the success or failure of the execution of the command.


INTRODUCTION
The creation of the internet is housed on an utmost desire that all the computer systems built in the planet, should communicate with each other. To literally "talk" to each other [1]. The practice of the internet of things is also designed based on this desire. However, in this practice, the communication intension is not just between computers, but amongst all the electrical devices ever designed on the face of the earth.Such a network has already been created. One of such is the implementation of a Raspberry communicator that enables a user to remotely control all electrical appliances connected to his home, via the internet. Furthermore a desire for the need to control electrical devices wirelessly has been in existence for years [4]. The first remote control ever created was named Lazy Bones because it enables the user to effortlessly control an electrical device. Remote or wireless control is based on technologies like infrared, Bluetooth, RF frequency to mention a few. However, most wireless option is limited by effectiveness or in most cases, range.
The GSM network has been proven to have a limitless range as GSM phone communication can be done on any place on the surface of the earth. To this effect, the use of the GSM phone signal as a means of wireless control for appliances and other things, is a subject of growing interest and is finding application in different areas. Its use in metering units has been deployed in many parts of the country [6]. Its use also in the control of lightening systems has also been known to be deployed in some other part s of the country too [2]. A further application of the connection of a GSM phone and an electronic circuit can be used to check the availability or unavailability of public power supply [5]. This feature will be incorporated in this design. This application is made possible by the infusing of an embedded system with the GSM phone. An embedded system is an electronic circuit that is designed to operate with at least one programmable integrated circuit chip. A microcontroller used in an electronic circuit is an embedded system. The GSM phone is connected to a microcontroller, and a program is written into the ROM of the microcontroller whose function is basically to operate the electrical or electronic devices connected to it.
The importance of a system that can enable a mobile phone to control electrical appliances will find enormous usefulness in the society. Of all the many advantages of such a creation, the most prominent one is in the desire to save electrical power by preventing wastefulness. Due to erratic power supply, users mostly forget to turn off their electrical appliances while leaving the house, and with the implementation of this technology can enable the user to turn off all their electrical appliances by the pressing of buttons on their phone. This technology also saves power for people who practice temperature regulation in their homes or offices. This temperature regulation, practiced by some people, makes them want to keep the temperature of their establishments at a desired level. This is done by the leaving of their air conditioner system or fans on all through the day

IJTSRD23973
International Journal of Trend in Scientific Research and Development (IJTSRD) @ www.ijtsrd.com eISSN: 2456-6470 @ IJTSRD | Unique Paper ID -IJTSRD23973 | Volume -3 | Issue -4 | May-Jun 2019 Page: 913 and even at night when they close for the day, so that at the resumption of work the next day, the office temperature is suitable for comfort. This practice enables the wastage of electrical power. However, the implementation of this GSM control of electrical appliances can eliminate this wastefulness. The phone will be used to turn on the ventilation system from the comfort of their homes, just a few hours before resumption of work rather than to leave it on all through the night.
Another importance of such a system is that a user can actually find out the status of the electrical power in any remote location. All the user has to do, is dial a number and press some codes on the buttons of his phone, and audio feedback codes will inform them whether or not electrical power is available in the area.
This system will ensure the effortless control of electrical appliances by the use of a wireless network. It ensures that range, which is an inherent problem with most other designs of wireless control is eliminated while ensuring that electrical power which is one of the most important source of energy is conserved.

SYSTEM DESIGN
The embedded system that performs the operation of the use of a GSM phone to control domestic electrical appliances has the block diagram shown below in fig 1.
The whole system works on an ac power supply unit obtained from the public mains but converted to dc power supply so that it can be suitable for the powering of the embedded system electronic circuit. The GSM receiver MODEM is a NOKIA 103. This phone was chosen because of its strong network feature and especially for its ability to retain a very long battery life span as well as its ease of acquisition due to its cheapness and popularity; also for its size and robustness. This cellphone is optimized for its use to receive the DTMF signals transmitted to it by the user. This means that in the enhancement settings of the phone's basic memory, it has been altered to have auto answer so that when the user calls to send instructions, the phone picks automatically.

FIGURE 1: Block diagram of the GSM control of electrical appliances
The DTMF converter is built around a DTMF converter integrated circuit MT8870 chip. This chip has been optimized to decode frequencies of a particular order into binary. The GSM network uses a constant frequency combination for each of the key pads. These frequency combination is one of a high frequency and a low frequency tone. To illustrate these operations, consider figure 2 For instance button 1 of the GSM phone outputs low frequency of 697hertz and a high frequency of 1209, while button 6 takes frequencies of 770hertz and 1477. It's a combination of these frequencies that the DTMF IC chip uses and outputs the binary equivalent of the received frequency and these decodes the number that was pressed.
The microcontroller takes this converted binary code through its I/O ports, and based on existing program controls the loads via the load switching circuits according to the codes that were sent to it.
The load switching circuits consists of relays and relay drivers that will enable the relays to operate the electrical appliances connected to them. Each relays are programmed to control a particular load upon the recipient of commands from the microcontroller. For the prototype that was constructed, the loads used were five (5) in number. Meanwhile, if a code is sent to the microcontroller to turn on a particular load, say load 3, the microcontroller first checks the status of the load, and if load 3 is already on, the transmitter audio tone codes back to the user via the audio feedback tone generator (which is built around a 555 timer connected in the astable mode), but will turn on the load 3 without any feedback tone if the load 3 status is already off.
The system has a display unit for the user that is within view point of the system. This display unit is a 6 by 2 LCD screen. This is the user interface that will inform the user of the status of the system. It tells the user if a phone communication is in progress, if the command to turn on a particular load is proper, if the code is in error etc.
Furthermore, at the start of any of the control operation, the microcontroller firsts outputs a power availability code tone to the user. This is a set of code tones that will tell the user that there is power supply available in the area. This is so that in case the code is not heard after a connection has been made; the user should not even bother to send any code to control electrical loads because a public mains power failure has occurred. In this part of the country, such phenomenon is common place.
A summary list of the normal performed operation is as given below: The system is powered up The load status of all the loads is established The GSM receiver modem inside the system awaits a command.
The user makes a call to the number of the modem, and the modem auto picks the call and the user listens for the audio code to inform them if public power supply is available or not.
If power is unavailable, the audio code is silent and the user ends the connectivity.
However, if power is available, the audio code is sounded and the system awaits further instructions. The LCD displays that a connection has been made.
The user types the appropriate code to turn on or off a desired load and waits for an error feedback tone from the feedback tone generator. If a feedback code is gotten, the user knows that there is an error with the command and that the desired load is already on. The LCD displays this transaction.
If the code to turn on the load is successful and the load is actually turned on, the load status is updated to show that the load is now on while the LCD displays that the operation is successful.
The whole system goes back to a default mode and awaits the next command.

DESIGN CONSIDERATION
The design of the circuit is in four stages which are: the power supply unit, the power indicator unit, the DTMF chip unit and the audio feedback unit.

POWER SUPPLY DESIGN
To achieve the required dc voltage which is not more than 15V, the step down transformer chosen is rated: 220Vac/240V ac: 18Vac at 300mA. The peak output voltage of this transformer is given as: The diodes that will be chosen for the bridge rectifier will have a peak The voltage regulators chosen for this work is the positive voltage regulators LM7805 and LM7812. The 5V powering the 555 timer IC and the DTMF chip the GSM module and the Microcontroller chip. The 12V powering the relays controlling the loads.

THE POWER INDICATOR UNIT
The power indicator unit is built around an LED and a biasing or limiting resistor. The LED can sink current within the range 10mA to 20mA. Recall: The resistor chosen has a rating of 220Ω.

THE DTMF CHIP UNIT
The DTMF chip was designed to have unity gain. Hence the resistors R1 and R2 was chosen to have the same value of 100k.

THE LOAD SWITCHING UNIT
The load switching unit was designed around a transistor whose load is a 12V relay to do the switching. For the transistor R1 is a pull up resistor. It value was chosen as 1k. For hard saturation, RC is the resistance of the relay coil = 400Ω Therefore, RB = 10 x 400Ω = 4000Ω The resistor chosen has a value of 4700Ω, which is the nearest preferred value.

THE AUDIO FEEDBACK UNIT
This unit is designed around a 555 timer chip. We design this unit for an audio tone of one hertz (1Hz). Recalling the formula for the frequency of a 555 timer chip: Here we choose: f = 1Hz, R1 = 1kΩ, C1 = 100 F and C2 = 0.01 F. Then we calculate for R2.
Making R2 subject of the formula and substituting, then The resistor chosen has a rating of 220Ω. For hard saturation,

SOFTWARE DEVELOPMENT
The software program that was written and burned into the ROM of the 8052 microcontroller was written in assembly language using a development environment. The development environment that was used is the Micro integrated Development Environment (MIDE). This software has a compiler that can be used to convert assembly language directly into machine codes. Machine codes are also known as Hex codes.
After the codes are written in assembly language and the compiler converts it into machine codes, a TOPWIN 6 universal programmer is used to burn the program into the microcontroller. The chip is placed in the connectors of the programmer and the programmer is connected to the system using a USB cord, then the driver for the programmer is launched and when the interface pops out, the prompts are followed that will burn the program into the chip. Then the chip is pulled out and inserted into the main electronic circuit.

ALGORITHM
The algorithm for the program is started below: Step 1: start the program Step 2: initialize the alarm, the display, the load status circuit and the actual electrical loads Step 3: the system awaits command from the DTMF circui Step 4: if a command is given, the program goes to step 5, if not the program returns to step 3. However, if a command is given, it goes to step 5 Step 5: the microcontroller receives the command that is given, outputs an audio correct code to the user via the GSM receiver inside the system. If an audio code is not given, the program goes to step1 but if it is given, it goes to step 6 Step 6: checks the content of the command. If the command is to turn on a load, the program jumps to Step 7: If the command is to turn off a load the program jumps to step 8, displays on the LCD that a command is given either to turn ON a load or to turn it OFF. If the code is in error, the microcontroller emits an error audio code to the user and displays error code on the LCD before jumping to step 3 Step 8: the program decodes the load that is addressed and checks the status of the load. If the load is already on, the microcontroller emits an error audio code to the user via the audio code generator, displays the message on the LCD and jumps back to step 3. But if the load is off, the message is displayed on the LCD and the program jumps to step 9 Step 9: the program decodes the load that is requested to turn off and checks the status of the load, if the load is already off, the microcontroller sends an error audio code to the user, display the message on the LCD and jumps back to step 3. But if the load is on, the program jumps to step10 Step 10: turns on the desired load, and jumps to step11.
Step11: turns off the desired load, and jumps to step11.
Step 12: sends a correct audio code to the user, displays the message on the LCD and jumps back to step 3.

RESULT AND DISCUSSION
The final response after the completion of the design and construction of the system is presented in this section.
Several tests were performed based on the structure of the circuit and the syntax of the program and the expected results were further analyzed for their verification. The system was designed based on the transmitting of a DTMF tones to an embedded GSM phone resident inside the circuit. This GSM phone acts as the MODEM.
When a call is initiated, the user sends a set of codes using the keypads of his phone, to the GSM MODEM inside the system. When a command is given to turn on or turn off the load, the user first listens for either an error audio feedback tone code or a correct audio feedback code tone. The audio tone generator outputs a burst of tones at a frequency of one (1) hertz, the number of pulses determines if the audio tone is power availability, error signal or correct signal. This is illustrated on table 2 For the purpose of the prototype, the number of loads to be controlled is five (5) and each one responds to a code to either turn it on or off. *14xx# is the default code for a turn on command, while *15xx# is the default code for a turn off command. The following list of tables further explains the usage of these codes Any codes that is not listed above, will generate an error signal code from the audio code generator and the LCD will display an error message.

CONCLUSION
The design and construction of a system that will enable a GSM phone to control electrical appliances is a very interesting one. Parameters that were considered are cost, efficiency and durability. The system boasts of highly advanced features that are tremendous. Worthy of note, is the user friendly interface, the audio code generator and the automatic control.
For the sake of the development of a prototype, five (5) loads were used; however, the numbers of loads that can be controlled by this circuit are limitless. It just depends on the creativity of the designer.
The whole system is assembled on a Vero-board; however, if commercial quantity is to be achieved, a PCB board can be used instead. Also, the whole system was assembled with the aim of the demonstration of the workability of the technology. However, in real life deployment, the electrical and electronic wiring of the establishment that it needs to be installed, has to be readjusted.