38
1 CHAPTER-1 INTRODUCTION 1.1 ABOUT DKOP LABS Pvt. Ltd Training for industry readiness is an accepted practice in order to be ahead of the herd. We have been making a name for ourselves with our systematic approach in this field. DKOP Labs Pvt.. Ltd has been providing Industrial Training in VLSI Design since 2007 to help students make the transition from academic learning to industry preparedness. Gradually, we started Industrial Training in Software Development and Embedded Technology as well. We had observed for quite some time that the interview-to-selection ratio was drastically going down. Companies screen 100s of candidates to fill one single position. Lot of human resource is wasted in the process and it is primarily because the candidates are not industry-ready although they may have scored good marks in the academics. We felt, we could make a difference by bridging the gap between Academics and Industry. DKOP Labs Pvt Ltd is not just about training. The objective of Research division is to undertake research in the burning problems of the industry and work towards their solution. It serves two purposes – it utilizes the skills and experience of our highly experienced and qualified team while giving them opportunity to keep abreast of the latest technology developments. Our research division has successfully delivered many projects in Software, VLSI & Embedded domain. 1.2 HOME AUTOMATION Imagine how helpful it will be to be able to switch on your air conditioning system ten minutes before you get home on a hot afternoon in June. How about having a security system that will detect smoke, excessive electrical power usage, burglar attempts and unauthorized movements in your house and alert you? This is what home automation is about and there is no end to its application. In fact, sophisticated home automation systems are now being developed that can maintain an inventory of household items and prepare a shopping list or automatically order replacements.

Home Automation using DTMF

Embed Size (px)

Citation preview

Page 1: Home Automation using DTMF

1

CHAPTER-1

INTRODUCTION

1.1 ABOUT DKOP LABS Pvt. Ltd Training for industry readiness is an accepted practice in order to be ahead of the herd. We have been making a name for ourselves with our systematic approach in this field. DKOP Labs Pvt.. Ltd has been providing Industrial Training in VLSI Design since 2007 to help students make the transition from academic learning to industry preparedness. Gradually, we started Industrial Training in Software Development and Embedded Technology as well.

We had observed for quite some time that the interview-to-selection ratio was drastically going down. Companies screen 100s of candidates to fill one single position. Lot of human resource is wasted in the process and it is primarily because the candidates are not industry-ready although they may have scored good marks in the academics. We felt, we could make a difference by bridging the gap between Academics and Industry.

DKOP Labs Pvt Ltd is not just about training. The objective of Research division is to undertake research in the burning problems of the industry and work towards their solution. It serves two purposes – it utilizes the skills and experience of our highly experienced and qualified team while giving them opportunity to keep abreast of the latest technology developments. Our research division has successfully delivered many projects in Software, VLSI & Embedded domain.

1.2 HOME AUTOMATION

Imagine how helpful it will be to be able to switch on your air conditioning system ten minutes before you get home on a hot afternoon in June. How about having a security system that will detect smoke, excessive electrical power usage, burglar attempts and unauthorized movements in your house and alert you? This is what home automation is about and there is no end to its application. In fact, sophisticated home automation systems are now being developed that can maintain an inventory of household items and prepare a shopping list or automatically order replacements.

Page 2: Home Automation using DTMF

2

Home automation has made it possible to have what is often referred to as a 'smart home', a home that can detect and identify you, automatically adjust the lighting to your predefined taste, open doors automatically, play your favourite music, water your flowers in the morning, switch on the security lights at night and switch them off in the morning, heat water for bathe and tea, stream to you anywhere in the world via the internet a live video of what is happening in and around your house. It makes it possible to link lighting, entertainment, security, telecommunications, heating, and air conditioning into one centrally controlled system. This allows you to make your house an active partner in managing your busy life. Nowadays in foreign land, you can hardly find a house without a home automation system which can range from the remote for the television, burglar alarm and hi-tech security gates, to an automated air conditioning system that maintains the temperature at a predefined value. 1.3 AUTOMATION Automation is the use of control systems and information technology to control equipment, industrial machinery and processes, reducing the need for human intervention. In the scope of industrialization, automation is a step beyond mechanization. Mechanization provided human operators with machinery to assist them with the physical requirements of work while automation greatly reduces the need for human sensory and mental requirements as well. Automation plays an increasingly important role in the global economy and in daily experience. Engineers strive to combine automated devices with mathematical and organizational tools to create complex systems for a rapidly expanding range of applications and human activities. Many roles for humans in industrial processes presently lie beyond the scope of automation. Human-level pattern recognition, language recognition, and language production ability are well beyond the capabilities of modern mechanical and computer systems. Tasks requiring subjective assessment or synthesis of complex sensory data, such as scents and sounds, as well as high-level tasks such as strategic planning, currently require human expertise. Automation has had a notable impact in a wide range of highly visible industries beyond manufacturing. Once ubiquitous telephone operators have been replaced largely by automated telephone switchboards and answering machines. Medical processes such as primary screening in electrocardiograph or radiography and laboratory analysis of human genes, blood plasmas, cells,

