Design of a Mobile Phone Controlled Door: A Microcontroller based Approach

This paper presents a microcontroller based approach of a mobile phone and keypad controlled door. The door can be remotely controlled either by receiving set of instructions through the mobile phone or the keypad acting as the transmitter. The design consists of four main functional modules, which include: the mobile communication, controlling, decoding and the switching module. The decoding module and controlling module are made using integrated circuit chips ensuring proper conversion of signal to binary codes, which enables the microcontroller to effectively communicate with the switching device handling opening and closing of the door. The mobile communication module act as the transceiver unit which employs the use of a mobile phone serving as the communication device between the user at one end and the door at the other end. The decoding module and the controlling module are made possible using modern integrated circuit chips ensuring proper conversion of signal to binary codes, enabling the microcontroller to communicate properly with the switching device responsible for opening and closing the door. Only the right code can open the door, in case of sending wrong codes over three consecutive times, the password will have to be reset, because the system has sensed an intruder attempts.


Introduction
Mobile communication system is an essential entity which provides the ability to disseminate information to a far distance, though depending on the coverage area and capacity of the network [1]. Based on these features that mobile communication provides, it has been of great advantage in business, security, banks, companies, institutions etc., [2]. Nowadays, Security has been a prime concern in the home and office management. Digital door lock security system provides security and safety to house or office owners, belongings, assets from being damaged by external agent or unwanted strangers. The mobile phone controlled door lock security system is an access control system that allows only authorized persons to access restricted area.
Ushie JO constructed a prototype security door that can be remotely controlled by a GSM phone set acting as the transmitter and another GSM phone set with dual tone multi-frequency (DTMF) connected to the door motor through a DTMF decoder interfaced with microcontroller unit and a stepper motor [3]. There was no provision for keypad assess in case the GSM signal fluctuates or fail which is a limitation.
Prince NN developed a security door system that can either receive command through the mobile phone or through the computer system (configured to output data through the parallel port) [4]. The use of keypad interfaced with the system is cheaper, easily assessable and affordable especially in developing areas and also easier to maintain than computer system interfaced.
Mohammad A developed a Microcontroller Based Reprogrammable Digital Door Lock Security System by Using Keypad and GSM [5]. He explained the idea of using a microcontroller and GSM to open a door, he used the GSM to send message to the device thereby opening the door. He explained further that Tones generated from DTMF keypad can identify what unit to be controlled as well as unique function to be performed. The system can be improved on by making it user friendly and easy control and accessible.
The proposed approach for designing this system is to implement a microcontroller-based control module that receives its instructions and command from a Mobile phone over the mobile network. The microcontroller then will carry out the issued commands.
The main purpose of this system is to lock and unlock a door by a mobile phone and matrix keypad, using a unique code entered through the matrix keypad and mobile phone. Opening and closing of doors involves human to be physically involved in the task. The authorized person can message the mobile phone stacked to the system which in turn is connected to the door motor that can open/close the door by entering the correct password. This method is very convenient as one doesn't have to get down of his door post to open the door physically. The cell phone is set to understand the message been sent to it. So, after the message have been send to the cell phone it sense it weather the code is from the desired number and whether the code is correct. The system will control the door through Short Message Service (SMS) effectively, receiving and transmitting data via SMS, this will eliminate the need of being physically present in any location for tasks involving the opening of door within a household and is power reliable because the power source is backed up with battery in case of mains failure.

Abstract
This paper presents a microcontroller based approach of a mobile phone and keypad controlled door. The door can be remotely controlled either by receiving set of instructions through the mobile phone or the keypad acting as the transmitter. The design consists of four main functional modules, which include: the mobile communication, controlling, decoding and the switching module. The decoding module and controlling module are made using integrated circuit chips ensuring proper conversion of signal to binary codes, which enables the microcontroller to effectively communicate with the switching device handling opening and closing of the door. The mobile communication module act as the transceiver unit which employs the use of a mobile phone serving as the communication device between the user at one end and the door at the other end. The decoding module and the controlling module are made possible using modern integrated circuit chips ensuring proper conversion of signal to binary codes, enabling the microcontroller to communicate properly with the switching device responsible for opening and closing the door. Only the right code can open the door, in case of sending wrong codes over three consecutive times, the password will have to be reset, because the system has sensed an intruder attempts. This work is based on the concept of DTMF technology. All numeric buttons on the keypad of a mobile phone generates a unique frequency when pressed. These frequencies are decoded by the DTMF Decoder IC at the receiving end which is fed to the microcontroller. If this decoded values i.e., code pressed by user matches with the password stored in the microcontroller, then the microcontroller initiates a mechanism to open the door through a motor driver interface. The Paper is divided into different sections: section 1.2 described the system Architecture, while section 1.3 gives the system flow chat, sections 1.4 described the system hardware and software, Test and Results were carried out in section 1.5 and the conclusion drawn was presented in section 1.6 It can work on a varied range of frequency from 31 kHz to 48 kHz. PIC18F4550 has four in-built timers. There are various inbuilt peripherals like ADC (Analogue to Digital converter), comparators etc. in this controller. PIC18F4550 is an advance microcontroller which is equipped with enhanced communication protocol like EUSART, SPI and USB etc. [6,7].

