VOICE INTERACTIVE SYSTEM FOR COLLEGE AUTOMATION Now-a-days every institution needs automation.

As a p a r t o f c o l l e g e a u t o m a t i o n , w e h a v e d e c i d e d t o d o a p r oj e c t “Voice Interactive System for College Automation”. O ur

project allows the user to know the student’s attendance and marks quickly through the telephone line without the

i n t e n t i o n o f t h e c o l l e g e a u t h o r i t y . I n t h e h a r d w ar e s i d e embedded system has been used. A 20 pin microcontroller 89C2051 is used because of its compatibility with o ur

hardware. This microcontroller controls the whole hardware. T e l e p h o n e l i n e i s u s e d f or c o m m u n i c a t i o n p ur p o s e . V i s u a l B a s i c h a s b e e n u s e d f or s o f t w a r e p r o gr a m m i n g . P r e s e n t a t i o n i n t h e c l a s s a n d o u t c o m e o f t h e u n i v e r s i t y ar e m a d e r e a c h a b l e t o t h e p a r e n t s b y o u r pr o j e c t . I t w i l l b e v e r y o b l i g i n g t o t h e parents to be acquainted with their son’s/daughter’s recital in the college.

1

1. INTRODUCTION Embedded system is a system is a system that lives inside another device and act as a hardware component of that device. An embedded system can be desirable once consisting of a processor, associated peripherals and software used for a specific purpose. The embedded system defined as the set of hardware controlled by software. Like any computing system an embedded system is a combination of software and hardware. In our Project a 20 pin Microcontroller AT89C2051 is used to control the whole hardware. The Microcontroller senses the DTMF signal through the DTMF decoder IC MT8870 and it responds according to the decoded signal. The circuit has an inbuilt Phone Ring sensor circuit and the system will take over the phone automatically using a 12 V relay. The microcontroller will receive the signal from the distance telephone and it decodes the signal and fetches the data from the PC through the serial port, based on the telephone signal, and sends the data through the telephone line. The objective of our project is to know the student’s attendance and marks quickly through the telephone without the intention of the college authority. By dialing the provided telephone number, one can able to dig up the information of the student. One of the advantages is the time spending for college officials in attempting phone calls from outsiders will be reduced.

2

2. PROJECT DESCRIPTION

2.1. BLOCK DIAGRAM

TELEPHONE LINE

DTMF DECODER VOLTAGE CONVERTER

PC SERIAL PORT

RING DETECTOR

MICRO CONTROLLER PC SPEAKER OUT

PERSONAL COMPUTER

ON/OFF HOOK SIMULATOR

INTERFACING CIRCUIT

Figure 2.1 Basic Block Diagram

3

2.2 BLOCK DIAGRAM EXPLANATION

The above Block diagram consist of following Blocks 1. Telephone section 2. DTMF Decoder 3. Ring Detector 4. ON/OFF hook Simulator 5. Microcontroller 6. Voltage converter 7. PC Serial Port 8. Personal Computer (PC)

1. TELEPHONE Invented by Bell and his assistant, Thomas A. Watson, the telephone marked a significant development in the history of electrical communication systems. In the earliest magneto-telephone of 1876, the speaker’s voice was converted into electrical energy patterns that could be send over reasonably long distances over wires to a receiver, which would convert these energy patterns back into the original sound waves for the listener.

Outgoing Call The dial pad, also called keypad or touch-tone pad, is used to dial telephone numbers as well as interact with voice processing system such as a voice mail and interactive voice response (IVR). The address signaling for an outgoing call can be accomplished by 3 different methods: pulse dial (rotary), real tone multiple frequency (DTMF), or multi frequency (MF)

4

Multi-Frequency (MF): It however became more popular with the introduction of dual tone multiple frequency (DTMF) mode of dialing. digits are transmitted at the rate of about 7 digits per second. Tone combination 700+900 700+1100 900+1100 700+1300 900+1300 1100+1300 700+1500 900+1500 1100+1500 1300+1500 Digit 1 2 3 4 5 6 7 8 9 0 Table. pay telephones. MF and DTMF signals are more reliable and considerably faster than pulse dial. In both methods.1.2. which make the designing such systems easy and reliable Multi-frequency signaling is similar to DTMF and is used on trunk circuit. Single chip DTMF encoders/decoders are available today. Multiple Frequency for Numbers Incoming call 5 . Combination of two tones is used to transmit signaling information.

A capacitor in the phone passes the AC but block DC. DTMF was not intended to be used for data transfer. power range.. 2 DTMF SIGNALING DTMF stands for Dual Tone Multiple Frequency.e. It is a tone consisting of two frequencies superimposed. five bits per second. the phone provides an audible signal that altos the user of an incoming call. It describes the frequency range. 6 .5 kHz. Individual frequencies are chosen such that it is easy to design filters and easy to transmit the tones through a telephone line having bandwidth of approximately 3. The -48Volts DC that is always on the line operates the telephone when it is being used. DC current begins to flow in the loop. Upon detecting the AC voltage.When a telephone set is called. and bias voltage range of the telephone set. The local exchange the current flow and removes the super imposed ring voltage. DTMF standard specifies 50ms tones and 600ms duration between two successive tones. the local exchange generates a high ring voltage of about 90-105Volts AC with a frequency of 20Hz superimposed over the minus (-) 48Volt DC.The REN is used to ensure that the local exchange can provide the correct amount of power required to ring the telephone. When the phone is answered. With standard decoders it is possible to send 10 beeps per second i. Each telephone set provide a ringer equivalent number (REN) as defined within FCC part 68 and EIA RS-470. it was meant to be used for sending the control signals along the telephone line.

The following graph is a captured screen from an oscilloscope. Our phone only uses 12 of the possible 16 tones. 697 Hz 770 Hz 852 Hz 941 Hz 1 4 7 * 2 5 8 0 3 6 9 # A B C Theory D Operation of DTMF Keypad Frequencies In DTMF there are 16 distinct tones. C2 and C3). It is a plot of the tone frequency for the "1" key: 7 . R2. There are four different frequencies in each group.1209 Hz 1336 Hz 1477 Hz 1633 Hz Table.2. The rows and columns select frequencies from the low and high frequency group respectively. R3 and R4) and 3 columns (C1.2. Each tone is the sum of two frequencies: one from a low and one from a high frequency group. If you look at your phone. there are only 4 rows (R1.

DTMF numbers telephones.Figure 2. The frequency of the tone is about 1900 Hz close to the 1906 Hz predicted by Table 3 (697+1209). but telephone exchanges use them quite Nowadays. The horizontal axis is in samples. Note often.7 MHz is normally used to send floating codes. If the lower frequency is loud. DTMF was designed to be able to send the codes using microphone. and this shift is termed as twist. 8 . The higher of the two frequencies is normally aloud by 4dB. If the twist is equal to 4dB. then the twist is said to be negative. configuring telephone exchanges etc.2 Tone frequencies for key “1” You can see that the DTMF generated signal is very distinct and clear. which are superimposed on amplitude. the higher frequency is loud by 4dB. that the last column is used is not for commonly dialing the seen in the in telephones that we used. Each beep (or digit you dial on the telephone) is composed of two concurrent frequencies. A CB transceiver of 2.

No frequency is a multiple of another. Generating DTMF DTMF signals can be generated through dedicated ICs or by using RC networks connected to a microprocessor. The frequencies were initially designed with a ratio of 21/19. The frequencies may not vary more than ±1. and the sum of any two frequencies does not equal any of the frequencies. as defined by the Precise Tone Plan. which is slightly less than a whole tone. or the switching center will ignore the signal.2. are selected such that harmonics and intermodulation products will not cause an unreliable signal.Event Busy signal Dial tone Ringback tone (US) Low frequency 480 Hz 350 Hz 440 Hz High frequency 620 Hz 440 Hz 480 Hz Table. But getting the latter method work is a bit difficult if high accuracy is needed. the difference between any two frequencies does not equal any of the frequencies. MT8880 is an example of a dedicated IC. The high frequencies may be the same volume or louder as the low frequencies when sent across the line. The loudness difference between the high and low frequencies can be as large as 3 decibels (dB) and is referred to as "twist".3.5% from their nominal frequency. Hence this method is used for simple 9 . The crystal frequency needs to be sacrificed for a non standard cycle length. DTMF Event Frequencies The tone frequencies.