Page 3: Home Automation using DTMF

3

and tissues are carried out at much greater speed and accuracy by automated systems. Automated teller machines have reduced the need for bank visits to obtain cash and carry out transactions. In general, automation has been responsible for the shift in the world economy from agrarian to industrial in the 19th century and from industrial to services in the 20th century. 1.3.1 Home Automation Home automation may designate an emerging practice of increased automation of household appliances and features in residential dwellings, particularly through electronic means that allow for things impracticable, overly expensive or simply not possible in recent decades. Home automation includes all that a building automation provides like climate controls, door and window controls, and in addition control of multimedia home theatres, pet feeding, plant watering and so on. But there exists a difference in that home automation emphasizes more on comforts through ergonomics and ease of operation. DTMF Home Automation lets you operate your home appliances like lights and water pump from your office or any other remote place. So if you forgot to switch off the lights or other appliances while going out, it helps you to turn off the appliance with your cell phone. Your cell phone works as remote control to your home appliances. You can control the desired appliance by presenting the corresponding key. 1.4 Dual-tone multi-frequency (DTMF)

Dual-tone multi-frequency (DTMF) signaling is used for telephone signaling over the line in the voice-frequency band to the call switching center. The version of DTMF used for telephone tone dialing is known by the trademarked term Touch-Tone and is standardized by ITU-T Recommendation Other multi-frequency systems are used for signaling internal to the telephone network.

As a method of in-band signaling, DTMF tones were also used by cable television broadcasters to indicate the start and stop times of local commercial insertion points during station breaks for the benefit of cable companies. Until better out-of-band signaling equipment was developed in the

Page 4: Home Automation using DTMF

4

1990s, fast, unacknowledged, and loud DTMF tone sequences could be heard during the commercial breaks of cable channels in the United States and elsewhere.

Today, most telephone equipment use a DTMF receiver IC. One common DTMF receiver IC is the Motorola MT8870 that is widely used in electronic communications circuits. The MT8870 is an 18-pin IC. It is used in telephones and a variety of other applications. When a proper output is not obtained in projects using this IC, engineers or technicians need to test this IC separately. A quick testing of this IC could save a lot of time in re-search labs and manufacturing industries of communication instruments. DTMF IC it can be assembled on a multipurpose PCB with an 18-pin IC base. One can also test the IC on a simple breadboard. Multi-frequency signalling is a group of signalling methods that use a mixture of two pure tone (pure sine wave) sounds. Various MF signalling protocols were devised by the Bell System and CCITT. The earliest of these were for in-band signalling between switching centres, where long-distance telephone operators used a 16-digitkeypad to input the next portion of the destination telephone number in order to contact the next downstream long distance telephone operator. This semi-automated signalling and switching proved successful in both speed and cost effectiveness. Based on this prior success with using MF by specialists to establish long-distance telephone calls, Dual-tone multi-frequency (DTMF) signalling was developed for the consumer to signal their own telephone-call's destination telephone number instead of talking to a telephone operator. For optimum working of telephone equipment, the DTMF receiver must be designed to recognize a valid tone pair greater than 40 ms in duration and to accept successive digit tone-pairs that are greater than 40 ms apart. However, for other applications like remote controls and radio communications, the tone duration may differ due to noise considerations. Therefore, by adding an extra resistor and steering diode the tone duration can be set to different values. The circuit is configured in balanced-line mode. To reject common-mode noise signals, a balanced differential amplifier input is used. The circuit also provides an excellent bridging interface across a properly terminated telephone line. Transient protection may be achieved by splitting the input resistors and inserting ZENER diodes (ZD1 and ZD2) to achieve voltage clamping. This allows the transient energy to be dissipated in the resistors

Page 5: Home Automation using DTMF

5