System architecture
Line buffer is a data structure that holds a fixed amount of data in serial fashion; the oldest data get discarded as new data is added. In this system, the line buffer helps the mobile phone to discard a command when a new command is given to the phone.
Buffers are used for many purposes, which include: Interconnecting two digital circuits operating at different rates, holding data for later use, allowing timing corrections to be made on a datastream, collecting binary data bits into groups that can then be operated upon as a unit and delaying the transit time of a signal in order to allow other operations to occur.
The relay used is a latching relay. A latching relay is a two-position electrically-actuated switch. It is controlled by two momentary-acting switches or sensors, one that 'sets' the relay and the other 'resets' the relay. The latching relay maintains its position after the actuating switch has been released, so it performs a basic memory function. These relay driver communicate with the IC on how to operate in this circuit.
The D.C 12 V relay operates as a switch in the circuit which open or close, according to the need of the needs and its operation. The relay control the solenoid switch which serve as a controlling device for the door latch, it help the door latch to open and close.
12-button key-pad is control by the IC, the 12 button key-pad is 0-9, it also includes cancel and enter button. The LED used in this circuit has two colours which have green and red. The red light shows the system is active and the correct code as not been enter while the green light shows the system is active and the correct code has been entered.
LCD (Liquid Cristal Display) displays the code that is entered through the 12 button key-pad and also displays when the code is correct or wrong. As the button is pressed, the beeper will beep when any wrong code is entered. Figure 2 showed the system flowchart which starts with the initializing the entire variable from 0-9 including other button on the keypad, when all the variables have being initialized, the system will refresh. If enter button is pressed and there is no password or code that is been pressed, then the cancel button will be pressed thereby clearing the display and clear keypad buffer; if cancel button is not pressed then digit 0-9 will be pressed thereby storing the digit in keypad buffer.

System flowchart
If no button is pressed before the latch is closed, the correct code or password is entered and the latch will open then if the wrong code or password is entered the LCD will display a wrong password after this, the system will refresh.
The second part is using the phone to control the system. Is there any message in the SMS Buffer, if NO, the system will refresh. If YES and SMS having a right password then the CMD will open thereby opening the latch and clearing SMS Buffer and refresh. Is there any message in SMS Buffer?, if NO the system will refresh and if YES and having the right password then CMD will close thereby closing the latch and clearing SMS Buffer and Refresh.

Design of system hardware and software
The system circuit design is shown in Figure 3 the frequency of the microcontroller is regulated by 20MHz crystal capacitor. The 4550 control the LCD which displays the instruction been sent to the IC. The indicator is a double colour LED, Red and Green, when Red is turn on the power is ON and the system is active; when Green light is turn ON the correct password has been entered. The 74HC14 is a Schmitt trigger. In this circuit, it helps in reducing the power that is being supply to the phone to the require voltage through the FBUS-TX.  The beeper is driven by 2N2222 transistor and is connected to pin 17 of the IC. The relay is driven by 2N2222 transistor.

DC POWER SUPPLY
In designing the +5 V and +12 V DC power supply required for the microcontroller and the associated relay control circuits, LM317 adjustable regulators were used. The regulator output voltage is determined by two resistors R1 and R2 which are connected to form a potential divider. This potential dividing network determines the output voltage of the regulator. In operation, the LM317 develops a nominal 1.25 V reference voltage, V REF , between the output and adjustment terminal. The reference voltage is developed across resistor R 1 and since the voltage is constant, a constant current I 1 then flow through the output set resistor R 2 , giving an output voltage of I ADJ is the current from the adjustment terminal. It represents an error term; the LM317 has been designed to minimize I ADJ and make it very constant with line and load changes; and it has a constant value of about 100 µA. The current set resistor, R 1 connected between the adjustment terminal and the output terminal is usually 220 Ω.
Using the formula in equation in 1 above:   software development and hardware assembly, and therefore, take the position that the work has delivered and perform efficiently the task it is meant to perform.

Conclusion
The aim and objective of the work has been achieved since the mobile phone was able to transmit information to the control unit, the controller accepts the information transferred and process them by prompting for access code (password) when the code has been entered through the input with the help of keypad, the controller is capable of interpreting the information supplied and process it without problems. The processing will allow access if the information supplied is correct and deny access if the information supplied is not correct. The system operation is user friendly. It is palpable that this system will guide against access to an unauthorized person who will improve safety and security.
Since the closest resistor is 1800 Ω, 1800 Ω is selected for R2.
The development of this work is made up with software and hardware components. The software program of this design is written with assembly language. The core programming language of this work is written using C18 format [8]. The hardware is comprised of the input unit, the power supply unit, the control unit and the display unit. The input unit have card slot where cards are inserted for access purpose and it is connected to the control unit through port zero of the microcontroller. The sensor u nit (Keypad) i s made o f m icro switches, which transmits information of the control unit through port two of the microcontroller especially when each of them is pressed or punched. The display unit are made with Liquid Crystal Display (LCD) arranged in a serial manner to each other and are connected to the control unit through the line port one. The control unit is made up of microcontroller which can be called the heart of the design as it accepts from the sensor unit and the input unit through the line port one to the display unit. Some of these connections are done using soldering techniques to solder major components to Vero-board while other necessary connections are completed using jumper wires.

Tests and Result
Monitored tests were carried-out on the devices of this work to determine the level of its performance, reliability and efficiency. In the power supply Unit (PSU), test was conducted with the use of a digital multi-meter to determine the output voltage of the power supply. The o utput t erminal r esult s hows t he a ppropriate v alue a nd figure. In the sensor unit, we made confirmations so that the micro switches used could deliver right and notable information when the buttons are pressed. Also, from the control unit, we carried-out testing to confirm the output is delivered in accordance with the input fed. This test is considered the most important part of the design because of its integration with other units in the design. We tested the input section using multi-meter and logic probe to ensure that mistakes were not made in data transfer.
After all these tests the results validates the functionality of the system, we were convinced that the work was indeed successful in