Decoding DTMF Detecting DTMF with satisfactory precision is a hard thing. a PIC micro could be used for the above purpose. Most often. Again microprocessors can also be used. Often. An optocoupler MCT2E is used as ring detector. It is used to detect whether the Hand set is in ON hook condition or OFF hook condition so as to send the information to the microcontroller. a dedicated IC such as MT8870 is used for this purpose. but their application is limited.c signal is obtained by placing a resistor across the telephone line. Hence they can produce pretty good sine waves from distorted input. 3. RING DETECTOR: It is used to detect the ring signal from the telephone line. If ring is present –logic 0 Else-logic 1 Normal time voltage in telephone line=48V d.c OFF hook voltage-12V d. Hence it is preferred. A 12 V relay is used for the purpose.c Ring signal voltage-75V a.c 4. It uses two 6th order band-pass filters using switched capacitor filters and it suppresses any harmonics. ON–OFF HOOK SIMULATOR It is used to pickup the telephone electronically.applications. 10 . It gives out a logical output to the microcontroller. A 12 volt d.

elevators. e Microprocessor and Microcontroller Microprocessor and microcontroller stem from the basic idea. washers and The public is. dryers. microwaves. or the machinery they use to make those products. to have some “smarts”. toys. very well aware that TVs. What is the difference between the two? Microprocessor A microprocessor. and are sold the same type of system designers and system programmers. clock radios. video games. irons. The same fabrication techniques and programming concepts that make possible the general-purpose microprocessor also yielded the microcontroller. are made by the same people. or to many in the technical community. telephones. copiers. vending machines. however. MICROCONTROLLER A by-product of microprocessor development was the microcontroller. “something” is responsible for all of the smart VCRs. 11 . Micro controllers are not as well known to the general public. is a general-purpose Although digital computer as a central processing on a unit (CPU). microprocessor is in no sense a complete digital computer. Companies are also aware that being competitive in this age of the microchip requires their products. as the term has come to be known. and a myriad of other articles that are intelligent and “programmable”.5. as are the more glamorous microprocessor. the popularly known “computer chip”. automobiles.

a stack pointer (SP). yields a small computer that can be applied to a range of general-purpose software applications. and interrupt circuits. some working registers.3 Block Diagram of a Microprocessor This block diagram contains arithmetic and logic unit (ALU).2. and I/O peripherals.Arithmetic and logic unit Accumulator Working Register(s) Program counter Stack pointer Clock circuit Interrupt circuit Figure . and a number of input/output (I/O) devices. a clock timing circuit. a program counter (PC). To make a complete microcomputer. memory decoders. commonly a floppy and hard disk drives. an oscillator. such as interrupt handlers and counters. 12 . may be added to relieve the CPU from time consuming counting or timing chores. usually read-only program memory (ROM) and random-access data memory (RAM). one must add memory. such as keyboard and a CRT display. Equipping the microcomputer with mass storage devices.

The prime use of a microprocessor is to read data. The design of the microprocessor is driven by the desire to make it as expandable and flexible as possible. and store those calculations in a mass storage device or display the results for human use.The hardware design of a microprocessor CPU is arranged so that a small or very large system can be configured around the CPU as the application demands. in the expectation of commercial success in the marketplace. perform extensive calculations on the data. The programs used by the microprocessor are stored in the mass storage device and loaded into RAM as the user directs. A few microprocessor programs are stored in ROM. The ROM-based programs are primarily small fixed programs that operate peripherals and other fixed devices that are connected to the system. Microcontroller 13 .

purpose device. a microcontroller is a general. serial I/O. PC. and register. which is a true computer on a chip. but one that is meant to read data. It also has added other features needed to make a complete computer: ROM. and a clock circuit Like the microprocessor. perform 14 .4 Block Diagram of Microcontroller The above figure shows the block diagram of a typical microcontroller. The design incorporates all of the features found in a microprocessor CPU: ALU.2. counters. parallel I/O.ALU Timer/ counter I/O port Accumulater Register(s) I/O port Internal RAM Internal ROM Interrupt circuit Stack pointer Clock circuit Program counter Figure. RAM. SP.

Many instructions are coupled with pins on the integrated circuit pakage. hopefully. microcontroller will have many. The microprocessor design accomplishes this goal by having a very flexible and extensive repertoire of multi byte instructions. the pins are programmable that is. 15 .limited calculations. microcontrollers may have one or two. the architecture and instruction set are optimized to handle data in bit and byte size. The prime use of a micro-controller is to control its environment based on those calculations. The design approach of the microcontroller mirrors that of the microprocessor: make a single design that can be used in as many applications as possible in order to sell. The prime use of a microcontroller is to control the operation of a machine using a fixed program that is stored in ROM and that does not change over the lifetime of the system. The microcontroller is concerned with getting data from and to its own pins. These instructions work in a hardware configuration that enables large amounts of memory and I/O to be connected to address and data bus pins on the integrated circuit package. Microprocessors may have one or two types of bit handling instructions. capable of having several different functions depending on the wishes of the programmer. Microprocessors Vs Microcontroller The contrast between a microcontroller and a microprocessor is best exemplified by the fact that most microprocessors have many operational codes (opcodes) for moving data from external memory to the CPU. Much of the activity in the microprocessor has to do with moving code and data to and from external memory to the CPU. as many as possible.

1. and internal RAM and ROM. Sixteen and 32 bit units are used in high speed control and signal processing applications • Many models feature programmable pins that allow external memory to be added with the loss of I/O capacity. Most integrated circuit memories and many logic functions are arranged in an 8. Four bit units are produced in huge volumes for very simple applications.byte word is adequate for many control and monitoring applications. Eight bit Microcontrollers Eight bit has proven to be a very useful world size for small computing tasks. and serial I/O. • Microprocessors contain a CPU.The fundamental differences between microprocessors and microcontrollers are these: • Microprocessors re intended to be general purpose digital computers whereas microcontrollers are intended to be special purpose digital controllers. 16 . Microcontrollers have these features as well as timers. Serial ASCII data is also stored in byte sizes. • Microcontroller models vary in data size from 4 to 32 bits. memory addressing circuits.bit configuration that interfaces easily to data busses of 8 bits. and 8-bit units are the most versatile. and interrupt handling circuits. making 8 bits the natural choice for data communications. parallel and serial I/O.