and diodes, and limits the maximum voltage that may appear at the inputs. Whenever you press any key on your local telephone keypad, the delayed steering (Std) output of the IC goes high on receiving the tone-pair, causing LED5 (connected to pin 15 of IC via resistor R15) to glow. It will be high for a duration de-pending on the values of capacitor and resistors at pins 16 and 17. The optional circuit shown within dot-ted line is used for guard time adjustment. The LEDs connected via resistors R11 to R14 at pins 11 through 14, respectively, indicate the output of the IC. The tone-pair DTMF (dual-tone multi-frequency) generated by pressing the telephone button is converted into bi-nary values internally in the IC. The binary values are indicated by glowing of LEDs at the output pins of the IC. LED1 represents the lowest significant bit (LSB) and LED4 represents the most significant bit (MSB). So, when you dial a number say, 5, LED1 and LED3 will glow, which is equal to 0101. Similarly, for every other number dialled on your telephone, the corresponding LEDs will glow. Thus, a non-defective IC should indicate proper bi-nary values corresponding to the decimal number pressed on your telephone key-pad. To test the DTMF IC 8870/KT3170, proceed as follows:

Connect local telephone and the circuit in parallel to the same telephone line. Switch on S1. (Switch on auxiliary switch S2 only if keys A, B, C and D are to be

used.) Now push key ‘*’ to generate DTMF tone. Push any decimal key from the telephone keypad. Observe the equivalent binary as shown in the table.

If the binary number implied by glowing of LED1 to LED4 is equivalent to the pressed key number, the DTMF IC 8870 is correct Keys A, B, C, and D on the telephone keypad are used for special signalling and are not available on standard pushbutton telephone keypads. Pin 5 of the IC is pulled down to ground through resistor R8. Switch on auxiliary switch S2

Page 6: Home Automation using DTMF

6

Fig 1.1 A DTMF telephone keypad Keypad

The DTMF keypad is laid out in a 4×4 matrix, with each row representing a low frequency, and each column representing a high frequency. Pressing a single key (such as '1' ) will send a sinusoidal tone of the two frequencies (697 and 1209 hertz (Hz)). The original keypads had levers inside, so each button activated two contacts. The multiple tones are the reason for calling the system multi frequency. These tones are then decoded by the switching centre to determine which key was pressed.

Table 1.1 1209 Hz 1336Hz 1633 Hz 697 Hz 1 2 3 770 Hz 4 5 6 852 Hz 7 8 9 941 Hz * 0 #

DTMF keypad frequencies

Page 7: Home Automation using DTMF

7

1.5 PROJECT OBJECTIVE The objective of this project is to implement a low cost, reliable and scalable home automation system that can be used to remotely switch on or off any household appliance, using a microcontroller to achieve hardware simplicity, low cost short message service (SMS) for feedback and voice dial from any phone to toggle the switch state. 1.6 PROJECT JUSTIFICATION This project is of contributory knowledge to the development and implementation of home automation systems in Nigeria using low cost, locally available components like microcontroller, free voice dial service (popularly referred to as 'flashing') and very cheap short message service (SMS) text.

Page 8: Home Automation using DTMF

8

CHAPTER 2 RELATED WORK 2.1 PROTEUS SOFTWARE 2.1.1 IMPLEMENATION OF PROTEUS Proteus 8 is a best simulation software for various designs with microcontroller. It is mainly popular because of availability of almost all microcontrollers in it. So it is a handy tool to test programs and embedded designs for electronics hobbyist. You can simulate your programming of microcontroller in Proteus 8 Simulation Software. After simulating your circuit in Proteus 8 Software you can directly make PCB design with it so it could be an all in one package for students and hobbyists. So I think now you have a little bit idea about what is proteus software. 2.1.2 GETTING STARTED 1) From ‘Desk Top’ in Windows, Click left twice on ‘SECEE Applications’. 2) Click left twice on icon 'ISIS' 3) Click left on 'full screen' icon in top right hand corner of screen, middle button, to enlarge display. SAVING A FILE IN ISIS 1) Saving to (E) drive on hard disk: 2) Select 'File - Save Design As' and select drive/directory E. 3) Delete 'untitled' and insert 'file name'. 'Click left' on 'Save'. This saves your work in E. DRAWING SCHEMATIC DIAGRAM IN ISIS New Design - Blank Screen.

Page 9: Home Automation using DTMF

9

