45745368 final home automation project

Upload: piyushji125

Post on 14-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 45745368 Final Home Automation Project

    1/35

    DTMF Tele switch

  • 7/30/2019 45745368 Final Home Automation Project

    2/35

    CONTENTS

    Sl No. Contents Page No

    1. Cover Page 2

    2. Certificate 3

    3. Acknowledgement 4

    4. Contents 5

    5. Abstract 6

    6. Introduction 7

    7. Block Diagram 8

    8. Circuit Diagram

    9. Components Description

    10. Circuit Description

    12. Results & Conclusion

    13. Future Scope

    14 Reference

    APPENDIX

    Data sheets

  • 7/30/2019 45745368 Final Home Automation Project

    3/35

    ABSTRACT

    Traditionally electrical appliances in a home are controlled via switches thatregulate the electricity to these devices. As the world gets more and moretechnologically advanced, we find new technology coming in deeper and deeper

    into our personal lives even at home. Home automation is becoming more andmore popular around the world and is becoming a common practice. The processof home automation works by making everything in the house automaticallycontrolled using technology to control and do the jobs that we would normally domanually. Home automation takes care of a lot of different activities in the house.

    this project we propose a unique System for Home automation utilizing

    Dual Tone Multi Frequency (DTMF) that is paired with a wireless module to provideseamless wireless control over many devices in a house. The block diagram is a

    shown below. This user console has many keys , each corresponding to thedevice that needs to be activated. The encoder encodes the user choice and sendsvia a FM transmitter. The FM receiver receives the modulated signal and

    demodulates it and the user choice is determined by the DTMF decoder. Basedupon this the required appliance is triggered.

  • 7/30/2019 45745368 Final Home Automation Project

    4/35

    INTRODUCTION

    The aim of the proposed system is to develop a cost effective solution that willprovide controlling of home appliances remotely and enable home security againstintrusion in the absence of homeowner. The system provides availability due to

    development of a low cost system. The home appliances control system with anaffordable cost was thought to be built that should be mobile providing remoteaccess to the appliances and allowing home security. Though devices connected as

    home and office appliances consume electrical power. These devices should becontrolled as well as turn on/off if required. Most of the times it was done

    manually. Now it is a necessity to control devices more effectively and efficientlyat any time from anywhere.In this system, we are going to develop a cellular phone based home/office

    appliance. This system is designed for controlling arbitrary devices, it includes acell phone (not included with the system kit, end user has to connect his/her cellphone to the system) which is connect to the system via head set. To active the

    cellular phone unit on the system a call is to be made and as the call is answered,in response the user would enter a two/three digit password to access the system

    to control devices. As the caller press the specific password, it results in turningON or OFF specific device. The device switching is achieved by Relays. Security

    preserved because these dedicated passwords owned and known by selectedpersons only. For instance, our system contains an alarm unit giving the user aremote on/off mechanism, which is capable of informing up to five differentnumbers over telephony network about the nature of the event.The underlying principle mainly relies up on the ability of DTMF (Double Tune MultiFrequency) ICs to generate DTMF corresponding to a number or code in thenumber pad and to detect the same number or code from its corresponding DTMF.In detail, a DTMF generator generates two frequencies corresponding to a number

    or code in the number pad which will be transmitted through the communicationnetworks, constituting the transmitter section which is simply equivalent to a

    mobile set. In the receiver part, the DTMF detector IC, for example IC MT 8870detects the number or code represented by DTMF back, through the inspection ofthe twotransmitted frequencies. The DTMF frequencies representing the number/ codesare shown below.

  • 7/30/2019 45745368 Final Home Automation Project

    5/35

    BLOCK DIAGRAM

  • 7/30/2019 45745368 Final Home Automation Project

    6/35

    CIRCUIT DIAGRAM

    Power Supply Circuit:

    Control Circuit:

    D2

    LED

    R1

    330E

    C2

    100uF/16V

    C1

    470uF/25V

    9V I/P

    1

    21

    2U3

    LM7805

    1 3

    2

    IN OUT

    GND

    - +

    D1

    DB106

    1

    2

    3

    4

    C3

    0.1uF

  • 7/30/2019 45745368 Final Home Automation Project

    7/35

    WORKING:

    The working of the circuit is quite simple and easily understandable by jusobserving the circuit. The working can be mainly discussed as three parts which are thesupply part, micro-controller part and the isolation part respectively. All these parts

    together describe the working of the design of Home automation system.

    The supply part/section mainly deals with the supply given to the circuit. Actuallyit can be done in two ways i.e., either by giving 230V AC or by using a battery (9V) assource of supply. Now in this design we are using a 9V battery as source of supply. This9v is regulated to 5V using a voltage regulator as only 5V is required to drive themicrocontroller. This 5V is also given to the receiver. Actual working of this systeminvolves an RC5 remote which is used as Transmitter and TSOP1738 as IR receiver. Andhere we are designed the system for only 6 applications. So only 6 buttons are used in theRC5 remote. Each button is given certain address depending on the number of dutycycles it has for 1ns. When a button is pressed, say 1, the receiver receives the signal

    from the RC5 remote and the next operation is done by the micro-controller part.

    In micro-controller section, there are mainly 2 parts. They are AT89C2051 micro-controller and ULN 2003 driver (Darlington transistor). The microcontroller intakes thereceived signal from the IR receiver (TSOP 1738). The main use of this controller is thatit recognizes and counts the number of duty cycles the received signal has and thenmakes the respective output pin high according to the calculations done by it internally.For example, let us consider that the button 1 has 1500 duty cycles in 1nS. When thisbutton is pressed, the transmitter in the remote sends this signal and the receiver receivesthe signal. The received signal also contains same number of duty cycles but the microcontroller confirms it with the help of the external timers it has. After confirmation, thecontroller makes the first output high. Here both the transmitter and receiver are ofInfrared type. This output is connected to Darlington transistor (ULN 2003) which is usedto drive the application. This gives a much higher current gain and also improves the lifeof the microcontroller. All the six out puts of micro controller are given as input to theDarlington transistor/pair IC which improves the gain of those outputs and gives therespective six outputs. These outputs are connected to the Opto-Isolator which isdiscussed in the isolation part.

    The Isolation part involves the isolation of the AC and DC i.e., the output fromthe controller is DC and the Input to the application required is AC and to makedifference of this nature of supply, an Opto isolator (MOC 3021) is used in betweenthem. The MOC 3021 IC consists of a The input to the isolator is taken from theDarlington transistor IC. The pin1 of this Isolator IC is given to the supply or is in Highstate and the second pin is grounded. The output from the ULN2003 IC is connected tothe second pin of the MOC 3021 IC which is low. The IC internally consists of a LEDand a DIAC. Whenever the led glows, the DIAC gets triggered and hence fires the gate ofthe TRIAC connected to the IC. A feedback resistance is used for this operation.

  • 7/30/2019 45745368 Final Home Automation Project

    8/35

    Let us assume that a bulb is used as application here. One terminal of this bulb is

    connected to the AC supply and the other is connected to the TRIAC. When the TRIACgets fired the bulb glows. This is the working of the Home Automation System using IRsignal.

    COMPONENTS USED:

    1. Rectifier(IN4007 Diodes)

    2. Voltage Regulator

    3. TSOP 1738

    4. Crystal oscillator

    5. Triac bt136

    6. Moc 3021

    7. ULN 2003.

    8. 2051 Uc

    9. RTC

    COMPONENTS DESCRIPTION

    1.Rectifier

    Rectifier circuits are found in all dc power supplies that operate from an ac

    voltage source. They convert the ac input voltage to a pulsating dc voltage. The most

    basic type of rectifier circuit is the half-wave rectifier. Although half-wave rectifiers have

    some applications, the full-wave rectifiers are the most commonly used type in dc power

    supplies. These are two types of full-wave rectifiers:

    (1) full-wave center-tapped rectifier

    (2) full-wave bridge rectifier

    Here in this particular design we are using a bridge rectifier which is discussed as

    follows.

  • 7/30/2019 45745368 Final Home Automation Project

    9/35

    Full-wave Bridge Rectifier

    The full wave bridge rectifier uses four diodes, as shown in below figure. When

    the input cycle is positive, diodes D1 and D2 are forward-biased and conduct current

    through RL. During this time, diodes D3 and D4 are reverse-biased.

    During positive half-cycles of the input, D1 and D2are forward-biased and conduct

    current, D3 and D4 are reverse-biased.

    When the input cycle is negative as shown in below figure, diodes D3 and D4 are

    forward-biased and conduct current in the same direction through RL as during the

    positive half-cycle. During the negative half-cycle, D1 and D2 are reverse-biased. A full-

    wave rectifier output voltage appears across RL as a result of this action.

  • 7/30/2019 45745368 Final Home Automation Project

    10/35

    During negative half-cycles of the input, D3and D4 are forward-biased and conduct

    current, D1 and D2 are reverse-biased.

    The above two figures explain the full-wave Bridge Rectifier.The output graph of a full-wave rectifier is as shown below:

    The diodes used in this rectifier are IN4007 which is discussed below.

    IN4007 Diode

    These diodes are used to convert AC into DC these are used as half wave rectifier or fullwave rectifier. Three points must he kept in mind while using any type of diode.

    1. Maximum forward current capacity2. Maximum reverse voltage capacity3. Maximum forward voltage capacity

    The number and voltage capacity of some of the important diodes available in the market

    are as follows:

    Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and

    IN4007 have maximum reverse bias voltage capacity of 50V and maximumforward current capacity of 1 Amp.

    Diode of same capacities can be used in place of one another. Besides this diodeof more capacity can be used in place of diode of low capacity but diode of lowcapacity cannot be used in place of diode of high capacity. For example, in place

  • 7/30/2019 45745368 Final Home Automation Project

    11/35

    of IN4002; IN4001 or IN4007 can be used but IN4001 or IN4002 cannot be usedin place of IN4007.The diode BY125made by company BEL is equivalent ofdiode from IN4001 to IN4003. BY 126 is equivalent to diodes IN4004 to 4006and BY 127 is equivalent to diode IN4007.

    2.Voltage Regulator

    A voltage regulator is an electrical regulator designed to automatically maintain aconstant voltage level. It may use an electromechanical mechanism, or passive or activeelectronic components. Depending on the design, it may be used to regulate one or moreAC or DC voltages.

    With the exception of passive shunt regulators, all modern electronic voltage regulatorsoperate by comparing the actual output voltage to some internal fixed reference voltage.Any difference is amplified and used to control the regulation element in such a way as toreduce the voltage error. This forms a negative feedback servo control loop; increasingthe open-loop gain tends to increase regulation accuracy but reduce stability (avoidanceof oscillation, or ringing during step changes). There will also be a trade-off betweenstability and the speed of the response to changes. If the output voltage is too low(perhaps due to input voltage reducing or load current increasing), the regulation elementis commanded, up to a point, to produce a higher output voltage - by dropping less of theinput voltage (for linear series regulators and buck switching regulators), or to draw inputcurrent for longer periods (boost-type switching regulators); if the output voltage is toohigh, the regulation element will normally be commanded to produce a lower voltage.However, many regulators have over-current protection, so entirely stop sourcing current(or limit the current in some way) if the output current is too high, and some regulatorsmay also shut down if the input voltage is outside a given range (see also: crowbar

    circuits).The voltage Regulator used in this design is LM 7812.LM78xx Regulator

    The LM78XX series of three terminal regulators is available with several fixedoutput voltages making them useful in a wide range of applications. One of these is localon card regulation, eliminating the distribution problems associated with single pointregulation. The voltages available allow these regulators to be used in logic systems,instrumentation, Hi-Fi, and other solid state electronic equipment.

  • 7/30/2019 45745368 Final Home Automation Project

    12/35

    Although designed primarily as fixed voltage regulators these devices can be used withexternal components to obtain adjustable voltages and currents. The LM78XX series isavailable in an aluminum TO-3 package which will allow over 1.0A load current ifadequate heat sinking is provided. Current limiting is included to limit the peak outputcurrent to a safe value. Safe area protection for the output transistor is provided to limit

    internal power dissipation.If internal power dissipation becomes too high for the heat sinking provided, the thermalshutdown circuit takes over preventing the IC from overheating. Considerable effort wasexpanded to make the LM78XX series of regulators easy to use and minimize the numberof external components. It is not necessary to bypass the output, although this doesimprove transient response. Input bypassing is needed only if the regulator is located farfrom the filter capacitor of the power supply.For output voltage other than 5V, 12V and 15V the LM117 series provides an outputvoltage range from 1.2V to 57V.Features

    - Output current in excess of 1A

    - Internal thermal overload protection- No external components required- Output transistor safe area protection- Internal short circuit current limit- Available in the aluminum TO-3 packageVoltage Range

    LM7805C 5VLM7812C 12VLM7815C 15V

    3. TSOP1738 - Infrared Receiver

    Introduction

    TSOP1738 is an Infrared (IR) receiver which is widely used in large number of electronicproducts for receiving and demodulating infrared signals. The received demodulatedsignals can be easily decoded by a microcontroller. It supports RC5, RC6 code, Sonyformat (SIRCS), NEC code, Sharp code, etc.

    Specifications

    Continuous data transmission possible (up to 2400 bps)

    High immunity against ambient light

    Photo detector and preamplifier in one package

    Improved shielding against electrical field disturbance

    TTL and CMOS compatibility

    Active low output

    Low power consumption

    Internal filter for PCM freq

  • 7/30/2019 45745368 Final Home Automation Project

    13/35

    The datasheet for TSOP1738 is as shown below;

    **DATASHEET**

    Crystal Oscillators

    One of the most important features of an oscillator is its Frequency Stability, or in otherwords its ability to provide a constant frequency output under varying conditions. Someof the factors that affect the frequency stability of an oscillator include: temperature,variations in the load and changes in the power supply. Frequency stability of the outputsignal can be improved by the proper selection of the components used for the resonantfeedback circuit including the amplifier but there is a limit to the stability that can beobtained from normal LC and RC tank circuits. For very high stability a quartz crystal isgenerally used as the frequency determining device to produce other types of oscillatorcircuit known generally as Crystal Oscillators.

    When a voltage source is applied to a small thin piece of crystal quartz, it begins tochange shape producing a characteristic known as the Piezo-electric Effect. This piezo-electric effect is the property of a crystal by which an electrical charge produces amechanical force by changing the shape of the crystal and vice versa, a mechanical forceapplied to the crystal produces an electrical charge. Then, piezo-electric devices can beclassed as transducers as they convert energy of one kind into energy of another. Thispiezo-electric effect produces mechanical vibrations or oscillations which are used toreplace the LC tank circuit and can be seen in many different types of crystal substanceswith the most important of these for electronic circuits being the quartz minerals becauseof their greater mechanical strength.

    The quartz crystal used in Crystal Oscillators is a very small, thin piece or wafer of cutquartz with the two parallel surfaces metalized to make the electrical connections. Thephysical size and thickness of a piece of quartz crystal is tightly controlled since it affectsthe final frequency of oscillations and is called the crystals "characteristic frequency".Then once cut and shaped the crystal can not be used at any other frequency. The crystalscharacteristic or resonant frequency is inversely proportional to its physical thicknessbetween the two metalized surfaces. A mechanically vibrating crystal can be represented

  • 7/30/2019 45745368 Final Home Automation Project

    14/35

    by an equivalent electrical circuit consisting of low Resistance, large Inductance andsmall Capacitance as shown below.

    Quartz Crystal

    A quartz crystal has a resonant frequency similar to that of a electrically tuned tankcircuit but with a much higher Q factor due to its low resistance, with typical frequenciesranging from 4kHz to 10MHz. The cut of the crystal also determines how it will behaveas some crystals will vibrate at more than one frequency. Also, if the crystal is not of aparallel or uniform thickness it have two or more resonant frequencies having both afundamental frequency and harmonics such as second or third harmonics. However,usually the fundamental frequency is more stronger or pronounced than the others andthis is the one used. The equivalent circuit above has three reactive components and thereare two resonant frequencies, the lowest is a series type frequency and the highest a

    parallel type resonant frequency.

    We have seen in the previous tutorials, that an amplifier circuit will oscillate if it has aloop gain greater or equal to 1 and it has positive feedback. In a Crystal Oscillatorcircuit the oscillator will oscillate at the crystals fundamental series resonant frequency asthe crystal always wants to oscillate when a voltage source is applied to it. However, it isalso possible to "tune" a crystal oscillator to any even harmonic of the fundamentalfrequency, (2nd, 4th, 8th etc.) and these are known generally as Harmonic Oscillatorswhile Overtone Oscillators vibrate at odd multiples of the fundamental frequency, 3rd,5th, 11th etc). Generally, crystal oscillators that operate at overtone frequencies do sousing their series resonant frequency.

    **DATASHEET**

    4. TRIAC

    INTRODUCTION

    Approvals in their outer aspect, SCR and TRIAC are resembled like many water drops.To distinguish them, therefore, is impossible, if it is not rerun to the exact

  • 7/30/2019 45745368 Final Home Automation Project

    15/35

    acknowledgment of the acronym and to the ritrovamento of this on a common prontuario.But the acronyms, today attributed to these semiconductors, are many, too many forbeing collections all in a handbook modernized to the capacity of the amateurs. Which,often, during their activity, are found in embarrassment, because, ignoring thecharacteristic electrical workers, they cannot lead those tests that serve to identify the

    components and to know their state of efficiency. Here because the idea is risen us toconceive a simple circuit, of immediate realization, absolutely economic, to entrust ourhobbyist readers, with which they can distinguish, with a sure rapidity, a SCR from aTRIAC, estimating some, at the same time, the behavior electrical worker, is worth to saythe validity works them. But since the principle of operation of the device is based on theuse, from part of the SCR, of average cycle of the alternated voltage, while the TRIACworks with the entire cycle of the same voltage, alla presentation of the apparatus mustmake to precede those theoretical slight knowledge that regulates the way to behave itselfof these particular diode , that by now all know and whose employment is often from weprescribed for the construction of the many plans that, month for month, come publishesto you on this periodical.

    SCR: STRUCTURES and SYMBOLS

    Known also under the name of controlled diode, the SCR inner is composed from threeP-N splices, that they form a semiconductor of P-N-P-N type, similar to two normaldiode connects to you in series. They finishes relative to the anode makes head moreexternal the P semiconductor, while the cathode remains connected with the Nsemiconductor situated in the opposite part. A1 according to field of P material isconnected the representative electrode of the gate ones, said also "door". The symbolelectrical worker, that it characterizes diode SCR, is that one represented in figure 1,

    while the outer aspect more common than this semiconductor it can be identified withone of the graphical expressions brought back in figure 2.

    DIODE

    Fig. 1 - Symbol electrical worker of diode SCR, famous also with the denomination ofcontrolled diode. With the G letter it comes indicated the electrode of gate, or door,through which it comes applied to the component the voltage impulse that of it provokesthe conduction (primes). With the letter To the electrode of anode is marked and with theK that one of cathode.

  • 7/30/2019 45745368 Final Home Automation Project

    16/35

    Fig. 2 - These are the two types of diode SCR (silicon-controlled-rectifier) morecommonly findable in commerce and mainly it uses you from the amateurs.

    Operation of the SCR

    Applying to the anode of the SCR a negative voltage regarding the cathode, someconduction is not obtained electrical worker, therefore as it happens in a commonsemiconductor diode . The SCR can therefore be assimilated to an open switch. Inverting

    the polarity of the voltage, the SCR contrarily remains still blocked to how much happensin a normal diode , in which conduction would be had electrical worker; but the blockremains until does not arrive on gate a positive impulse regarding the cathode, of suchamplitude to put the diode controlled in complete conduction. And this commutationhappens in a extremely short time, of the order of 0,5 us. As it can immediately bededuced, this time is the much short one than that one demanded from the analogouselectromechanical systems. Once primed, the SCR remains conductor without need ofsome voltage of commando on the gate. conserving this condition also when on the gateones they come applies new impulses to you of commando. For turning off the SCR, thatis in order to bring back it to the state of interdiction, two exist arrange: the voltagebetween anode can be reduced to zero and cathode, or the anode regarding the cathodecan be made to become negative. In this case the alternated voltage is revealed muchuseful, because it passes for the zero when it inverts the own polarity to every semiperiod. In figure 5 light bulb to filament in alternating current is introduced the exampleof a according to electronic interrupting SCR in a circuit of feeding of one. We see of ithour the behavior theoretical.

    Fig. 5 - Theoretical circuit of application of a according to interrupting diode SCR,

    closed or open, of ignition of lamp LP.

    In absence of it marks them on the gate ones, the SCR is behaved like a opened switch,that is it does not lead current and lamp LP remains extinguished. But when an impulse

  • 7/30/2019 45745368 Final Home Automation Project

    17/35

    of voltage to every half-cycle of the alternated voltage is applied, the switch closes itselfand lamp LP is ignited. Not however in the full load of its brightness, because the SCR isbehaved like a normal diode in series to the circuit, that it straightens the alternatedvoltage. In practical, the ignition of the lamp is reduced to 50%. In figure 6 the newcondition is illustrated electrical worker of the circuit of figure 5, in which I SCR

    transforms in a diode rectifier of the alternated voltage.

    Fig. 6 - The diode SCR, connected in series with a conductor covered from

    alternating current, is behaved like a rectifying element, leaving via free the passage

    of the sun positive semi-waves.

    OPERATION OF THE TRIAC

    In figure 7 the theoretical application of a TRIAC, analogous is brought back to that one

    of the SCR of figure 5.

    Fig. 7 - Example of employment of a TRIAC, as electronic switch, in a circuit ofignition of one lamp fed in alternating current (C.A).

    In absence of tension impulse that in this case, with the exception of how much ithappens in the SCR can be is positive that negative, the TRIAC does not lead, that is isbehaved as an open switch and lamp LP remains extinguished. Applying instead onesmall tension, positive or negative, on the gate ones, the TRIAC becomes conductor andis equivalent to a closed switch. But this time the semiconductor lets to cross from boththe semi waves of the alternated tension, as it indicates the design of figure 8.

    Fig. 8 - Since in the TRIAC two diode are contained connect to you in ant parallel,

    all the semi waves, those positive ones and those negatives of the alternating current

    cross the semiconductor.

    And that because the inner structure of the TRIAC is correspondent to that one of twodiode SCR connects to you in parallel, with the polarity opposite. in ant parallel. but with

  • 7/30/2019 45745368 Final Home Automation Project

    18/35

    the electrode of I prime in common.We have said that the TRIAC can be primed applying a tension impulse on its gate ones.But this auto innesca component when the value of the tension alternated applied on thetwo anodes exceeds a sure limit, called tension of breakdown. Making then to diminishthe current and to increase the cargo resistance of the TRIAC, a point is caught up in

    which the current it is not more in a position to maintaining in conduction thesemiconductor.The minimal value of the current that can maintain primed the TRIAC comes commonlyindicated like current of Hold, that is maintenance current.

    **DATASHEET**

    Opto-isolator

    An opto-isolator integrated circuit. The "MB 111", manufactured by RFT ("Rundfunk-

    und Fernmelde-Technik"), contains an infrared LED and silicon photodiode with anintegrated amplifier stage.This article is about the electronic component. For the optical component, see opticalisolator.

    In electronics, an opto-isolator (or optical isolator, optical coupling device, optcoupler, photo coupler, orphotoMOS) is a device that uses a short optical transmissionpath to transfer an electronic signal between elements of a circuit, typically a transmitterand a receiver, while keeping them electrically isolatedsince the electrical signal isconverted to a light beam, transferred, then converted back to an electrical signal, there isno need for electrical connection between the source and destination circuits. Isolation

    between input and output is rated at 7500 Volt peak for 1 second for a typical componentcosting less than 1 US$ in small quantities.

    The opto-isolator is simply a package that contains both an infrared light-emitting diode(LED) and a photo detector such as a photosensitive silicon diode, transistor Darlingtonpair, or silicon controlled rectifier (SCR). The wave-length responses of the two devicesare tailored to be as identical as possible to permit the highest measure of couplingpossible. Other circuitryfor example an output amplifiermay be integrated into thepackage. An opto-isolator is usually thought of as a single integrated package, but opto-isolation can also be achieved by using separate devices.

    Digital opto-isolators change the state of their output when the input state changes;analog isolators produce an analog signal which reproduces the input.

  • 7/30/2019 45745368 Final Home Automation Project

    19/35

    Configurations

    Schematic diagram of a very simple opto-isolator with an LED and phototransistor. Thedashed line represents the isolation barrier, over which there is no electrical contact.

    A common implementation is a LED and a phototransistor in a light-tight housing toexclude ambient light and without common electrical connection, positioned so that lightfrom the LED will impinge on the photo detector. When an electrical signal is applied tothe input of the opto-isolator, its LED lights and illuminates the photo detector, producinga corresponding electrical signal in the output circuit. Unlike a transformer the opto-

    isolator allows DC coupling and can provide any desired degree of electrical isolationand protection from serious overvoltage conditions in one circuit affecting the other. Ahigher transmission ratio can be obtained by using a Darlington instead of a simplephototransistor, at the cost of reduced noise immunity and higher delay.

    With a photodiode as the detector, the output current is proportional to the intensity ofincident light supplied by the emitter. The diode can be used in a photovoltaic mode or aphotoconductive mode. In photovoltaic mode, the diode acts as a current source inparallel with a forward-biased diode. The output current and voltage are dependent on theload impedance and light intensity. In photoconductive mode, the diode is connected to asupply voltage, and the magnitude of the current conducted is directly proportional to the

    intensity of light. This optocoupler type is significantly faster than photo transistor type,but the transmission ratio is very low; it is common to integrate an output amplifiercircuit into the same package.

    The optical path may be air or a dielectric waveguide. When high noise immunity isrequired an optical conductive shield can be integrated into the optical path. Thetransmitting and receiving elements of an optical isolator may be contained within asingle compact module, for mounting, for example, on a circuit board; in this case, themodule is often called an optoisolator or opto-isolator. The photo sensor may be aphotocell, phototransistor, or an optically triggered SCR or TRIAC. This device may inturn operate a power relay or contactor.

    Analog opt isolators often have two independent, closely matched outputphototransistors, one of which is used to linearize the response using negative feedback.

  • 7/30/2019 45745368 Final Home Automation Project

    20/35

    Application

    A simple circuit with an opto-isolator. When switch S1 is closed, LED D1 lights, whichtrigger phototransistor Q1, which pulls the output pin low. This circuit, thus, acts as aNOT gate.

    Among other applications, opto-isolators can help cut down on ground loops, blockvoltage spikes, and provide electrical isolation.

    Switched-mode power supplies use optocouplers for mains isolation. As they

    work in an environment with much electrical noise and with signals which are notsmall, optocouplers with low transmission ratio are preferred.

    Where electrical safety is paramount, optocouplers can totally isolate circuitry

    which may be touched by humans from mains electricity.o Medical equipment often uses optocouplers.

    o One of the requirements of the MIDI (Musical Instrument Digital

    Interface) standard is that input connections be opto-isolated.o Oscilloscope and digital millimeters with computer interface.

    Optocouplers are used to isolate low-current control or signal circuitry from

    transients generated or transmitted by power supply and high-current controlcircuits. The latter are used within motor and machine control function blocks.

    5. ULN 2003

    In electronics, the Darlington transistor (often called a Darlington pair) is acompound structure consisting of two bipolar transistors (either integrated or separated

    devices) connected in such a way that the current amplified by the first transistor isamplified further by the second one. This configuration gives a much higher current gain(written , hfe, or hFE) than each transistor taken separately and, in the case of integrateddevices, can take less space than two individual transistors because they can use a sharedcollector. Integrated Darlington pairs come packaged in transistor-like packages.

  • 7/30/2019 45745368 Final Home Automation Project

    21/35

    A Darlington pair can be sensitive enough to respond to the current passed by skincontact even at safe voltages. Thus it can form the input stage of a touch-sensitive switch.The datasheet of this transistor is as shown below.**DATASHEET**

    6. 2051 Microcontroller:

    The 2051 is a 20 pin version of the 8051. It is a low-voltage, high-performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable read only memory.Atmel manufactures the chip using high-density nonvolatile memory technology. The2051 and is compatible with the industry-standard MCS-51 instruction set. By combininga versatile 8-bit CPU with Flash on a monolithic chip, the Atmel 2051 is a powerfulmicrocontroller. It provides a very flexible, cost-effective solution to many embeddedcontrol applications.

    Operational features of the 2051

    The 2051 features Compatibility with MCS-51 Products, 2K Bytes ofReprogrammable Flash Memory with 1,000 Write/Erase Cycles. The operating range ofthe 2051 is 2.7V to 6V. Among these features, the 2051 also contains the followingfeatures:Fully Static Operation: 0 Hz to 24 MHzTwo-level Program Memory Lock128 x 8-bit Internal RAM15 Programmable I/O LinesTwo 16-bit Timer/CountersSix Interrupt SourcesProgrammable Serial UART Channel

    Direct LED Drive OutputsOn-chip Analog ComparatorLow-power Idle and Power-down Modes2051 Pin-out and Description

  • 7/30/2019 45745368 Final Home Automation Project

    22/35

    Pin Description

    Pin Name: Purpose:VCC Supplies voltage and power.

    GND Ground.Port 1

    Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 toP1.7 provide internal pull-ups.P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input(AIN0) and the negative input (AIN1), respectively, of the on-chip precision analogcomparator. The Port 1 output buffers can sink 20mA and can drive LED displaysdirectly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2to P1.7 are used as inputs and are externally pulled low, they will source current (IIL)because of the internal pull-ups. Port 1 also receives code data during Flash programming

    and verification.Port 3

    Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups.P3.6 is hard-wired as an input to the output of the on-chip comparator and is notaccessible as a general purpose I/O pin. The Port 3 output buffers can sink 20mA. When1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be usedas inputs. As inputs, Port 3 pins that are externally being pulled low will source current(IIL) because of the pull-ups.

  • 7/30/2019 45745368 Final Home Automation Project

    23/35

    Port 3 also serves the functions of various special features of the AT89C2051 as listedbelow:

    Port 3 also receives some control signals for Flash programming and verification.RSTReset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin

    high for two machine cycles while the oscillator is running resets the device.Restrictions on Instructions

    The AT89C2051 and is the economical and cost-effective member of Atmels family ofmicrocontrollers. Therefore, it contains only 2K bytes of flash program memory. It isfully compatible with the MCS-51 architecture, and can be programmed using the MCS-

    51 instruction set. However, there are a few considerations one must keep in mind whenutilizing certain instructions to program this device. All the instructions related tojumping or branching should be restricted such that the destination address falls withinthe physical program memory space of the device, which is 2K for the AT89C2051. Thisshould be the responsibility of the software programmer. For example, LJMP 7E0Hwould be a valid instruction for the AT89C2051 (with 2K of memory), whereas LJMP900H would not.1. Branching instructions:

    LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTRThese unconditional branching instructions will execute correctly as long as the

    programmer keeps in mind that the destination branching address must fall within the

    physical boundaries of the program memory size (locations 00H to 7FFH for the89C2051). Violating the physical space limits may cause unknown program behavior.CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ, JNZWith these conditional branching instructions the same rule above applies. Again,

    violating the memory boundaries may cause erratic execution.For applications involving interrupts the normal interrupt service routine address

    locations of the 80C51 family architecture have been preserved.

  • 7/30/2019 45745368 Final Home Automation Project

    24/35

    2. MOVX-related instructions, Data Memory:The 2051 contains 128 bytes of internal data memory. Thus, in the 2051 the stack depthis limited to 128 bytes, the amount of available RAM. External DATAmemory access is not supported in this device, nor is external PROGRAM memoryexecution. Therefore, no MOVX [...] instructions should be included in the program. A

    typical 80C51 assembler will still assemble instructions,even if they are written in violation of the restrictions mentioned above. It is theresponsibility of the controller user to know the physical features and limitations of thedevice being used and adjust the instructions used correspondingly.BLOCK DIAGRAM OF 2051

  • 7/30/2019 45745368 Final Home Automation Project

    25/35

    Power-down Mode

    In the power down mode the oscillator is stopped, and the instruction that invokes powerdown is the last instruction executed. The on-chip RAM and Special Function Registersretain their values until the power down mode is terminated. The only exit from powerdown is a hardware reset. Reset redefines the SFRs but does not change the on-chip

    RAM. The reset should not be activated before VCC is restored to its normal operatinglevel and must be held active long enough to allow the oscillator to restart and stabilize.P1.0 and P1.1 should be set to 0 if no external pull-ups are used, or set to 1 ifexternal pull-ups are used.The 2051 is a low voltage (2.7V - 6V), high performance CMOS 8-bit microcontrollerwith 2 Kbytes of Flash programmable and erasable read only memory (PEROM). Thisdevice is compatible with the industry standard 8051 instruction set and pin-out. The2051 is a powerful microcomputer which provides a highly flexible and cost effectivesolution to many embedded control applications.

    In addition, the 2051 is designed with static logic for operation down to zero frequency

    and supports two software selectable power saving modes. The Idle Mode stops the CPUwhile allowing the RAM, timer/counters, serial port and interrupt system to continuefunctioning. The Power Down Mode saves the RAM contents but freezes the oscillatordisabling all other chip functions until the next hardware reset.Uses of the 2051 Microcontroller:

    The 2051 is used in many applications. Controlling 7-segment displays

    - Clocks Sensor projects- TemperatureUsed to Control LCD ( 8051 )**DATASHEET**

  • 7/30/2019 45745368 Final Home Automation Project

    26/35

    CIRCUIT DESCRIPTION

    Now let's have a detailed look into the whole circuit section wisely. Beforegetting in to the description, for the sake of easiness, let's confirm our aim or let's

    predict our expectation regarding its working.We are supposed to send a code word from the mobile phone, which is the

    transmitter and is sending the corresponding DTMF frequencies along. At the receiverend, i.e. at the land line end we need to detect the code back using our circuitry and

    it is to be used for driving the devices, represented by the LEDs.

    RING DETECTION_SECTION

    Refer the circuit diagram of this sectionregarding the need of this section,

    we want to use this circuitry in the device mode i.e. to control the device's turn off

    and turn on while maintaining the normal functionality and usage of the land line tomake and accept calls. So we must allow sometime for the land line to get into the

    off hook mode, also it is necessary to get the landline from on hook mode to off hookmode to enable the DTMF reception. If the land line is already in the off hook mode,

    then it won't be able to receive any signal as in the normal speech communicationthrough networks. So using this section we are aiming to automatically activate our

    circuitry after a number of rings are heard from the landline, while the coupling for

    automation is done using a relay. Here we have designed such that the DTMF signalswill automatically be coupled to the Decoding section just after the 6th ring.

    Now getting into the detailed analysis, the initial high ring voltage is coupledto a zener diode circuitry to reduce the voltage level for protection, at the same time

    maintaining the enough magnitude for detection using the opto-coupler. See the

    details in the circuit diagram. Whenever a ring occurs a sufficient amount of ringvoltage is established across the inputs of the opto-coupler which causes the internal

    transistor to conduct and effectively the output 5th and 4th pin to get short. Thisresults in an effective coupling of input ring voltage to pass through. Now we will

    exploit this signal to use it as a clock signal for the decade counter IC 4017, whichwill produce a high logic level at its Q5 pin upon reception of the 6th ring, which was

    changed into a quality clock signal. The diode-resistor- capacitor network along withthe NAND gates of the IC 4093 is used to shape up the irregular voltage signal

    obtained at the output of the opto- coupler into a quality clock pulse for the IC 4017.Because of this, as mentioned earlier, just after the 6th ring the counter 4017 will

    produce a high level at the Q5 pin till the next clock occurs. This logic 1 level of Q5pin is then used to drive the monostable multivibrator using 555 timer IC through BC

    547 transistor coupling. The monostable multivibrator is designed for a period ofabout 60 seconds which is the allotted time for the operator to control the device

    using the palm device he has. Thus the monostable multivibrator will produce logic 1level for a period of about 60 seconds at its output which is used to drive a relay as

    shown through transistor coupling, which will couple a low resistance in between the

    RING and the TIP terminals of the landline, resulting in the manifestation of a DCloop driving the landline from ON HOOK to OFF HOOK preparing the decoding sectionfor the reliable reception of the signal transmitted from the mobile phone.

    Now, we have to contend with a problem arising from the past counting of theIC 4017. Suppose a fellow called to our landline and cut the phone at the 4th or 5th

    ring. After this if somebody calls again then right at the first ring the landline will get

    into the OFF HOOK mode contrary to our expectation at the 6th ring. How can weavoid this error? To solve this, what we have with us is only the RESET pin of IC

  • 7/30/2019 45745368 Final Home Automation Project

    27/35

    4017. So the solution is that we must reset the IC 4017 every time just after oncethe 6th ring has occurred or the decoding section is coupled for decoding.

    So for this we use the retrigerrable monostable multivibrator using IC74LS123 commonly called as the ISS-PULSE-DETECTOR. For this we supply the

    same clock pulse of 4017 to the IC74123, which has been designed for a period ofmore than twice as long as the duration of a single ring signal, which is about 5

    seconds.The out put from the 4th pin of IC 74123, which is the TOGGLED Q output, is

    then supplied to the active high RESET pin of IC 4017. Thus this arrangement will

    avoid the past counting nature of IC 4017 by resetting it just after the completion of

    the 6th ring and the consequent coupling of the decoding section. Now that we haveeffectively coupled the signals from the palm device to the decoding section, let's see

    how the decoding section performs the decoding function.

    DECODING_ SECTION

    Refer the circuit diagram of this section.when the 1k resistor is

    brought across the RING and TIP terminals the landline also brought to OFFHOOK mode so that the decoding section is now connected to the transmitted signal

    and can receive it.

    The input capacitor-zener-resistor network is meant for both theprotection of the DTMF decoder IC 8870 from comparatively higher ring

    voltage and the coupling of the signal to the same IC. Based on thereference DTMF frequencies the DTMF decoder IC 8870 decodes the binary

    equivalent of the keys or numbers in the number pad of the transmittingmobile phones. The decoding scenario of the IC 8870 can be consolidated

    as given below.

    KEYS Q4 Q3 Q2 Q1

    1 Off Off Off On

    2 Off Off On Off

    3 Off Off On On

    4 Off On Off Off

    5 O ff On Off On

    6 Off On On Off

    7 Off On On On

    8 On Off Off O ff

    9 On Off Off On

    0 On Off On Off

    * On Off On On

    # On On Off On

  • 7/30/2019 45745368 Final Home Automation Project

    28/35

    A On On Off OnB On On On Off

    C On On On OnD Off Off Off Off

    The output of the DTMF decoder IC 8870 is binary code, which is then fed to

    the binary to decimal decoder IC 74HC154 retrieving the original transmitted key ornumber. But the IC 74HC154 has active low output pins. So these active low outputsare converted to active high ones by passing them through NOT gates. Note that

    here we are using only five outputs of IC 74HC154 to control four devices

    represented by LEDs as an instance. Specifically the pins we are using are the 13thpin which produces an active low corresponding to the code *, the 2nd pin which

    produces an active lowcorresponding to the code 1, the 3rd one for the code 2, the 4th one for the code 3

    and finally the 5th one for the code 4. Thus in the decoding section we retrieve backthe same number or code transmitted from the mobile phone.

    OUT PUT_ SECTION

    Refer the circuit diagram of this section.using the converted active high

    outputs of the decoding section we are now supposed to control the TURN OFF and

    TURN ON of four LEDs. The output corresponding to the code * from the decodingsection is used to trigger a monostable circuitry in the output section, which is

    designed to produce a high pulse at it's output for a period of about 5 seconds. Thishigh pulse

    with the duration of 5 seconds is used to activate the four tri-state buffers i.e. theICs 74LS126 enabling the coupling of the respective inputs of the buffers to their

    respective outputs. Now with in this 5 second duration we can have our controlsignals to pass through the buffers and can be used to control the D flip flops i.e. the

    ICs 74LS74, which has been set in the latching mode to get its output toggled uponreceiving consequent clock pulses, thus triggering the turn ON and turn OFF of the

    devices once the same code is transmitted for a second time. In a nutshell, the

    latching mode peration of D flip flops causes a device to get turn on from off state orvice versa on reception of the code word. The IC 74LS74 is a positive edge triggeredIC. One of the practical limitation we face here is to create a positive edge at the

    clock input of the D flip flop IC, using the isolated pulse coming through the buffer toits output. If we directly apply the pulse to the D flip flop to work in the latching

    mode it won't work due to the lack ofestablishment of the positive edge to its clock input, resulting from the occurrence of

    logic 1 level at the clock input of D flip flop right at the time of biasing or whenconnected to the power supply. For this purpose to create a positive edge going from

    logic 0 level to logic 1 level we pass the pulse coming out of the buffer throughanother NOT gate as shown.

    Finally, we need to find out a code which we have to transmit from the mobile

    phone so that we can establish a well shaped pulse as clock pulse at the clock input

    pin of the D flip flop for it to work in latching mode i.e. to get the LEDs turned on ifthey were in the off state and vice versa.

    First of all we must activate the buffer in the output section for the

    predetermined time by triggering the monostable circuitry there in. So the firstsymbol in the code word should be *. Now, we need to transmit a high level through

    the activated buffer using another symbol specific to each of the device represented.From the circuit diagram we can see it can be 1 for the 1st device, 2 for the second

    one and so on.

  • 7/30/2019 45745368 Final Home Automation Project

    29/35

    Thus by sending *(ordinal number of the device) we can create a low to hightransition at the out of the buffer. But it's not yet been a well defined pulse with both

    trailing and falling edge. So to get a falling edge we should now send a symbol otherthan ordinal number of the device. Let it also be * to have a convenient code. Now,

    as we know we use * for triggering the monostable circuitry in the output section wemust not end our code word with *. Other wise, it will cause the triggering input ofthe monostable multivibrator to continue in the logic 1 level even after the specified

    5

    seconds which in turn forces it not to get triggered for a second time on pressing *as there lacks the transition from low to high level at it's triggering input. Hence we

    must end our code word with a symbol other than both * and ordinal number of thedevice. Let it be 0. Thus, we got the code word that is to be send for our expected

    control as * ordinal number of the device*0. For example, to change the state of firstdevice we have to send a code-*1*0, for the 2nd one *2*0 etc.

    By following the similar logic, it is possible to find some other formats of codewords. For example, the code word * ordinal number of the device 0 is also seeming

    to be worthy of.

    Thus the whole control procedure can be consolidated as first of all we needto make a call to the land line, just after the 6th ring it will automatically get on tothe OFF HOOK mode for about 1minutes, during this time we can control the

    required devices with code words of specified format with in the installments of 5seconds.

    Source Code:;///////// DTMF HAS\\\\\\\\\\\;---------=========------------

    ; Ashwin LABS......;---------==========-----------

    ORG 0000HMOV P0,#00HMOV P2,#00H

    SWITCH4 EQU P3.0SWITCH3 EQU P3.1SWITCH2 EQU P3.2SWITCH1 EQU P3.3

    LED1 EQU P1.0 ; FF MODE ,RIGHT MODELED2 EQU P1.1 ; BACK MODELED3 EQU P1.6 ; BACK MODELED4 EQU P1.7 ; FF MODE ,LIFT MODE

  • 7/30/2019 45745368 Final Home Automation Project

    30/35

    LED5 EQU P0.1 ; LAMP , CAM NO/OFFSTOPLED EQU P2.5 ; STOP LAMP

    MOV P0,#0ffHMOV P2,#00H

    ACALL DELAYSJMP MAIN

    ;;;;;;;;;;;;;;;; MAIN PROG....;;;;;;;;;;;;MAIN:

    JB SWITCH1,NEXT1JNB SWITCH3,LAMP134

    JNB SWITCH2,LAMPOFFSETB LED2 ; BACK MODESETB LED3 ; BACK MODECLR STOPLED ; STOPLED

    OFFCLR LED1CLR LED4ACALL DELAY

    SJMP MAINNEXT1:JB SWITCH3,NEXT2JNB SWITCH2,RIGHTSETB LED1 ; FF MODESETB LED4 ; FF MODECLR STOPLED ; STOP LED

    OFFCLR LED2

    CLR LED3ACALL DELAYSJMP MAIN

    NEXT2:JB SWITCH2,NEXT3JNB SWITCH4,STOP

  • 7/30/2019 45745368 Final Home Automation Project

    31/35

    SETB LED4 ; LIFT MODECLR STOPLED ; STOP LED OFFCLR LED1CLR LED2

    CLR LED3ACALL DELAYacJMP MAIN

    NEXT3:ACALL DELAYSJMP MAIN

    RIGHT:

    SETB LED1 ; RIGHT MODECLR STOPLED ; STOP LED OFFCLR LED4CLR LED2CLR LED3ACALL DELAYSJMP MAIN

    STOP:

    SETB STOPLED ; STOP LED ONCLR LED1CLR LED2CLR LED3CLR LED4

    ACALL DELAYLJMP MAIN

    LAMP134:JNB SWITCH4,LAMPON

    ACALL DELAYLJMP MAIN

    LAMPON:SETB LED5ACALL DELAY ; LAMP , CAM NO

  • 7/30/2019 45745368 Final Home Automation Project

    32/35

    LJMP MAINLAMPOFF:

    CLR LED5 ; LAMP , CAM OFFACALL DELAY

    LJMP MAINJB SWITCH1,NEXT1

    JNB SWITCH3,LAMP134JNB SWITCHDD,LAMPOFF

    SETB LED2 ; BACK MODESETB LED3 ; BACK MODECLR STOPLED ; STOPLED

    OFF

    CLR LED1CLR LED4ACALL DELAYSJMP MAIN

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;DELAYA:

    MOV 71H,#0FFHMOV 72H03H

    LOOP: DJNZ 70H,LOOPDJNZ 71H,LOOP

    RETEND

    DJNZ 70H,LOOPDJNZ 71H,LOOP

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  • 7/30/2019 45745368 Final Home Automation Project

    33/35

    CONCLUSION

    This project presents a dtmf based home appliances controlling. The controller basedon closed loop algorithm is designed and implemented with Atmel MCU in embeddedsystem the domain.

    Experimental work has been carried out carefully.

    Hence we are controlling 6 home appliances controlling through DTMF technologyeffectively. Because now a days GSM technology became very popular,here its very easyto use for any applications with the help of 8051 controller.In all low end applicationsnow a days we are using 8051 controllers like industrial automation and data acquisition.

    The Remote Automation using Networks [RAN] on test performed exceptionally well toits capability and accuracy. All the inherent parts of the circuit performed consistently. Ithelped us to come out with good judgment. With the features what it inherits, it seems tobe advantageous to the present era.

  • 7/30/2019 45745368 Final Home Automation Project

    34/35

    Future Scope

    The controller we used having the following featurtes like 8 bit 8051 architecture in a tiny

    20pin DIP package,128B RAM and 4kB on-chip Flash Program Memory. For low end

    applications this controller is very easy to use and at the same time GSM also widely

    accepted protocol for mobile communication.

    In future for small scale systems 8051 controllers can be widely used along with the help

    of GSM technology.

    Refrences

    Text Books:

    8051 and Embedded systems BY Mazidi

    Website:

    www.howstuffworks.com

    www.answers.com

    www.radiotronix.com

    Magazines:

    Electronics for you

  • 7/30/2019 45745368 Final Home Automation Project

    35/35

    Electrikindia

    Let us Go Wireless