and the designer can order the ROM version in large quantities from the factory. but differ in the amount of internal ROM. 17 . away license Many to semiconductor whoever asked) manufacturers or developing a started new either kind of manufacturing the 8031 devices as such (Intel was liberal in giving microcontrollers based on 8031 core architecture. others have special features such as analog-todigital and digital-to-analog converters on the chip. Many times the ROM version is never used.Application sophistication can also range from simple appliance control to high speed machine control and data collection. or production volumes never justify the cost of a factory ROM implementation. RAM. As a further enticement for the buyer. in some cases. and other cost sensitive features. the microcontroller has no on-board ROM at all. All feature a common language. or the ROM is an electrically reprogrammable read only memory [EPROM]. some families have members with fewer external pins to shrink the package and the cost. For these reasons the microcontroller vendors have established extensive families of similar models. this 8031 architecture gained enviable market acceptance. Often the memory can be expanded to include off.chip ROM and RAM. The ROM less or EPROM versions can be used by the designer to prototype the application. The designer makes the ROM less or EPROM design sufficiently general so that on configuration may be used many times. 8051 Derivatives Along the way.

With the basic 8031 core. Almost every decent manufacturer boasted of having an 8031 based microcontroller in the line card. A smart card controller was also developed by incorporating a cryptographic engine. Philips developed many consumer devices meant for telecom. Devices became available in regular DIP and SMD packages. 18 . electronic community started getting a variety of 8031 based devices with range of options. So Philips clearly established itself as the market leader in 8031 derivatives and still caters to this segment. PWM facilities and etc. came the birth of High speed 8031 Derivatives.Manufacturers modified the basic 8031 architecture and added many new peripheral functions to make them attractive to the designers. manufacturers developed different microcontrollers with many unique features. second serial port was also made available in Philips devices. To beat the competition. CAN Bus. First major manufacturer was the Philips who brought out more than 40-50 derivatives with a variety of I/O options. More I/O ports (as many as eight ports). Dallas redesigned the 8031 architecture and eliminated waste clock cycles of original core and made all instructions executed in less clock cycles (maximum of 4) which have traditionally taken upto 12 clock cycles. memory combinations. additional timer/counter. Philips ported high capacity Program Memory (upto 32K/64K). Then come Dallas semiconductor. Because of the rush. Apart from all these. Capture and Compare registers. So. and peripheral functions. 8/10 bit Analog to Digital Converters. its patented I2C interface bus. Watch dog timer. computer and TV applications. These parts are popularly known as ‘8031 Derivatives’.

Meantime. 8031 core is still going strong in 8 bit arena. Dallas has combined this microcontroller.Even after many years of introduction. You can program/reprogram this microcontroller after soldering the device in the target board. memory contents. Atmel devices sport security lock to its flash memory to protect the contents from the prying eyes.Dallas semiconductor also has got a range of secure microcontrollers based on 8031 core. This microcontroller family uses non volatile RAM to keep both program and data. As you can agree. 19 . This 8031 also boasts the tamper proof security features like Real Time Memory Encryption. SRAM and lithium cell in a single pack. Intel itself tried to cash in the popularity of this 8031 architecture and introduced improved versions of microcontrollers: 80151 and 80251 families. then the tasks like remote calibration. security lock and the facility to hide interrupt vector table. this particular 8031 device has found a niche market in banking and security related applications. Atmel used its expertise in flash memory technology into the basic 8031 core and brought out microcontrollers with a variety of flash memory options and few devices also carry In System Reprogramming facility. onsite system upgradation become as easy as sending your data/program in a floppy disk or by internet. These devices sport 16 bit architecture using 8031 core and unfortunately these devices have not become as popular as 8031. Because of this RAM. user selected 48 bit Encryption key. If this programming facility is embedded in the system software. This device guarantees 10+ years of data retention in the RAM area. Atmel Corporation is the major semiconductor manufacturer who introduced many flash memories based 8031 derivatives at a competitive cost. the controller gives the In System Reprogram ability.

To indicate the address of the location. One of the four banks of registers is to be predefined in the PSW before using register addressing instruction. and then the source. Register Indirect Addressing 4. an additional byte is 20 . (the Boolean Accumulator) can also be addressed in this mode. Immediate Addressing 5.Addressing Modes 8031's assembly language instruction set consists of an operation mnemonic and zero to three operands separated by commas. The least significant three bits of the instruction opcode indicate which register is to be used for the operation. Byte wide mnemonics like ADD or MOV use the Accumulator as a source operand and also to receive the result. DPTR and CY. ACC. B. The 8031 supports five types of addressing modes: 1. Register Addressing 2. Index Addressing Register Addressing Register Addressing accesses the eight working registers (R0 R7) of the selected register bank. Direct Addressing 3. In two byte instructions the destination is specified first. Direct Addressing Direct addressing can access any on chip variables or hardware register.

Note that the special function registers are not accessible in this mode. Execution of PUSH and POP instructions also involve indirect register addressing. All I/O ports. Register Indirect Addressing Register indirect addressing uses the contents of either R0 or R1 (in the pre selected register bank) as a address pointer to locate in a 256 byte block (the lower 128 bytes of internal RAM in 8031 or 256 bytes in 8032) or the lower 256 bytes of external data memory.attached to the opcode. Immediate Addressing When a source operand is a constant rather than a variable. then the constant can be embedded into the instruction itself. Depending on the highest order bit of the direct address byte one of two physical memory space is selected. The Stack Pointer indicates the correct stack location anywhere in the internal RAM. When direct addressing indicates any location in this range. control registers are assigned between 128 and 255 (80H FFH). corresponding hardware register is accessed. This is the only method available for accessing I/O ports and special function registers. special function. When the direct address range is between 0 and 127 (00H 7FH) one of the 128 low order on chip RAM location is accessed. This kind of instructions takes two bytes and first one specifies the opcode and second byte gives the required constant. Access to full 64K external data memory address space is indicated by the 16 bit Data Pointer register. 21 . DPTR.

Of course the reason a pc can perform myriad tasks is that it has RAM memory and an operating system that loads the application software into RAM memory and lets the CPU run it. For example. In an Embedded system. A printer is an example of embedded system since the processor inside it performs one task only. or Internet terminal. namely getting the data and printing it. print-server. An x86 PC contains or is connected to various embedded products such as keyboard. A PC can be used for any number of applications such as word processor. printer.Index Addressing Only the Program Memory can be accessed by this mode. Software for a variety of applications can be loaded and run. mouse. there is only one application software that is typically burned into ROM. inside every mouse there is a Microcontroller to perform the task of finding the mouse position and sending it to the PC. we often see the term Embedded System. Video game. modem. network server. 22 . An embedded system product uses a microprocessor (or Microcontroller) to do one task only. Each one of these peripherals has a Microcontroller inside it that performs only one task. disk controller. CD-ROM drives. Microprocessors and Microcontrollers are widely used in embedded system products. bank teller terminal. sound card. This mode is intended for reading lookup tables in the Program Memory. and so on. Contrast this with a Pentium based PC. Microcontrollers for Embedded Systems In the Literature discussing microprocessors. A 16 bit base register (either DPTR or the Program Counter) points to the base of the lookup tables and the Accumulator carries the constant indicating table entry number.

An external crystal oscillator is used for its operation. 23 . PC SERIAL PORT This port is used to get data from microcontroller to personal computer in serial manner. they work in different ways. Parallel ports are typically used to connect a PC to a printer and are rarely used for much else. This allows data to be transferred very quickly. however. 7. VOLTAGE CONVERTER This is used to convert TTL logic voltage into RS232 voltage. A parallel port sends and receives data eight bits at a time over 8 separate wires. A serial port sends and receives data one bit at a time over one wire. All IBM PC and compatible computers are typically equipped with two serial ports and one parallel port. only a few wires are required.6. Although these two types of ports are used for communicating with external devices. the cable required is more bulky because of the number of individual wires it must contain. While it takes eight times as long to transfer each byte of data this way. TTL Logic: logic 1= 5v logic 0= GND RS232 IC : logic 1= +9v logic 0= -9v MAX232 is used as voltage converter.

the Atmel AT89C2051 is a powerful microcomputer 24 .In fact. high-performance CMOS 8-bit microcomputer with 2 Kbytes of Flash programmable and erasable read only memory high By (PEROM).one to send. 8. and a common signal ground wire. INTERFACING CIRCUIT This is used to interface the audio signal from the computer to the telephone line. one to receive. The device is manufactured nonvolatile a versatile memory 8-bit CPU technology with using is a Atmel’s pinout.1 MICROCONTROLLER The AT89C2051 is a low-voltage. two-way (full duplex) communications is possible with only three separate wires . density and on compatible with the industry standard MCS-51 instruction set and combining Flash monolithic chip. HARDWARE DECSRIPTION 3. 3.

which provides a highly flexible and cost effective solution to many embedded control applications. The AT89C2051 provides the following standard features: 2 Kbytes of Flash, 128 bytes of RAM, 15 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry.

In addition, the AT89C2051 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power Down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

3.1.1 Pin Configuration

The microcontroller AT89C2051 is available in 20 pin Dual Inline Package (DIP).

25

Figure.3.1 Pin diagram of AT89C2051

3.1.2 Block Diagram

26

Figure.3.2 Block Diagram of AT89C2051

27

3.1.3 Pin Description

VCC Supply voltage. GND Ground. Port 1 Port 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7 provide internal pullups. P1.0 and P1.1 require external pullups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are externally pulled low, they will source current (IIL) because of the internal pullups. Port 1 also receives code data during Flash programming and program verification.

Port 3 Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional 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 not accessible as a general purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C2051 as listed below:

28

Each machine cycle takes 12 oscillator or clock cycles. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.Table 3. Holding the RST pin high for two machine cycles while the oscillator is running resets the device. All I/O pins are reset to 1s as soon as RST goes high. 29 . XTAL2 Output from the inverting oscillator amplifier.1 Alternate Functions of port 3 Port 3 also receives some control signals for Flash programming and programming verification. RST Reset input.

1. To drive the device from an external clock source.4 Oscillator Characteristics XTAL1 and XTAL2 are the input and output. There are no requirements on the duty cycle of the external clock signal. of an inverting amplifier which can be configured for use as an on-chip oscillator. but minimum and maximum voltage high and low time specifications must be observed.2 DTMF Decoder The MT8870 is a single chip DTMF receiver in corpora ting switched counting capacitor / filter technology for and an advanced digital The averaging algorithm period measurement. XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2. as shown in Figure 1.two flip-flops. Either a quartz crystal or ceramic resonator may be used.3. respectively. 30 . since the input to the internal clocking circuitry is through a divide by. Figure. functional block diagram of MT8870 is shown in the below figure depicts the internal working of this device.3 Oscillator Connections 3.3.

The signal is still in its individual components by two 6th order switched capacitor band pass filter. Dial tone at 350 and 440Hz is then rejected by a 3rd order switched capacitor notch filter. which performs ant aliasing function.3. The two resulting rectangular waveforms are then applied to a digital circuit. where a counting algorithm measures and averages there periods. An accurate reference clock is derived from an inexpensive external 3.Figure.58MHz crystal. The input stage is followed by a low pass RC active filter. Each component smoothed by an output filter and squared by a hard limiting comparator.4 Functional diagram of IC MT8870 The DTMF signal is first buffered by input op-amp that allows adjustment gain and choice of input configuration. 31 .

The time required to detect a valid tone pair tdP is a function of decode algorithm. the DTMF signal is decoded and the resulting data latched on the output register.2.1Tone detection After receiving a DTMF tone the DTMF decoder (MT8870) places the corresponding binary number on its out put (StD) goes high to state that new data is available. determined by an external RC network. 32 . Est (early. steering output) indicates that two tones of valid frequency have been detected and initiates an RC timing circuit. The delayed steering output (stD) is raised to indicate that new data is available. The detection of the delayed steering output is to the duration of the received DTMF receiver has already been explained. tone frequency. and the previous state of the decoded logic. If both tones are present for a minimum guard time. (The output corresponding to each key pressed is shown in the truth table) 3.

3.2.2 PIN DIAGRAM OF IC MT8870 Figure.5 Pin Diagram of IC MT8870 33 .3.

3.2 Pin description of IC MT8870 34 .Pin Description Table.

the bandwidths of which correspond to the low and high group frequencies. Its architecture consists of a band split filter section.3 Functional Description The MT8870D/MT8870D-1 monolithic DTMF receiver offers small size.3 Operating conditions of IC MT8870 3. which separates the high and low group tones.Recommended Operating Condition Table: 3. followed by a digital counting section which verifies the frequency and duration of the received tones before passing the corresponding code to the output bus. Each filter output is followed by a single order switched capacitor filter section which smoothes the 35 . low power consumption and high performance. The filter section also incorporates notches at 350 and 440 Hz for exceptional dial tone rejection (see Figure 3).2. Filter Section Separation of the low-group and high group tones is achieved by applying the DTMF signal to the inputs of two sixth-order switched capacitor band pass filters.

allows the designer to tailor performance to meet a wide variety of system requirements. The outputs of the comparators provide full rail logic swings at the frequencies of the incoming DTMF signals. When the detector recognizes the presence of two valid tones (this is referred to as the “signal condition” in some industry specifications) the “Early Steering”(ESt) output will go to an active state. Decoder Section Following the filter section is a decoder employing digital counting techniques to determine the Frequencies of the incoming tones and to verify that they correspond to standard DTMF frequencies. This averaging algorithm has been developed to ensure an optimum combination of immunity to talk-off and tolerance to the presence of interfering frequencies (third tones) and noise. This facility. as well as rejecting signals too short to be considered valid. Limiting is performed by high-gain comparators which are provided with hysteresis to prevent detection of unwanted low-level signals. 36 . the receiver will tolerate signal interruptions (dropout) too short to be considered a valid pause. A complex averaging algorithm protects against tone simulation by extraneous signals such as voice while providing tolerance to small frequency deviation and variations. together with the capability of selecting the steering time constants externally. Thus. Any subsequent loss of signal condition will cause ESt to assume an inactive state. The steering circuit works in reverse to validate the inter digit pause between signals.signals prior to limiting.

Environments such as fast acquisition time and immunity to tone drop-outs are required.3. 37 . Different steering arrangements may be used to select independently the guard times for tone Present (tGTP) and tone absent (tGTA). It stops the oscillator and the functions of the filters. and D. Component values are chosen according to the formula: tREC=tDP+tGTP tID=tDA+tGTA The value of tDP is a device parameter and tREC is the minimum signal duration to be recognized by the receiver. Inhibit mode is enabled by a logic high input to the pin 5 (INH). a relatively short tREC with a long tDO would be appropriate for extremely noisy. The output code will remain the same as the previous detected code. This may be necessary to meet system specifications which place both accept and reject limits on both tone duration and interdigital pause. B.2. It inhibits the detection of tones representing characters A. Power-down and Inhibit Mode A logic high applied to pin 6 (PWDN) will power down the device to minimize the power consumption in a Stand by mode. Alternatively. Increasing tREC improves talk-off performance since it reduces the probability that tones simulated by speech will maintain signal condition long enough to be registered. the simple steering circuit shown in Figure 4 is applicable.4 Guard Time Adjustment In many situations not requiring selection of tone duration and inter digital pause. C. Guard time adjustment also allows the designer to tailor system parameters such as talk off and noise immunity.

The oscillator output of the first device in the chain is coupled through a 30 pF capacitor to the oscillator input (OSC1) of the next device. i. Subsequent devices are connected in a similar fashion..579545 MHz crystal and is normally connected as shown in Figure (Single.e. the input pins are connected as shown in Figure 10 with the op-amp connected for unity gain and VRef biasing the input at 1/2VDD. Crystal Oscillator The internal clock circuit is completed with the addition of an external 3. it is possible to configure several MT8870D/MT8870D-1 devices employing only a single oscillator crystal. In a single-ended configuration. Provision is made for connection of a feedback resistor to the op-amp output (GS) for adjustment of gain. 38 .Ended Input Configuration).However.Differential Input Configuration The input arrangement of the MT8870D/MT8870D-1 provides a differential-input operational amplifier as well as a bias source (VRef) which is used to bias the inputs at mid-rail. precision balancing capacitors are not required. Figure 6 shows the differential configuration. The problems associated with unbalanced loading are not a concern with the arrangement shown. which permits the adjustment of gain with the feedback resistor.

6 Features • Complete DTMF Receiver recommended for most applications. leaving R to be selected by the designer • Low power consumption • Internal gain setting amplifier • Central office quality • Power-down mode • Inhibit mode • Backward compatible with MT8870C/MT8870C-1 39 .2.4: Tone Decoding of MT8870 3.2.3.5 Tone Decoding of MT8870 Table 3.

particularly applications where ±12V is not available.3 VOLTAGE CONVERTER (MAX232) The intended MAX220–MAX249 for all family and of line drivers/receivers is EIA/TIA-232E V.24 communications interfaces.28 Specifications Multiple Drivers and Receivers 3-State Driver and Receiver Outputs 40 . Feature • • • • • Operate from Single +5V Power Supply Low-Power Receive Mode in Shutdown Meet All EIA/TIA-232E and V.2. since their low-power shutdown mode reduces power dissipation to less than 5μW.7 Applications • Paging systems • Repeater systems/mobile radio • Credit card systems • Remote control • Personal computers • Telephone answering machine 3. These parts are especially useful in battery-powered systems.3.28/V.

One advantage of the MAX232 chip is that it uses a+5V power source which is the same as the source voltage for the 8051. with no need for the dual power supplies that are common in many older systems.6 Pin Diagram of MAX232 Since the RS232 is not compatible with today’s microprocessors and microcontrollers. 41 . One example of such a converter is MAX232 from Maxim Corp. with a single +5 V power supply we can power both the 80551 and MAX232. The MAX 232 converts from RS232 voltage levels to TTL voltage levels.1 PIN Diagram Figure. In other words.3.3. and vice versa.3. we need a line driver (voltage converter) to convert the RS232’s signals to TTL voltage levels that will be acceptable to the 8051’s TxD and RxD pins.

2 Functional Diagram of MAX232 Figure. respectively.7 Functional Diagram of MAX232 The MAX232 has two sets of line drivers for transferring and receiving data. as shown in Figure 10-7.3. T1 and R1 are used together for TxD and RxD of the 8051 and the second set is left unused. In many applications only one of each is used for example.3. The line drivers used for TxD are called T1 and T2 while the line drivers for Rxd are designated as R1 and R2.3. The T1 in pin is the TTL side and is 42 . Notice in MAX232 that the T1 line driver has a designation of T1 in and T1 out on pin numbers 11 and 14.

3.3 APPLICATIONS • • • • • Portable Computers Low-Power Modems Interface Translation Battery-Powered RS-232 Systems Multidrop RS-232 Networks 43 . while T1 out is the RS232 side that is connected to the RxD pin of the RS232 DB connector. 3. See figure 10-7. respectively.connected to TxD of the microcontroller. and R1 out (pin 12) is the TTL side that is connected to the RxD pin of the microcontroller. The R1 line driver has a designation of R1 in and R iout on pin numbers 13 and 12. The most widely used value for these capacitors is 22nf. Notice the null modem connection where RxD for one is TxD for the other. The R1 in (pin 13) is the RS232 side that is connected to the TxD pin of the RS232 DB connector. MAX232 requires four capacitors ranging from 1 to 22F.

1 Circuit Diagram 44 .4. CIRCUIT DIAGRAM Figure.4.

The DTMF signal from the Telephone was decoded by the Decoder IC MT8870. At normal time the voltage across the telephone line is 48v and when a ring arrives then a voltage of 74v AC is injected through the telephone and this AC will pass through the capacitor C4 and though the zener diodes to the LED in the optocoupler and it will conduct and this light will conduct the photo transistor and therefore a low signal was fed to the microcontroller and it will then switch on the Hook Relay of a telephone.1 CIRCUIT OPERATION When the telephone ring arrives the ring sensor detects it and it will send a signal to the microcontroller. The main part of the circuit was done by the Microcontroller AT89C2051. The data from the microcontroller was fed to the PC through a voltage converter. The data from the computer serial port was in RS232 logic. The Decoder get the DTMF signal from Telephone line and this decoded digital signal was fed to the Microcontroller. The microcontroller will sent the decoded DTMF signal to the PC through its serial port. The Microcontroller will then take the phone with help of ON/OFF hook simulator and it will sense the DTMF signal and it will get the DTMF signal and the Microcontroller will switch on the corresponding Relay. That is for logic 1 the voltage is –9V and for logic 0 the voltage is +9V and at TTL side the Voltage for logic 1 is +5V and for 45 .4. The DTMF receiver will decode the tone signal into digital which was fed to the microcontroller for further control.

There fore for connecting this two section (RS232 and TTL) we need a converter. 4. This will turn ON the 46 . The data from the PC is fed to the converter and the converter converts the data into TTL logic which is fed to the microcontroller. This IC has two sets of converter in which we are using a set. When the telephone handsets are in on-hook position. pulling it’s collector towards ground. transistor T1 gets forward biased and it conducts. AC ringing current so that the optocoupler get turned ON (the diode antiparallel with the LED) an optocoupler provide condition during the negative half cycle of the ringing current. The telephone line is connected to the ring sensor (optocoupler IC MCT2E) will detect this signal and the capacitor C2 (1µf/25v) bypasses the 13. In this circuit optocoupler is used to sense the ring signal. Initially when the handsets of all the telephones are on the cradles. As the result. The transistor output available at the emitters are inverted to logic 1 state and applied to the Microcontroller.1 Telephone Ring sensor This Circuit can be used to connect any telephone to the telephone line. However the ring signal passes to telephone in parallel since the telephone line is connected to the telephone instruments through combination of inbuilt LEDs of optocouplers in parallel with reverse diodes while the ‘-‘marked telephone line is connected to the relay. A ring voltage from exchange is around 70 to 90volt (25 HZ AC) come via telephone lines. the optocoupler will not conduct adequately and as such the emitters of inbuilt transistors of optocouplers are at low level.5mA to60maA. the current through the optocoupler LEDs is inadequate to activate their inbuilt transistors. The Converter used in our circuit is IC MAX232.logic 0 is 0V.1.

Optocoupler (IC MCT2E) The MCT2E optoisolators consist of a gallium arsenide infrared emitting diode driving a silicon phototransistor in a 6-pin dual in-line package. Here an optocoupler is used for ON/OFF hook detection. to get a closed loop connection with the exchange for communication. that the subscriber was ready for communication. The audio signal is extended to the ON/OFF hook detector (Optocoupler IC). there by a closed loop circuit is formed between Subscribers and Telephone exchange. Once the hand set is picked up means the µc will sent a acknowledgement signal to the µc at the designation side . the hand set is first picked up to conform that the in coming signal is Voice or Message . This will Ceases the DC voltage across the phone line. If it is a Voice signal means the ON/OFF hook detector function is same and the Hand set is used for Voice communication.After that the subscriber can place the hand set with the base set.If the telephone hand set is ON hook condition means the telephone Line consist of 48v. which connect a 10k resistor (R2) across the Telephone Line.so that the hook detector will provide voltage drop in the Land line voltage. 47 . If the telephone line is used for message Tx and Rx means. Once the hand set is placed with the base set after the voice or message communication means the Relay connected with Ring sensor get deenergized and Telephone line is disconnected by the µc.relay by providing the magnetizing current. So that the exchange detect a signal from the subscribers. The conduction of photodiode emits light towards photo transistor and there by it gets the GND. it gets this 48v as input and the photodiode acquire a conduction voltage around 12v by the use of resistor R1.

MCT2-M Schematic Diagram Figure.Figure. eg.42 Phototransistor Optocouple Feature • UL recognized (File # E90700) • VDE recognized (File # 94766) • MCT2 and MCT2E are also available in white package by specifying -M suffix.4.3 Schematic diagram of optocoupler 48 .

COLLECTOR 6. indicating ON-hook. This circuit is referred as the local loop circuit. OFF. ANODE 2. Once the hand set is picked up means it is in off hook condition and now the voltage reduces to 47v to 48v and (it is given to input on ON/OFF hook detector optocoupler IC)Cradle switch closes to form a closed loop circuit with the exchange battery and the telephone circuit. hang up. EMITTER 5.2 ON/OFF HOOK SIMULATOR During ring signal 70 to 90V rms at 20 -25HZ AC will come through the telephone line from the Exchange battery. CATHODE 3. The outgoing signaling refers signal reaching the exchange from the subscribers telephone. 49 .1. dialing etc. If the loop current is 13. NO CONNECTION 4. Exchange battery voltages are typically 48 volts.hook.5mA the exchange interprets it as ON hook condition.PIN 1. The loop current is used by the exchange to establish ON/OFF hook status of the telephone. BASE Application • Power supply regulators • Digital logic inputs • Microprocessor inputs 4.5mA to 60mA the exchange detects it as OFF hook condition and if the loop current is less than 7.

1 RELAY The relay is one of the most widely used components in industrial electronics.In pulse dialing telephones register signaling is known as DC loop signaling.2.The ring signal is 70. Contacts. Contacts which are open when the relay is not energized are called normally open (NO) or simply open contacts.90v rms at 20 -25HZ. In combination with transistors. In this case the dialed number is conveyed to the exchange by “make” and “break” of loop circuit. Relays are electro magnetically operated remotely controlled switches with one or more sets of contacts.5v to 1 volt and the maximum out going voice voltage is abut 2v rms. which are closed when the relay is not energized.The operated line voltage is about 50v DC and the incoming voice voltage to the telephone instrument varies from 0. SCRs. and other circuit element. the relay operates to open or close its contacts or to open some contacts and close others. When energized. the microcontroller will switch on the RELAY to achieve OFF hook condition.1. capacitors in power system and in telephone and in other communication systems. This relays are used as protective device for switching. 50 . this electromagnetic device performs countless tasks. inductors. for indicating and for transmission. 4. Transmission relays are used in conjunction with transformers. electron tubes. When a ring signal is present. are called normally closed contacts.

using low control voltage. one normally closed (NC) contact and one normally open (NO) contacts. Relays are electro magnetic components which has an operating coil and contact. 51 . The electrical terminals should be fabricated in such away that there shall be one common terminal. The power circuit and control circuit are practically isolated. When the relay is not energized the connection is closed between common and NO contacts this state is reversed when the relay is energized this relay circuit shall be used to switch on other power circuits.Figure. an iron core attached to this assembly gets magnetized. The operating principle of relays is as follows when the coil is energized. An adjustment or adjustments are usually provided to set restraining force to cause the relay to operate within predetermined circuit conditions. Accordingly relays are available with AC\DC operating coils of various magnitudes say from 6V DC to 220 V DC or for AC voltages ranging from 20V AC to 440 AC. This then attracts an armature which has electrical connected to it.4 Relay Relay contact are held in their normal position either by spring or by some gravity activated mechanism. The coil shall be energized with AC or DC supply.4.

This is called pickup point and is specified by it circuit or voltage by the manufacturer when the circuit in the coil is gradually decreased. Noble metal alloys are used for the contact material to reduce oxidation that causes oxidation that causes high resistance the bifurcated contact has two surfaces for less contact resistance at lower activating force 52 . The delay is about 100ms or longer to prevent contact release at each polarity reversal on 60 Hz operation. The contacts in an electromagnetic relays make or break the connection in electric circuits high current contacts are usually of the single button or by bifurcated style. The shading also causes are relays to be inherently slower to release than dc relays if the same size. If this were not the case the relay would hum or chatter at a 60Hz rate and contact position would be undetermined. a point will be reached where the armature snaps (closing the gap) and closes the normally opened contact (NO). A shaded pole is a conducting ring that creates a magnetic field that lays the applied field. This is called the dropout circuit (or voltage) and is usually considered less than the pickup current (or voltage) the only noticeable physical difference between AC and DC relays with the same rating is the addition of the shaded pole at the end of the core. If the circuit in the coil is slowly increased from 0.Relay Construction A relay is an electrically controlled device that open and close electrical contact affecting other contacts (devices) in the same or other circuits. a point were the flux is too week to hold the gap closed is reached and the armature snaps open. Operation of the relay is discussed below. prohibiting the rapid collapse of the flux across the gap.

however. the cable required is more bulky because of the number of individual wires it must contain.1. except for roughening of a contact faces. A serial port sends and receives data one bit at a time over one wire. they work in different ways.3 Serial Ports in Computer All IBM PC and compatible computers are typically equipped with two serial ports and one parallel port. two-way (full duplex) communications is possible with only three separate wires . 4. Any metal transfer is generally eliminated. 53 . and a common signal ground wire. The DC arcing are Spark discharge is damaging and will cause metal to transfer from the negative contact to the positive contact. Parallel ports are typically used to connect a PC to a printer and are rarely used for much else. Contact arcing is more common in DC than in AC circuit interruption the AC circuits go through 0 voltages at each half cycle and extinguish any arcing that occurs. A parallel port sends and receives data eight bits at a time over 8 separate wires. In fact. one to receive.The core bar contacts are used for dry circuit (NO or little current flow) and are made of gold to hinder and oxidation for low level (milli volts or micro volts) Switching circuit. While it takes eight times as long to transfer each byte of data this way. Although these two types of ports are used for communicating with external devices.one to send. only a few wires are required. This allows data to be transferred very quickly.

Serial flow is a stream of bits over a single wire (such as on the transmit or receive pin of the serial connector). etc. Computer programs can send data (bytes) to the transmit pin (output) and receive bytes from the receive pin (input). another pin (wire) is signal ground. ethernet boards. 54 . The voltage on any wire is measured with respect to this ground. There are many types of I/O devices such as serial ports. For the serial port to create such a flow.Introduction to Serial Port The UART serial port (or just "serial port for short" is an I/O (Input/Output) device. universal serial buses. Pins and Wires Old PC's used 25 pin connectors but only about 9 pins were actually used so today most connectors are only 9-pin. it must convert data from parallel (inside the computer) to serial on the transmit pin (and conversely). parallel ports. It converts the data from parallel to serial and changes the electrical representation of the data. An I/O device is just a way to get data into and out of a computer. Besides the two wires used for transmitting and receiving data. Each of the 9 pins usually connects to a wire. Most PC's have one or two serial ports. data bits flow in parallel (using many wires at the same time). disk drive controllers. The other pins are for control purposes and ground. Each has a 9-pin connector (sometimes 25-pin) on the back of the computer. The serial port is much more than just a connector. Inside the computer.

other wires may tell the modem to hang up the telephone line or tell the computer that a connection has been made or that the telephone line is ringing (someone is attempting to call in). depending on the number you have selected.the transmit line and the signal ground. Conversely. Communicating By Bits Once the start bit has been sent. the transmitter sends the actual data bits. There may either be 5. Some types of serial devices support only one-way communications and therefore use only two wires in the cable . but instead.Thus the minimum number of wires to use for 2-way transmission of data is 3. there is a separate dedicated wire for every type of signal. Modem control wires are either in the asserted state (on) of +12 volts or in the negated state (off) of -12 volts. One of these wires is to signal the computer to stop sending bytes out the serial port cable. All of these signals could have been shared on a single wire. Except that it has been known to work with no signal ground wire but with degraded performance and sometimes with errors. it uses separate lines for transmitting and receiving data. Both receiver and the transmitter must 55 . 6. Bi-Directional Communications The serial port on your PC is a full-duplex device meaning that it can send and receive data at the same time. 7. another wire signals the device attached to the serial port to stop sending bytes to the computer. Some (or all) of these control wires are called "modem control lines". In order to be able to do this. or 8 data bits. There are still more wires which are for control purposes (signaling) only and not for sending bytes. If the attached device is a modem.

While it will tell you if there is a single bit error in the character. For example. You can choose even parity. When even or odd parity is being used.5. to help detect data corruption that might occur during transmission. Likewise. if 56 . as well as the baud rate. Stop bits can be 1. A stop bit has a value of 1 . it doesn't show which bit was received in error. odd parity. 1. For the binary value of 0110 0011 the parity bit would be 0. Almost all devices transmit data using either 7 or 8 data bits. Odd parity is just the opposite. Notice that when only 7 data bits are employed. If even parity was in effect and the binary number 1101 0110 was sent. when even parity is chosen. using 5 bits limits the highest possible value to 31. you cannot send ASCII values greater than 127.or a mark state . and the parity bit is 0 when the number of mark bits in the preceding word is an odd number. space parity or none at all. mark parity.and it can be detected correctly even if the previous data bit also had a value of 1. an additional bit called a parity bit may optionally be transmitted along with the data. then the parity bit would be 1. the parity bit is transmitted with a value of 0 if the number of preceding marks is an even number. A parity bit affords a small amount of error checking. or 2 bit periods in length. The Parity Bit Besides the synchronization provided by the use of start and stop bits. Also. the number of marks (logical 1 bits) in each data byte is counted. and a single bit is transmitted following the data bits to indicate whether the number of 1 bits just sent is even or odd. a stop bit is sent. Parity error checking is very rudimentary. This is accomplished by the stop bit's duration. After the data has been transmitted.agree on the number of data bits.

Pin Details of PC Serial port 1 2 3 4 5 RS232 Connector CD DSR 6 RD RTS 7 TD CTS 8 DTR RI 9 GND 57 . they are almost never used. The serial ports on most computers use a subset of the RS-232C standard. Since these two parity options serve no useful purpose whatsoever. RS-232C RS-232 stands for Recommend Standard number 232 and C is the latest revision of the standard. most new PCs are equipped with male D type connectors having only 9 pins. and indeed. Most of these pins are not needed for normal PC communications. Mark parity means that the parity bit is always set to the mark signal condition and likewise space parity always sends the parity bit in the space signal condition.even numbers of bits are in error then the parity bit would not reflect any error at all. The full RS-232C standard specifies a 25-pin "D" connector of which 22 pins are used.

it will put this line in the space condition as a signal to the DCE to stop sending data.9 Pin Connector on a DTE device (PC connection) Pin Number 1 2 3 4 5 6 7 8 9 Direction of signal: Carrier Detect (CD) (from DCE) Incoming signal from a modem Received Data (RD) Incoming Data from a DCE Transmitted Data (TD) Outgoing Data to a DCE Data Terminal Ready (DTR) Outgoing handshaking signal Signal Ground Common reference voltage Data Set Ready (DSR) Incoming handshaking signal Request To Send (RTS) Outgoing flow control signal Clear To Send (CTS) Incoming flow control signal Ring Indicator (RI) (from DCE) Incoming signal from a modem Table 4. If the DTE device is not able to receive data (typically because its receive buffer is almost full). RTS stands for Request To Send. The TD line is kept in a mark condition by the DTE device when it is idle. This name can be deceiving. The RD (receive data) wire is the one on which data is received by a DTE device.1: Pins of RS232 The TD (transmit data) wire is the one through which data from a DTE device is transmitted to a DCE device. because this wire is used by a DCE device to receive its data. The DTE device puts this line in a mark condition to tell the remote device that it is ready and able to receive data. When the DTE device is ready to 58 . This line and the CTS line are used when "hardware flow control" is enabled in both the DTE and DCE devices.

Because of this. Together. The DCE device puts this line in a mark condition to tell the DTE device that it is ready to receive the data. The complement of the RTS wire is CTS. or has detected a carrier tone. The Software Wedge supports this type of flow control. these two lines make up what is called RTS/CTS or "hardware" flow control. It would be pointless to use both RTS/CTS and DTR/DSR for flow control signals at the same time. With software flow control the RTS and CTS lines are not used. if the DCE device is unable to receive data. Its intended function is very similar to the RTS line. CD stands for Carrier Detect. Software flow control uses special control characters transmitted from one device to another to tell the other device to stop or start sending data. The Software Wedge sets DTR to the mark state when the serial port is opened and leaves it in that state until the port is closed. DSR (Data Set Ready) is the companion to DTR in the same way that CTS is to RTS. it will place this line in the space condition. 59 .receive more data (i. Some serial devices use DTR and DSR as signals to simply confirm that a device is connected and is turned on. DTR stands for Data Terminal Ready. DTR and DSR are rarely used for flow control. it will place this line back in the mark condition. which stands for Clear to Send. as well as Xon/XOff or "software" flow control. The DTR and DSR lines were originally designed to provide an alternate method of hardware handshaking. after data has been removed from it’s receive buffer). Carrier Detect is used by a modem to signal that it has a made a connection with another modem. Likewise.e.

which is further regulated to +5v. A 0-12V/500mA transformer is used for our purpose.The last remaining line is RI or Ring Indicator. when a connection is made to another modem) or when the line is ringing. The secondary is connected to the diodes convert from 12V AC to 12V DC voltage. Because most modems transmit status information to a PC when either a carrier signal is detected (i.2 POWER SUPPLY Figure 45 Power Supply Unit The power supply section is the important one. A modem toggles the state of this line when an incoming call rings your phone. by using IC 7805. the primary of this transformer is connected in to main supply through on/off switch& fuse for protecting from overload and short circuit protection.e. 4. 60 . The Carrier Detect (CD) and the Ring Indicator (RI) lines are only available in connections to a modem. these two lines are rarely used. It should deliver constant output regulated power supply for successful working of the project.

thermal shutdown and safe-area compensation.4. Input bypassing is needed only if the regulator is located far from the filter capacitor of the power supply.0 61 . It is not necessary to bypass the output. Considerable effort was expended to make the entire series of regulators easy to use and minimize the number of external components. these devices can be used with external components to obtain adjustable output voltages and currents. Figure.6 Pins of LM780 5. making them essentially indestructible.4. If adequate heat sinking is provided. SOFTWARE DESCRIPTION 5.2. they can deliver over 1.1 Regulator IC (LM 7805) The LM7805 monolithic 3-terminal positive voltage regulators employ internal current-limiting.0A output current. although this does improve transient response. They are intended as fixed voltage regulators in a wide range of applications including local (on-card) regulation for elimination of noise and distribution problems associated with single-point regulation.1 Visual Basic 6. In addition to use as fixed voltage regulators.

Event Procedures An event procedure is a piece of code that responds to events that can occur for that object. Visual Basic is evolved from the original BASIC language. The properties are displayed in the Properties Window in Name/Value pairs in alphabetical order. the Standard Exe option starts with a form called "Form1". This is great advantage over other programming language. Visual Basic is the first language people consider when they want rapid application development for the window environment. the Name property should be set immediately. By default. When adding a component. The Name property of the Form should be named with a three-letter mnemonic 62 . enabling them to dictate the order of execution. according to the three-letter mnemonic naming conventions.Visual Basic (Visual Beginners All purpose symbolic Instruction Code) is the most popular programming language for world’s most popular operating system. While writing the programs. which is widely used language. it also has a set of debugging tools. Properties The properties describe the appearance of the GUI component. Forms The Form is the main stage of your application. Existing objects are dragged & dropped in to the place instead of writing numerous codes. VB is based on an event driven method model. we are able to see how the programs run during the run time. The primary reason behind selecting VB was because the interface was so little compared to other tools. Most of the events are generated by the user.

and then "Form". If used. and then use either the "Show" or "Visible" method to make it visible as and when required. is optional.prefix of "frm". use the Show method. Each control has a set of properties. Web Forms are based on ASP. vbModal means that the form has focus until closed within the application. Note: In VB. "Add". Your application may use more than one form. there are two types of Forms . Each Form will be a Window in your application. The parameter. To load a new form. To add a new Form to the project. either select "Add Form" from the "Project" menu or right-click the Forms folder in the Project Explorer and select.Windows Forms and Web Forms. and a set of event procedures associated with 63 .Net. The Load command can be used to load a form without showing it.Net. Controls are added to the form by either double-clicking them in the toolbox. Standard Controls Controls are added to the Form from the Toolbox. This technique is useful if you want to preload a form. vbModal. or by selecting the control and drawing a bounding rectangle on the form.

Label Control The Label control is used to display text that can't be changed directly by the user. reading left to right. When a control is added to the form. Labels are more commonly used to place captions against other controls or store calculated values. The Pointer is selected by default. Pictures function. and changed at run-time. are The loaded into the PictureBox toggles using the LoadPicture and following example between face0. Labels are more commonly used to place captions 64 . allowing you to move and resize them. The Caption property may be set at design-time using the Properties Window. PictureBox Control The PictureBox is used to display images or act as a container to other controls.gif face1.gif with each click of the mouse. The Pointer The Pointer is not a control. The default property of a Label is Caption. The main event for a PictureBox is the Click event.it. but is used to interact with the controls on the form. The three-letter mnemonic for a PictureBox is pic (eg. top to bottom as they appear in the standard Toolbox. picFace). Label Control The Label control is used to display text that can't be changed directly by the user. lblPrompt). The three-letter mnemonic for a Label is lbl (eg. the focus reverts back to the Pointer. The following lists the control.

which can be used to give context to the grouping (eg. The length of the Text property is limited to 2048 characters for a TextBox. The three-letter mnemonic for a Command Button is cmd (eg. The default property is Caption. only one may be selected on the Form. If the ScrollBars Property doesn't allow a Horizontal ScrollBar. The Caption property may be set at design-time using the Properties Window. To allow text on more than one line. and changed at run-time. The default property of a Label is Caption. lblPrompt). fraPaymentMethod). Checkbox Control The CheckBox control is used to give the user a choice of yes/no multiple choice options. Payment Method). cmdQuit). The three-letter mnemonic for a 65 . and are treated as a new group. Option Buttons placed in a Frame are associated with the Frame.against other controls or store calculated values. When option buttons are used. The three-letter mnemonic for a Label is lbl (eg. The default event for a Command Button is "Click". the Multiline Property must be set to True. and about 32K if the MultiLine property is set to True. then the text will wrap. Command Button Control The Command Button is used by the user to invoke some action. Frame Control The Frame control is used to group controls and provides a means of sub-dividing the Form visually. The three-letter mnemonic for a Frame is fra (eg.

The following example uses a command button to determine which items have been selected from a control array of CheckBoxes. The "Value" property may be used to determine whether an item has been selected . and removed at run-time using the RemoveItem method (see below for details). chkHobbies). ComboBox Control The ComboBox is a combination of a TextBox and a ListBox control.either True or False. The three-letter mnemonic for a ComboBox is cbo (eg. The three-letter mnemonic for an OptionButton is opt (eg. Timer Control 66 . cboArtist). The following example uses a CommandButton to determine which item has been selected from a control array of OptionButtons. The "Value" property may be used to determine whether an item has been selected . and a value of 0 indicates false.CheckBox is chk (eg. Frame or PictureBox. Items may be added to the list at design-time using the "List" property (<CTRL>+<ENTER> takes you to the next line to add a new item). optPaymentMethod). Items may be added to the list at run-time using the AddItem method. OptionButton Control The OptionButton control is used to group options where the user can only select only one. As only one item may be selected OptionButtons are grouped in containers such as the Form.a value of 1 indicates true. The "Clear" method removes all items from the list.

but not shown at run-time. The receive buffer can be read by the program whenever it has time and the transmit buffer is emptied when it is free to send characters. tmrMove). It is used for background processing at intervals specified by the Interval property. This example moves a PictureBox around the form. Windows hides much of the complexity of serial communications and automatically puts any received characters in a receive buffer and characters sent into a transmission buffer. 5. Visual Basic (Serial Communication) 5. The Interval property takes an integer in the range 0 to 65. and add a picture of a face to the PictureBox.2. Set the Interval of the Timer to 1. To disable the Timer. and a Timer called tmrMove to the form.2.2.The Timer control is visible at design-time.2 Communications control Visual Basic allows many additional components to be added to the toolbox. The Microsoft Comm.Net. In order to use the Comms component the 67 .535. therefore a value of 1000 equals an interval of one second. An Interval of 0 disables the Timer control in VB 6. but not in VB. Setting it to True will enable it again. The default event for a Timer is the Timer event. The Interval is measured in milliseconds. To try the example. add a PictureBox called picFace. 5. set the Enabled Property to False. The three-letter mnemonic for a Timer is tmr (eg. component is used to add a serial communication facility.1 Introduction This chapter discusses how Visual Basic can be used to access serial communication functions.

and also to detect communications errors. The communication control is added to the application for each port.OCX (for a 16-bit module) or MSCOMM32. Visual Basic uses the standard Windows drivers for the serial communication ports (such as serialui.files MSCOMM16. the program can loop waiting for a character to be received. The parameters (such as the bit rate. The class name is MSComm. For example. parity. and so on) can be changed by selecting Control Panel ? System ? Device Manager and LPT) ? Ports (COM ? Port Settings. The settings of the communications port (the IRQ and the port address) can be changed by selecting Control 68 . Once it is the character is read from the receive buffer. The communications control provides the following two ways for handling communications Event-driven Event-driven communications is the best method of handling serial communication as it frees the computer to do other things.vxd). a change in CD (carrier detect) or a change in RTS (request to send). Polling CommEvent properties can be tested to determine if an event or an error has occurred.OCX (for a 32-bit module) must be present in the \WINDOWS\SYSTEM directory.dll and serial. The OnComm event can be used to capture these events. The event can be defined as the reception of a character. This method is normally used when the program has time to poll the communications receiver or that a known response is imminent.

such as baud rate. OutBufferSize. 69 . parity. 2400. By default.]MSComm.P. Index.Panel? System? Device Manager? Ports (COM and LPT)? Resources for IRQ and Addresses. and so on).D. RThreshold. Left. 600. 56000.Settings = setStr[$] where the strStr is a string which contains the RS-232 settings. EOFEnable. Its syntax is: [form. 128000. the number of data bit. 14400. InputMode. It can be seen that the main properties of the object are: CommPort. 9600. The following lists the valid baud rates (default is 9600Baud): 110. SThreshold. 38400. This string takes the form: "BBBB. RTSEnable. Settings The Settings property sets and returns the RS-232 parameters. Handshaking. the first created object is named MSComm1 (the second is named MSComm2. Tag and Top. and the number of stop bits. NullDiscard. 256000. 1200. Name. and S the number of stop bits. Settings. 300. 19200.S" where BBBBdefines the baud rate. D the number of data bits. Properties The Comm component is added to a form whenever serial communications are required. ParityReplace. DTREnable. P the parity. InBufferSize. InputLen.

5. A value of 68 is returnedif the port does not exist. M (Mark). 7 data bits and 1 stop bit is: Com1. InBuffer Count and InBufferSize. The valid stop bit values are (default is 1). An example of setting a control port to 4800Baud. Its syntax is: [form. 70 . while a False closes the port and clears the receive andtransmit buffers (this automatically happens when an application is closed). 6.]MSComm.Settings = "4800.E. 7 data bits and 1 stop bit: Inputting data The three main properties used to read data from the receive buffer are Input. S (Space). The valid data bit values are (default is 8): 4.PortOpen = [{True | False}] A True setting opens the port.]MSComm. 1.The valid parity values are (default is N): E (Even).7. even parity.CommPort = portNumber[%] which defines the portNumber from a value between 1 and 99. O (Odd). PortOpen The PortOpen property sets and returns the state of the communications port. 7 or 8. Its syntax is: [form. The following example opens communications port number 1 (COM1:) at 4800 Baud with even parity.1" CommPort The CommPort property sets and returns the communication port number. 1. N (None).5 or 2.

It can also be used to clear the buffer by setting the number of characters to 0. Setting InputLen to 0 causes the Input property to read the entire contents of the receive buffer.]MSCommInBufferCount= [count%] Outputting data The three main properties used to write data to the transmit buffer are Output.]MSCommInBufferSize = [numBytes%] The size of the buffer should be set so that it can store the maximum number of characters that will be received before the application program can read them from the buffer. Its syntax is: [form. The Output property writes a string of characters to the transmit buffer. Its syntax is: [form.Input The Input property returns and removes a string of characters from the receive buffer. The InBufferCount property returns the number of characters in the receive buffer. output= [outString$] 71 .Input To determine the number of characters in the buffer the InBufferCount property is tested (to be covered in the next section). OutBufferCount and OutBufferSize.]MSComm. InBufferSize The InBufferSize property sets and returns the maximum number of characters that can be received in the receive buffer (by default it is 1024 bytes). Its syntax is: [form. Its syntax is: [form.]MSComm.

= [0] 5. If # is pressed. else go to STEP 2. Its syntax is: [form. STEP 5: Check whether # is pressed or not. make telephone OFF HOOK and send FF to Personal Computer. Its syntax is: [form. STEP 6: If # is not pressed.3.1. Micro Controller Algorithm STEP 1: Start the program STEP 2: Check whether ring signal is present or not. 72 . FLOW CHART 5. STEP 4: Get the DTMF signal through the DTMF decoder. then disconnect the phone and go to STEP 2.The transmit buffer can also be cleared by setting it to 0.OutBufferSize The OutBufferSize property sets and returns the number of characters in the transmit buffer (default size is 512 characters). STEP 3: If ring signal is present.]MSCommOutBufferCount.]MSCommOutBuffer size = [NumBytes%] OutBufferCount The OutBufferCount property returns the number of characters in the transmit buffer.3. then send the DTMF data to the pc through the serial port and go to STEP 4.

START NO RING CHECK RING SENSOR RING MAKE TELEPHONE OFF H OOK & SEND FF TO PC GET DTMF SIGNAL NO IF PRESSED # SENSE THE DTMF DATA TO THE PC TH ROUGH THE SERIAL PORT YES DISCONNECT PHONE 73 .

check whether number 2 is pressed or not. STEP 3: If data FF is present. STEP 9: If number 2 is not pressed.5. If so play the marks for the corresponding roll number and go to step 6. MARKS DISCONNECT 74 . STEP 6: If yes. If so terminate the program and go to step 2. STEP 8: If number 1 is not pressed. check whether number # is pressed or not. STEP 10: If number # is not pressed. play message to enter 1 ATTENDENCE 2 # else go to step 5. else go to step 2. then check the attendance and play present or absent message and go to step 6. play the welcome message. STEP 4: Play the message to enter the roll number. STEP 5: Check whether four numbers are entered or not. go to step 6 until # is pressed. STEP 7: If number 1 is pressed.2.3. VISUAL BASIC Algorithm STEP 1: Start the program STEP 2: Check for the data FF.

PRESSED NO PLAY THE MARKS FO R THE CORRESPONDING ROLL NUMB ER YES IF 2. FOR MARKS #. FOR ATTENDENCE 2.START NO CH ECK FOR DATA "FF" YES PLAY THE WELCOME MESSAGE PLAY MESSAGE TO ENTER THE ROLL NUMBER NO IF FOUR NUMBERS ARE ENTERED YES PLAY MESSAGE TO ENTER 1. PRESSED NO NO IF # PRESSED YES 75 . TO DISCONNECT CHECK THE ATTENDENCE AND PLAY PRESENT OR ABSENT MESSAG E YES IF 1.

1 COMPONENT LAYOUT 76 .6. PCB DESIGN 6.

the area that each component would occupy. In this step. smoothing. Though it is very cheap and can easily be drilled. The important properties that have to be considered for selecting the PCB substrate are the dielectric strength. phenolic paper has poor electrical characteristics and it absorbs more moisture than epoxy glass. 77 . PCB Fabrication The fabrication of a PCB includes four steps.e) drilling.shear strength. hardness. Several factors such as positioning the diameter of holes. 6. PCB Design The PCB design starts right from the selection of the laminates . dimensional stability etc. all interconnection between the components in the given circuit are converted into PCB tracks. of thermal expansion .6. coeff.3. the type of end terminal should be considered. water absorption property.The two main types of base laminate are epoxy glass and phenolic paper laminates are generally used for simple circuits. Pattern designing is the primary step in fabricating a PCB. c) Developing the PCB. insulation resistance. Epoxy glass has higher mechanical strength. a) Preparing the PCB pattern. turning etc.2. d) Finishing (i. cutting. b) Transferring the pattern onto the PCB.