Press 'G' on keyboard for option of a grid or blank screen. At the top of the screen are 'pull down' menus, click left to display and also to close. To the right are three windows, namely from the top, 'Overview', 'Icon' and 'Object'. Beneath these windows are the X - Y co-ordinates in thousandths of an inch and to the bottom left hand side is the cursor option display. COMPONENTS The components selected below are for a simple binary adder circuit. Make sure icons Main Placement Mode and Component are selected. To select components 'click left' on 'P' in 'Object Window', now displaying ‘DEVICES’. Selected components are now in Object window, the last item selected being highlighted. This component is displayed in the Overview window. Orientation of this component depends on orientation of 'blue' arrow i.e. the 'Rotate' icon, click left or right on it to rotate component. Drawing lines to join up circuit components place pointer near tip of component terminal. Notice a 'x' appears. 'Click left', move pointer to next terminal tip, a line follows the pointer and 'clicking left' joins the two terminals together. Complete the circuit diagram. Lines may be routed manually by clicking left at each change of direction. Sloping lines should not be drawn.

Page 10: Home Automation using DTMF

10

POWER LINES Connect all ground points to the 'Ground' symbol, labelled 'GND'. Connect all VCC points to the 'Power' symbol, labelled 'VCC'. These symbols are found in 'Gadgets Placement Mode' and selecting the 'Terminals' icon. SCREEN DESCRIPTION There is a row of pull down menu's at the top of the screen. Click left to view and also to close. The overview window at the top right shows the whole layout. The area displayed on the screen is achieved by 'clicking left' in this window. Below this window is the toolbox comprising four rows of 'icons' the third row has three ‘mode select icons’, which provides an alternative selection of icons in the two top rows. The lower or object window is presently displaying the components. Its contents vary with which 'icon' is highlighted. At the bottom of the screen is the Layer and Mask Selector, which changes with which icon is selected. Pressing the space bar toggles between top and bottom layers. Use Bottom Copper for single sided boards, all tracks will then be in blue. To the right are the co-ordinates indicating the position of the mouse pointer from the center of the screen. These readings can represent thousandth of an inch or mm's by simply toggling the 'M' key. Pressing the 'O' key sets a false origin and the co-ordinates are displayed in magenta as a cautionary warning.

Page 11: Home Automation using DTMF

11

2.2 ARDUINO SOFTWARE (IDE) Arduino is an open-source prototyping platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. All this is defined by a set of instructions programmed through the Arduino Software (IDE).A worldwide community of makers - students, hobbyists, artists, programmers, and professionals - has gathered around this open-source platform, their contributions have added up to an incredible amount of accessible knowledge that can be of great help to novices and experts alike.

2.2.1 GETTING STARTED

Launch the Arduino application Double-click the Arduino application (arduino.exe) you have previously downloaded .

Open the blink example

Open the LED blink example sketch: File > Examples >01.Basics > Blink.

Page 12: Home Automation using DTMF

12

Fig 2.2.1 Select your board You'll need to select the entry in the Tools > Board menu that corresponds to your Arduino.

Page 13: Home Automation using DTMF

13

Fig 2.2.2 Selecting an Arduino Uno

For Duemilanove Arduino boards with an ATmega328 (check the text on the chip on the board), select Arduino Duemilanove or Nano w/ ATmega328. Previously, Arduino boards came with an ATmega168; for those, select Arduino Diecimila, Duemilanove, or Nano w/ ATmega168.

Select your serial port

Select the serial device of the Arduino board from the Tools | Serial Port menu. This is likely to be COM3 or higher (COM1and COM2 are usually reserved for hardware serial ports). To find out,

Page 14: Home Automation using DTMF

14

you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port.

