Home Automation And Security System Via PSTN Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

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.


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 (PSTN) 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 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.

system model

The system consists of four parts. The first part is the call handling through PSTN. The second part consists of DTMF 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.

Micro-controller Based Circuitry

DTMF Decoder

Public Switched Telephone Network


Ring Detection Circuit

Call Pick-Up Circuit

Output Devices

GSM Modem for Status of Devices

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 5Vdc. 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 0.1µF 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 Ω€  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 mA of current to be drawn from the user in order for the incoming call to be connected [7]. To acquire this, the impedance of the telephone line should be

_________ (1)

To set the output continuously, high timing is required which is achieved by 555 timer. The astable mode of 555 timer is used for infinite 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 defines 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 't1' is given by [8]

_______________ (2)

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)

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)

Therefore, the frequency (F) is given by the reciprocal of the total time period [8]

______________ (5)

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)

The duty cycle should always be less than 50% or the off-time (t2) is always less than the on-time (t1) [8]. Thus the output of the 555 astable circuit is asymmetric [8]. By making large compared to, 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 time of charging or discharging can be determined by using equation (7).

___________ (7)

DTMF Decoder Circuit

For Dual Tone Multiple Frequency (DTMF) decoder, the 1MΩ resistor is used with 3.58MHz oscillator as a clock source for the DTMF IC. The output available from the telephone line is to be -37dBm, but the range of DTMF decoder is between -35dBm and -2dBm. Therefore the signal coming from the phone line was amplified before sending to the decoder. The 60Hz power spike is available when the phone rang. When the microcontroller was turned ON, the microcontroller starts operation in a loop waiting for 'Ring Detect Input' to go as 'High'. As soon it gets 1, the code starts counting in a loop waits for 'Ring Detect' to get 'High' again. The checking loop in the above algorithm makes sure that the incoming call should not be disconnected prematurely. If 'Ring Detect Signal' failed to go 'High' for the next 28 seconds, the above code realized that the caller has terminated the call before being connected thus re-initializes the system.

Given that 'Ring Detect Signal' sent two 'High' signals to the microcontroller which is connected to the reed relay. Both wires of telephone line connect with the load of 2.2kΩ to connect the telephoen call with the circuit. This is done when the input of reed relay turns 'High'. When the call is connected, the code is entered in a loop to wait. Here the micro-controller waits 'Data Valid' pin to go 'High'.

If the output of DTMF Decoder is 'High' then the microcontroller stores the DTMF values to the memory of RAM. Each DTMF value is saved in a four bit long data. The above function allows the user to enter four digit user access code for four times. Until the output pin keeps 'LOW', for next 10 seconds after the call was initiated, the call was terminated and the system is re-initialize again. When the user has entered the four digit DTMF code successfully within the allocated time, the code again jumps into an algorithm that compared the temporary data. That temporary data is the input code entered by the user to the pre programmed data arrays that contains the correct user access code. By checking the code 4 times, the call terminates if the user does not enter the correct code and the automation system is reinitialized.

Micro-Controller Based Controlling Circuit

The main purpose of the microcontroller is to control the complete system and also manages the main operation of commands for controlling the components of circuit for proper functioning. Each circuit component was connected to the controller for proper triggering and signal transmissions.

Here, the main task of micro-controller is to receive the decoded DTMF code from DTMF Decoder and control the devices though relays according to user choice. The serial port of the micro-controller is also interfaced with the GSM modem for sending current status of devices.

GSM Modem for Device Status

The GSM Modem is responsible for remote monitoring of the devices connected with the system. When the user enters the specific DTMF code with the particular mobile phone number, the micro-controller sends the current status of the devices to that particular number using GSM modem by SMS. The communication is done using AT command set. Only authorize users can monitor the status of the devices.

Working of the system

The system starts when the incoming call is picked up automatically. Only authorized users can access the system by entering the correct pre-defined pin code. After entering into the system, the user can get the access to control the status of devices through the functioning keypad of the phone from which he is calling from. As the call is picked up by the electronic circuitry, the user enters the pin code which is verified by the micro-controller. If the user is authorized, he can control the status of devices connected with the micro-controller.

The DTMF decoder IC is also used to decode the DTMF tone from the user. When any digit is pressed by the user, it will be converted into binary code and then the code is given to micro-controller. Every connected device has a pre defined code that will work properly which also affects its status. To reinitialize the system the telephone must be hanged up and it will not effect the changes made during the call.

The remote user can also monitor the status of the devices using any GSM mobile phone by sending SMS message. For this purpose, the GSM modem is also interfaced with the micro-controller, which when receives SMS from authorized user, will reply the current status of the devices.

Once the system is powered ON, the micro-controller waits in a loop for 'Ring Detect' pin to turn "High". As soon as it sets, the execution code is entered in a counting loop waiting for 'Ring Detect' to equal to one again. The algorithm gives a checking loop to confirm that the incoming call is not disconnected too early. If 'Ring Detect Signal' failed to go 'High' for the next 28 seconds, the above code realized that the caller has terminated the call before being connected thus re-initializes the system

If the authorized user enters the correct series of numbers then he can access to the main menu of commands. The DTMF commands for controlling the device status is shown in table 1.

Examples of commands for controlling devices

















conclusion and future work

The goal of this work is to design a home automation embedded system which can be controlled using any PSTN network throughout the country. All controlling is done using microcontroller which is programmed accordingly.

As security has its own importance in every aspect, so the system counters the entire basic requirement for security and can be implemented easily where ever wanted. The system can also be implemented in banks for security purposes at an affordable price. Besides security this system also provides controlling of different parameters such as lights, air conditioner ON and OFF and can be enhanced easily.

The system is already low cost and effective and with a few more changes it can be made a little more advanced making it web enabled for future enhancement. It can be enhanced by Implementation of Wi-Fi Technology, Bank Automation through Mobile phones or PLMN (Public Land Mobile Network) furthermore the system can be built using field programmable gate array (FPGA) instead of micro controller so that the system can be reprogrammed easily.