The mirror image of the pattern must be carbon copied and to the laminate the complete pattern may now be made each resistant with the help of paint and thin brush.hole of suitable diameter should be drilled . The board with its copper side facing upward should be placed in a flat bottomed plastic tray and the aqueous solution of FeCl2 poured in the etching process would take 40 to 60 min to complete.Transferring the PCB Pattern The copper side of the PCB should be thoroughly cleaned with the help of alcoholic spirit or petrol. 78 . The paint should be removed with the help of thinner. Developing In this developing all excessive copper is removed from the board and only the printed pattern is left behind.5 grams of FeCl3 added to it.then the PCB may be tin plated using an ordinary 35 Watts soldering rod along with the solder core . the mixture should be thoroughly stirred and a few drops of HCl may be added to speed up the process. Finishing Touches After the etching is completed . After etching the board it should be washed under running water and then held against light . It must be completely free from dust and other contaminants.the copper side may be given a coat of varnish to prevent oxidation.the printed pattern should be cleanly visible. About 100ml of tap water should be heated to 75 ° C and 30.

Soldering Begin the construction by soldering the resistors followed by the capacitors and the LEDs diodes and IC sockets. To be sure that it is working properly watch the LED flash. Soldering it directly will only reduce its height above other components and hamper in its easy fixation in the cabinet. Note that a rotary switch can be used instead of a slide type. Don’t try soldering an IC directly unless you trust your skill in soldering. It will automatically start its timing cycles.Drilling Drills for PCB use usually come with either a set of collects of various sizes or a 3-Jaw chuck. The components are selected to trigger the alarm a few minutes before the set limit. Assembling The circuit can be enclosed in any kind of cabinet. All components should be soldered as shown in the figure. Switch on the circuit to be desired range. 79 . LED and buzzer. Now connect the switch and then solder/screw if on the PCB using multiple washers or spaces. Before fitting the PCB suitable holes must be drilled in the cabinet for the switch. For accuracy however 3-jaw chunks aren’t brilliant and small drill below 1 mm from grooves in the jaws preventing good grips. Now connect the battery lead.