Upload the program Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar. (Note: If you have an Arduino Mini, NG, or other board, you'll need to physically press the reset button on the board immediately before clicking the upload button on the Arduino Software.)

Fig 2.2.3 A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink (in orange). If it does, congratulations! You've gotten Arduino up-and-running.

Page 15: Home Automation using DTMF

15

CHAPTER 3 COMPONENTS USED

DTMF Home Automation lets you operate your home appliances like lights and water pump from your office or any other remote place. So if you forgot to switch off the lights or other appliances while going out, it helps you to turn off the appliance with your cell phone. Your cell phone works as remote control to your home appliances. You can control the desired appliance by presetting the corresponding key. The Project “Home Automation using mobile communication” has different sections such as: 1.Microcontroller 2.Relays 3. DTMF Decoder 3.1 MICRO-CONTROLLER A microcontroller is a compact microcomputer designed to govern the operation of embedded systems in motor vehicles, robots, office machines, complex medical devices, and various other devices. A typical microcontroller includes a processor, memory, and peripherals. The simplest microcontrollers facilitate the operation of the electromechanical systems found in everyday convenience items. Originally, such use was confined to large machines such as furnaces and automobile engines to optimize efficiency. In recent years, microcontrollers have found their way into common items such as ovens, refrigerators, toasters, Microcomputers are also common in office machines such as photocopiers, scanners, and printers.

The most sophisticated microcontrollers perform critical functions in aircraft, spacecraft, ocean-going vessels, life-support systems, and robots of all kinds. Medical technology offers especially promising future roles. For example, a microcontroller might regulate the operation of an artificial

Page 16: Home Automation using DTMF

16

heart, artificial kidney, or other artificial body organ. Microcomputers can also function with prosthetic devices (artificial limbs). A few medical-science futurists have suggested that mute patients might someday be able, in effect, to speak out loud by thinking of the words they want to utter, while a microcontroller governs the production of audio signals to drive an amplifier and loudspeaker.

3.1.1 MICRO CONTROLLER USED: ARDUINO UNO

Arduino/Genuino Uno is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. "Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino boards, and the reference model for the Arduino platform; for an extensive list of current, past or outdated boards see the Arduino index of boards. Technical specs Table 3.1

Microcontroller ATmega328P

Operating Voltage 5V Input Voltage (recommended) 7-12V Input Voltage (limit) 6-20V Digital I/O Pins 14 (of which 6 provide PWM output) PWM Digital I/O Pins 6 Analog Input Pins 6 DC Current per I/O Pin 20 mA DC Current for 3.3V Pin 50 mA

Page 17: Home Automation using DTMF

17

Flash Memory 32 KB (ATmega328P) of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328P) EEPROM 1 KB (ATmega328P) Clock Speed 16 MHz Length 68.6 mm Width 53.4 mm Weight 25 g

Differences with other boards The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter. Power The Arduino/Genuino Uno board can be powered via the USB connection or with an external power supply. The power source is selected automatically. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the GND and Vin pin headers of the POWER connector. The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts. The power pins are as follows:

Vin. The input voltage to the Arduino/Genuino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.

Page 18: Home Automation using DTMF

18

5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.

3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA. GND. Ground pins. IOREF. This pin on the Arduino/Genuino board provides the voltage reference with which the

microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.

Memory The ATmega328 has 32 KB (with 0.5 KB occupied by the bootloader). It also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library). Input and Output See the mapping between Arduino pins and ATmega328P ports. The mapping for the Atmega8, 168, and 328 is identical. Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller. In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

Page 19: Home Automation using DTMF

19

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.

LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.

TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogReference(). Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to

shields which block the one on the board.

Communication Arduino/Genuino Uno has a number of facilities for communicating with a computer, another Arduino/Genuino board, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial communication over USB and appears as a virtual com port to software on the computer. The 16U2 firmware uses the standard USB COM drivers, and no external driver is needed. However, on Windows, an .inf file is required. The Arduino Software (IDE) includes a serial monitor which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial communication on pins 0 and 1). A SoftwareSerial library allows serial communication on any of the Uno's digital pins.

Page 20: Home Automation using DTMF

20

Fig 3.1.1 3.2 RELAYS In order to enable a circuit to be isolated from the system only under faulty conditions, protective relays are used. In normal cases, it is open circuit relay. The relay is usually provided with 4 terminals, two of which are connected to relay winding and other two are connected to the circuit to be controlled. It has following characteristics:

Sensitivity Speed Selectivity

3.2.1 TYPES OF RELAYS:

Electromagnetic Attraction Type: These relays are actuated by DC or AC quantities.

Page 21: Home Automation using DTMF

21

Electromagnetic Induction Type: its operation depends upon EMI phenomena. Thermal Relays: its operation depends upon the heating effect of electric Current. Distance Relays: its operation depends upon the ratio of voltage to current.

3.2.2 ELECTROMAGNETIC RELAY:

These relays are electromagnetically operated. The parts of these relays are an iron core & its surrounding coil of wire. An iron yoke provides a low reluctance path for magnetic flux, the yoke being shaped so that the magnetic circuit can be closed by a movable piece of iron called the armature, and a set of contacts. The armature is hinged to the yoke and is held by a string in such a way that there is an air gap in the magnetic circuit. Figure shows the principle of operation of this relay. When an electric current flows in the coil, the armature is attracted to the iron core. Electrical switching contacts are mounted on the armature. When the armature coil is energized, these movable contacts break their connections with one set of fixed contacts and close a connection to a previously open contact. When electric power is removed from the relay coil, spring returns the armature to its original position.

