2010 2nd International Conference on Education Technology and Computer (ICETC)
Home Automation And Security System via PSTN Faizan Farid,Muhammad Rehan,Faiza Faizan, M Tahir Qadri Department of Electronic Engineering, Sir Syed University of Engineering & Technology, Karachi, Pakistan. Email:
[email protected]@
[email protected]@hotmail.com
Abstract- The objective here is to develop a home automation and security system which can be controlled and monitored remotely using any telephone line. The user can enter into the system by entering the valid pin code. After entering into the system, the user can control the status of devices connected with the system using any Public Switched Telephone Network (PSTN). The system can also be implemented for security purposes in banks or at home. If the user is at outstation, he can change the status of the lights remotely for security reasons. The heart of the system is a PIC micro-controller (PIC18F4520) which controls the complete working of the system. The GSM modem
is
also
interfaced
with the
micro-controller.
The
remote user can also monitor the current status of the devices by sending SMS message to the GSM modem. The system can be
controlled
and
monitored
from
anywhere
by
using
telephone line. Keywords: Home Automation, telephone security, controling by telephone, Bank Automation.
I.
INTRODUCTION
A domestic telecommunications network is usually accessed by telephones, private branch exchanges and data arrangements [1]. Completion of the circuit between the call originator and call receiver in a Public Switched Telephone Network (PS1N) requires network signaling in the form of dial pulses or multi frequency tones [2]. The PSTN is composed of telephone exchanges networked together to form a nationwide or worldwide telephone communications system [2]. It is public because the system is available to anyone who can afford the service [2]. All calls are switched, that is, a caller's conversation is broken into pieces and these pieces are sent simultaneously over many connections to reach a receiver at the other end [2]. The individual pieces are 'switched' from one telephone device to another until they reach their final destination at the receiving end [2]. All phones in the PSTN are networked in that any phone can make a call to any other phone because all the local phone systems around the country are connected to each other [2]. Connecting communications systems together is called networking [2]. Thus, all phone systems in the country are part of a nationwide network [2]. Home automation offers time-saving opportunities that can make your life more organized, more efficient, safer and more fun [3]. Every room of the home probably offers plenty of possibilities for home automation [3]. Home automation systems are available for every income level and lifestyle [4]. The early developments of these systems took place in early 70's. It has been an important industry with few companies willing to spend technological know-how on this issue. As 978-1-4244-6370-11$26.00 © 2010 IEEE
the information and communication technologies including computers, software and the network are rapidly developed, the computer related activities are getting more generalized even at home [5]. The idea was extracted to help persons to automate their home at very low costs from any location just by using telephone line. The main feature of this system is to control the status of home appliances using PSTN. Only authorized users can enter the system and they can change the status of the devices. Every authorized user has got his own pin code to enter into the system. The code is verified by the micro controller. First the call is picked up by the circuit and then it is connected with the system. If the user presses any key form calling telephone, the Dual Tone Multiple Frequency (DTMF) code is decoded by the DTMF decoder IC and then it passes to the micro-controller which further processes the data and controls the devices according to that user instructions. In this work, four devices were controlled. We controlled lights of home, so that we may make the lights on or of from any remote location. Similarly home air-cooling system can be turned on or off. The other two part of our system is based on security of home. Doors and safety lockers of home can be locked while the user may be at any distance from the installed system. Smoke detecting is a very important function of this work. As the work consists of two way communication, the system will detect any sort of smoke in the house and if the system is activated call will be rung to the number at remote location i.e. to that number which is stored in the system. By using the system, the user gets aware that something is happening in his home. This home automation and security system is controlled by equipment installed at a customer premises. By programming an in-home device, a user controls the operation of appliances connected to the system. For example, a user can program an in-home device to turn on a light at a specific time. The in-home device can also monitor sensors located throughout the home and can sound an alarm or phone a monitoring agency when the sensors are triggered. The system also offers a remote-access feature allowing a user to access the in-home device through the public switched telephone system. The rest of the paper is organized as follows: section 2 will present the system model. Section 3 will present the working of the system and finally section 4 will end the paper with conclusion and future works. II.
SYSTEM MODEL
The system consists of four parts. The first part is the call handling through PSTN. The second part consists of DTMF
VI-52
20i 0 2nd international Conference on Education Technology and Computer (ICETC)
decoder circuit used to decode the DTMF tone, the third part is the micro-controller based system used to control the devices according to the DTMF tone and the fourth part consists of GSM modem interfaced with the micro-controller used to check the current status of the devices remotely. The overall system model is shown in figure 1. Public Switched Telephone Network
(PSTN)
Ring Detection Circuit
Call Pick-Up Circuit
DTMF Decoder
Micro-controller Based Circuitry
t
t for Status of Devices
Figure I.
A.
50
* .J2vPP (1) 680 Q 30mA To set the output continuously, high timing is required which is achieved by 555 timer. The astable mode of 555 timer is used for infmite timing sequence. This astable mode requires a capacitor and two resistors to set the frequency of oscillation. At the trigger and threshold inputs, the voltage of the external capacitor is measured. Using this voltage reading an internal RS flip flop of 555 timer is set or reset. This voltage reading creates the charge or discharge cycle of the circuit. The capacitor voltage rises to two-third of Vcc while charging and drops to one-third of the Vcc during discharging. When the charging of capacitor reaches to two third of Vcc then the threshold input switches off the internal flip flop and at discharging it turns in ON. The voltage at output is a digital signal because it is a buffered copy of the flip flop output. Finally, the resulting waveform defmes the oscillator signal of 555 timer. The oscillation frequency is dependent of the capacitor and resistor network i.e. RA, RB, and Capacitor C and it does not dependent on the power supply voltage Vcc. The external capacitor C uses resistors RA and RB to charge or discharge. The charging time 'tI' is given by [8] (2) tl 0.695 (RA + RB)C The charging of capacitor gives high signal at the output. When discharging, the external capacitor (C) uses the resistor RB to discharge. The discharging time 't2' is given by [8] (3) 12 0.695 RBC During this period of discharging, the output gives low level of the signal. Hence, the total time for one complete oscillation (T) is given by adding these two times [8] (4) T tl + t2 0.695 (RA + 2RB)C Therefore, the frequency (F) is given by the reciprocal of the total time period [8] (5) F 1 . 44 /(RA + 2RB)C =
-------
=
GSM Modem Output Devices
call to be connected [7]. To acquire this, the impedance of the telephone line should be
=
Overall Block Diagram of the System.
Ring detection and Pick up circuit
=
The ring detection circuit is used to detect the phone ring. It transforms the 20Hz, 90Vp-p ring signal into a 5V dc. The RC network is used to limit the current during the incoming phone call. It also turns ON the infra red LED. The protection diode is also used to protect the LED from high reverse voltages during the negative half of the cycle. If the infra-red light from LED strikes the photodiode, a small current is produced. The power transistor MJE340 is used to amplify the current and also used to saturate the other transistor. The external MPSA42 transistor will be the last phase of strengthening the signal which is used to pull the 'Ring Detect Out' to 'HIGH'. The O.lJ.lF capacitor is also used to filter the ac pulses from the output. The above circuit gives 'HIGH' when the telephone bell rings but it did not produce enough current to pick up the call. For call pick up circuit the 680 (2 resistor is used and its value is calculated using Ohm's Law. When the phone rings, there are 85 Vrms voltages across the telephone line [6]. The phone company needs 30 rnA of current to be drawn from the user in order for the incoming
=
=
Depending upon the use the oscillation period ranges from microseconds to hours. This can be selected with the appropriate choices of resistors and capacitor. The duty cycle (DC) is the ratio of the time the output is low as compared to the period [8] (6) RB /(RA + 2RB) DutyCycle The duty cycle should always be less than 50% or the off-time (t2) is always less than the on-time (tl) [8]. Thus the output of the 555 astable circuit is asymmetric [8]. By making RB large compared to RA the waveform becomes more symmetric and the 555 output approaches a square wave [8]. The timing of the 555 timer depends upon the sequential discharging and charging of the output capacitor. The two internal operational amplifiers in 555 timer are used as to set the lower voltage limit to one-third of Vcc and upper limit to two-third of Vcc. The capacitor voltage at any
VI-53
=
'
2010 2nd International Conference on Education Technology and Computer (ICETC)
time of charging or discharging can be determined by using equation (7). (7) V(t) V(O)*e