FUTURE ENHANCEMENT  Our project should be modified to know the profile of the student. the time spending for college officials in attempting phone calls from outsiders will be reduced. Our project will be very obliging to the parents to be acquainted with their son’s/daughter’s recital in the college. Presentation in the class and outcome of the university are made reachable to the parents by our project. Embedded system is the current technology and has a bright future. 9. CONCLUSION Embedded system plays a major role in advanced communication system.7.  Sound should be modified by recording the sound in a sound proof room. We had successfully executed our project “VISCA” by using our college telephone line. 80 . Moreover.  Access the college database for the execution of our project. Any real time apply can be controlled.

APPENDIX 1 INSTRUCTION SET OF MCS51 FAMILY Table: 1 Arithmetic Instruction for MCS51 81 .

Table: 2 Logical Operations 82 .

Table: 3 Data Transfer Instruction 83 .

84 .

Table: 4 Boolean Variable Manipulations and Machine Control Instructions REFERENCES 85 .

0 86 .Ayala (Second edition). Kenneth.(2002) THE 8051 MICROCONTROLLER AND EMBEDDED SYSTEMS 3. Mohammed Azam.1. Programming with Visual Basic 6. Muhammad Ali Mazidi . Janice Gillispie Mazidi. “The 8051 Microcontroller Architecture.J. programming and applications”. 2.

Sign up to vote on this title
UsefulNot useful