Standard voltages for D.C. relay are 6,12,24,48 & 110 volts and for A.C. relays are

6,12,24,48,120 & 240 volts.

Basic Diagram Showing the Operating Principle of a Relay

Fig 3.2.1 3.2.3 TYPE OF RELAY USED: SPDT

SPDT – Single Pole Double Throw. A common terminal connects to either of two others. Including two for the coil, such a relay has five terminals in total.

Page 22: Home Automation using DTMF

22

3.2.4 RELAY CIRCUIT DIODE: A relay coil is not only an electromagnet but it's also an inductor. When power is applied to the coil the current in the coil builds up and levels off at its rated current (depends on the DC resistance of the coil, I = V/R). Some energy is now stored in the coil's magnetic field (E = 05LI2). When the current in the coil is turned off this stored energy has to go somewhere. The voltage across the coil quickly increase trying to keep the current in the coil flowing in the same direction (V = Ldi/dt). This voltage spike can reach hundreds or thousands of volts and can damage electronic parts. By adding a flyback diode the current has a path to continue flowing through coil until the stored energy is used up. The diode also clamps the voltage across the coil to about 0.7V protecting the electronics. The stored energy dissipates quickly in the diode (E = V*I*t). The current stops flowing and the relay turns off. The diode should be able to handle the coil current for a short time and switch relatively fast. Note: A resistor or zener diode can be placed in series with the diode to use up the stored energy quicker. This increases the amplitude of the voltage spike above 0.7V but the energy is used up quicker (i.e. the voltage spike won't last as long). ULN2003 The ULx200xA devices are high-voltage, high-current. Darlington transistor arrays. Each consists of seven NPN Darlington pairs that feature high-voltage outputs with common-cathode clamp diodes for Simplified Block Diagram switching inductive loads. The collector-current rating of a single Darlington pair is 500 mA. The Darlington pairs can be paralleled for higher current capability. Applications include relay drivers, hammer drivers, lamp drivers, display drivers (LED and gas discharge), line drivers, and logic buffers. For 100-V (otherwise interchangeable) versions of the ULx2003A devices, see the SLRS023 data sheet for the SN75468 and SN75469 devices.

Page 23: Home Automation using DTMF

23

Fig 3.2.2

Page 24: Home Automation using DTMF

24

Fig 3.2.3 3.3 DTMF DECODER (DUAL TONE MULTIPLE FREQUENCY):

DTMF tones are sometimes used in caller ID systems to transfer the caller ID information, but in the United States only Bell 202 modulated FSK signalling is used to transfer the data.

Ac register signalling is used in dtmf telephones, here tones rather than make/break pulse are used for dialling, and each dialled digit is uniquely represented by a pair of sine waves tones. These tones (one from low group for row and another from high group from column) are sent to the exchange when a digit is dialled by pushing the key, these tone lies within the speech band of 300 to 3400 Hz, and are chosen so as to minimize the possibility of any valid frequency pair existing in normal speech simultaneously. Actually, this minimisator is made possible by forming pairs with one tone from the higher group and the other from the lower of frequencies.

A valid dtmf signal is the sum of two tones, one from a lower group (697-940 Hz) and the other from a higher group (1209-1663 Hz). Each group contains four individual tones.

Page 25: Home Automation using DTMF

25

This scheme allows 10 unique combinations. Ten of these code represent digits 1 through 9 and 0. Tones in DTMF dialling are so chose that none of the tones is harmonic of are other tone. Therefore, there is no change of distortion caused by harmonics. Each tone is sent as along as the key remains pressed. The dtmf signal contains only one component from each of the high and low group. This significantly simplifies decoding because the composite dtmf signal may be separated with band pass filters into single frequency components, each of which may be handled individually.

Fig 2. 1209 Hz on 697 Hz to make the 1 tone The underlying principle mainly relies up on the ability of DTMF (Double Tune Multi

Frequency) ICs to generate DTMF corresponding to a number or code in the number 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 communication networks, constituting the transmitter section which is simply equivalent to a mobile set. In the receiver part, the DTMF detector IC, for example IC MT 8870 detects the number or Fig 3.3.1 Code represented by DTMF back, through the inspection of the two transmitted frequencies.

Page 26: Home Automation using DTMF

26

3.3.1

CM8870 IC: There is an inbuilt Op amp present inside the M-8870 decoder IC. The electrical signals from microphone pin are fed to inverting input of the Op Amp via a series of resistance (100kΩ) and capacitance (0.1 µF).

The non-inverting input of Op-amp is connected to a reference voltage (pin4 -VREF). The voltage at VREF pin is Vcc/2.

Pin 3 (GS) is the output of internal Op Amp, the feedback signal is given by connecting the output pin (pin3- GS) to inverting input pin (pin2- IN-) through a resistor (270kΩ).

The output of Op Amp is passed through a pre filter, low group and high group filters (filter networks). These filters contain switched capacitors to divide DTMF tones into low and high group signals (High group filters bypass the high frequencies whereas low group filter pass low frequencies).

Next processing sections inside the IC are frequency detector and code detector circuits. Filtered frequency passed through these detectors.

At last the four digit binary code is latched at the output of M-8870 DTMF decoder IC. The entire process from frequency detection to latching of the data, is controlled by steering

control circuit consisting of St/GT, Est pins, resistor (390kΩ) and a capacitor (0.1µF).

Page 27: Home Automation using DTMF

27

5th Pin, INH is an active high pin, inhibits detection of A, B, C, D tones of character. 6th Pin, PWDN is an (active high), inhibits the working of oscillator thus stops the working

of our circuit. The 10th pin 10; TOE is the output enable pin which is active high logic and enables the

latching of the data on the data pins Q0, Q1, Q2, and Q3. 15th Pin StD is the Data valid pin, turn out to be high on detection of valid DTMF tone or

else it remains low. Features

• Complete DTMF Receiver • Low power consumption • Internal gain setting amplifier • Adjustable guard time • Central office quality • Power-down mode • Inhibit mode • Backward compatible with MT8870C/MT8870C-1

Applications

• Receiver system for British Telecom (BT) or CEPT Spec (MT8870D-1) • Paging systems • Repeater systems/mobile radio • Credit card systems

Page 28: Home Automation using DTMF

28

• Remote control • Personal computers • Telephone answering machine

3.3.2 CRYSTAL OSCILLATOR

A miniature 3.579545 MHz quartz crystal enclosed in a hermetically sealed HC-49/US package, used as the resonator in a crystal oscillator. Pins 7 (OS1) and 8 (OS2) are used to connect crystal oscillator.

A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters/receivers.

Fig 3.3.2 Crystal oscillator

Page 29: Home Automation using DTMF

29

Table 3.3 showing DTMF Low and High frequency tones and decoded output

Page 30: Home Automation using DTMF

30

CHAPTER 4 WORKING 4.1 CIRCUIT DIAGRAM Fig 4.1.1

Page 31: Home Automation using DTMF

31

4.2 PROGRAM ALGORITHM: 1. On start of the system, a phone call is made at the transmitter end. 2. On the receiver end the call is received. It forms a channel and links the user’s phone with the DTMF module at receiving end. 3. If a key is pressed on user’s phone then it goes as an input to the DTMF module and it checks and transmits the binary equivalent to the microcontroller. 4. Now the microcontroller checks the binary equivalent bitwise. Now it checks if the key pressed was ‘1’ or not and accordingly assigns HIGH or LOW to relay (variable storing the state of the relay circuit). 5. Now if value of relay is HIGH the bulb glows else it doesn’t glows. 4.3 BLOCK DIAGRAM

Fig 4.3.1

Page 32: Home Automation using DTMF

32

No

4.4 FLOWCHART Fig 4.4.1

START

Make a Phone Call

Phone is picked automatically on the other side

Key 1 is pressed on the keypad

Relay is switched off

STOP

Relay is switched on

Yes

Page 33: Home Automation using DTMF

33

4.5 CODE Fig 4.5.1

Page 34: Home Automation using DTMF

34

CHAPTER 5 CRITICAL EVALUATION 5.1 APPLICATIONS OF HOMEAUTOMATION USING DTMF There are numerous application areas of home automation using DTMF The purpose of this Application Note is to provide information on the operation and application of DTMF a few of which are outlined below:

Effective control of home appliances Effective control of home appliances like Air Conditioners, Water Heaters, Thermal Baths, Furnaces Incubators. Home appliances control, Hotel lights/ fans Control, Shops and Showrooms appliances control, Industrial appliances etc.

Turn Your Webcam into a Security Camera Instead of installing a surveillance camera you can always use the webcam for keeping track on your children as it can successfully perform the activity of taking note of all activities. Also it is cheap and very minute and the activities can be checked with the help of the internet.

Install a Wireless Intercom

You are busy eating your food and suddenly you see the vegetables are over. You call out to your spouse to give you some who is busy in some work. You have to scream at the top of your voice which is very embarrassing. Instead of shouting you could simply attach a wireless intercom and call out to her and ask her for the vegetable. In this way you can save your energy and time too. Its visible around us that crime is on the increase, families are beginning to aim at purchasing security alarm systems for their homes. Home Automation adds a extra sense of security to your home, using the automation system you can monitor your homes security cameras using a remote device.

Capture Party Moments without using your Digital Camera or DSLR

Page 35: Home Automation using DTMF

35

The best way to capture party moments without your DSL would be with the help of a webcam. Set the time and let it go on capturing videos and images. There are software’s available for windows. The software helps in saving the captured pictures as JPEG files. In that case you no more need to worry to take your camera along if you have a webcam with you.

Use Automatic Sprinklers to Water your Garden You can make your own DIY automatic sprinkler that will reduce your effort of dragging the sprinklers out in the garden. Again you can set a time so that the sprinkler automatically sprinkles water in the yard at the set time.

5.2 LIMITATIONS OF HOMEAUTOMATION USING DTMF

Number of appliances is limited

DTMF is limited to 16 pairs of tones because it was developed for telephone keypads and the largest foreseeable matrix size I guess was 4 x 4 - this means 16 and there is no chance of extending this because the chipsets used are not going to be revamped.

No security

Anyone can control the appliances by calling the mobile connected to module. This is just a limitation in the foresight of the guy writing the article you linked - he envisaged 16 appliances that could be controlled remotely corresponding to the 16 keys. Why not use two key-presses to activate an appliance - this technique is only limited by the ability of the user to remember the codes AND why not have it password protected so, when you "connect" thru to the telephone decoder the microcontroller won't allow any activation or deactivation without a 4 digit code being entered.

Human Error

Page 36: Home Automation using DTMF

36

If the equipment is not handled & installed safely, this can lead to the equipment being damaged, and the risk of the system crashing is high. Reliability

This occurs on a very rare occasions, depending on the age of the equipment it can have a effect on the system, but otherwise the technology in the home automation systems are all up to date.

5.3 Other limitations of home automation

The receiver must reside in a location where a signal with sufficient strength can be received from a cellular phone network.

The only person who can communicate with the control module is the person who will be successfully authenticated.

Only devices with electrical controlling input ports will be possible targets for control. The controlled devices will have I/O ports that will make communication with the receiver

possible. The receiver must have a power source (120V) attached at all times. Operation of the controlling unit is only possible through a cell phone with SMS messaging

capabilities. The controlling unit must be able to receive and decode SMS messages.

Page 37: Home Automation using DTMF

37

CHAPTER 6 CONCLUSION AND RECOMMENDATION It is evident from this project work that an individual control home automation system can be cheaply made from low-cost locally available components and can be used to control multifarious home appliances ranging from the security lamps, the television to the air conditioning system and even the entire house lighting system. And better still, the components required are so small and few that they can be packaged into a small inconspicuous container. The designed home automation system was tested a number of times and certified to control different home appliances used in the lighting system, air conditioning system, heating system, home entertainment system and many more (this is as long as the maximum power and current rating of the appliance does not exceed that of the used relay). The popularity and availability of the mobile and mobile network makes this kind of control very useful and powerful. The main advantages of the proposed system are its reliability, low cost, and wide area coverage. Future works for this system can be following - Adding SMS message to carry controlling commands as alternate way for DTMF tone. - Upgrading the system to control more than one machine at same time. Finally, this home automation system can be also implemented over Bluetooth, Infrared and WAP connectivity without much change to the design and yet still be able to control a variety of home appliances. Hence, this system is scalable and flexible. RECOMMENDATION In consonance with the project work and in view of the researched methods and undertakings in the project design, the following are recommended: • The department should help the students in getting components that are not locally available. • Students should be taught how to make embedded systems as the use of computer software in most project work makes it uneconomical, and the use of the conventional integrated circuits and logic gates makes the project work clumsy.

Page 38: Home Automation using DTMF

38

• Finally, this project can be further developed to control more than one home appliance at once through the use of short message service texts rather than voice dial though it will be more expensive and will require more relay circuits, making it a distributed control home automation system. Also, to cut the cost of mobile phone, the project may be implemented using standalone GSM modems that only perform specialised functions like text messaging and/or phone calls. This GSM modems often are cheaper and more reliable than GSM mobile phones.