Sumit Gupta Project Report

90
GSM BASED DEVICE MONITRING & CONTROL PROJECT REPORT 2010-11 Submitted in partial fulfillment of the requirement for the award of the degree of Bachelor of Technology Departement of Electronics & Communication Engineering CET-IILM-AHL GREATER NOIDA,U.P.,201306

Transcript of Sumit Gupta Project Report

Page 1: Sumit Gupta Project Report

GSM BASED DEVICE MONITRING & CONTROL

PROJECT REPORT 2010-11

Submitted in partial fulfillment of the requirement for the award of the degree of

Bachelor of Technology

Departement of Electronics & Communication Engineering

CET-IILM-AHL

GREATER NOIDA,U.P.,201306

Supervised by:- Submitted by:-Mrs. GARIMA KULSHRASHTHA Rana Aditya Pratap Singh Rana Brijendra Singh Sumit Kumar Gupta Sunil Kumar Yadav

Page 2: Sumit Gupta Project Report

CERTIFICATE

This is certify that the major project report entitled “GSM BASED DEVICE

MONITRING & CONTROL” is a record of of bonafide work done by Mr.

Rana Aditya Pratap Singh , Mr. Rana Brijendra Singh , Mr. Sumit Gupta ,

Mr. Sunil Yadav under our supervision and guidance.

This report is submitted to the CET-IILM-AHL as a part of syllabus

prescribed by UTTAR PRADESH TECHNICAL UNIVERSITY

LUCKNOW for the degree BACHELOR OF TECHNOLOGY

(ELECTRONICS & COMMUNICATION) DURING THE YEAR

2007-11.

(H.O.D Signature) (Supervisior’s Signature)

RASHMI PATOO Mrs. GARIMA KULSHRASHTHA

Designation: Professor & Head Designation: Asst. Professor

Date: Date:

External Examiner

Page 3: Sumit Gupta Project Report

List of Contents

Candidate Declaration

Page 4: Sumit Gupta Project Report

Candidate Declaration

I hereby declare that the work , which is prepared in the desertion of project titled “GSM BASED DEVICE MONITRING & CONTROL” is submitted in partil fulfillment of the requirement for the award of degree of Bachelor Of Technology (Electronics & Communication Engineering), is an authenticated record of our original work from 15th Jan to 10th May of 2009. This project report is an authenticated work of ours and not has been submitted to any other university or organization before.

Rana Aditya Pratap Singh Rana Brijendra Singh Sumit Kumar Gupta Sunil Kumar Yadav

Page 5: Sumit Gupta Project Report

Acknowledgement

We are extremely thankfull & greatfull to Mrs Rashmi Patto, Head of Department of Electronics & Communication Engineering, CET-IILM-AHL. She being our guide, has taken keen interest in the progress of our project work by providing facilities & guidance. We are indebted to our guide for her inspiration, support & kindness showered on us through the course.

We thank Mrs. GARIMA KULSHRASHTHA (mentor), Col. B.C. TRIPATHI, MR. RASID MAHMOOD, MR. AMIT GOSWAMI for their encouragement and support in our academy endeavors.

We takes this opportunity to thank the teaching & non teaching staff of CET-IILM-AHL, for their cvaluable help & support.

We would also thanks our parents & friends for their constant encouragement and support.

Page 6: Sumit Gupta Project Report

1) Introduction

In this project we can control any electrical appliances through mobile or landline

from any part of the country. In this project one base unit is connected to the basic

landline or with the mobile phone in parallel with the land line phone , in the case

of landline but in the case of mobile phone we use handfree option logic.. When

we want to control any electrical appliances through outer phone then first we dial

the home number, bell is ringing and after few bell phone is automatic on and

switch on the base unit to operate. Now we press the eight digit excess code, one

by one. Password is compare with the digital circuit. if the excess code is ok then

unit give a ack in the form of tone pulse and switch on the base unit. Now again

we press the switch on/off code to on/off any electrical appliances. With the help

of this code unit is on and base unit give a acknowledge pulseeep sound for on and

off separately. Now first of all we check the position of any electrical appliances

by pressing a particular code. If we want to check the position of unit 2 then we

press 2 then circuit produce a ack sound of on and off by beep sound. Now after

getting a sound of ack we press 0 for off and press 1 for the on the unit.

All this is happen by the memory connected with the pin no 10,11,12. when power

is off the all the content of the switch is transfer to the memory unit.

Page 7: Sumit Gupta Project Report

Complete circuit is divided into FOUR parts.

1. DTMF DECODER

2. MICROCONTROLLER

3. EXCESS CONTROL

4. MEMORY INTERFACE

DTMF DECODER.

In dtmf decoder circuit we use ic 8870 ic. IC 8870 is a dtmf decoder ic. IC 8870

converts the dual tones to corresponding binary outputs.

DTMF SIGNALLING.

Ac register signaling is used in dtmf telephones, here tones rather than

make/break pulse are used fro dialing, each dialed digit is uniquely represented

by a pair of sine waves tones. These tones ( one from low group for row and

another from high group fro column) are sent to the exchange when a digit is

dialed 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

Page 8: Sumit Gupta Project Report

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 a higher group ( 1209-1663 Hz).

Each group contains four individual tones. This scheme allows 10 unique

combinations. Ten of these code represent digits 1 through 9 and 0. . tones in

DTMF dialing are so chose that none of the tones is harmonic of are other tone.

Therefore 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 significaly 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.

MT8870 OUTPUT TRUTH TABLE.

F low F high KEY BCD

697 1209 1 0001

697 1336 2 0010

Page 9: Sumit Gupta Project Report

697 1477 3 0011

770 1209 4 0100

770 1336 5 0101

770 1477 6 0110

852 1209 7 0111

852 1336 8 1000

852 1477 9 1001

941 1209 0 1010

Page 10: Sumit Gupta Project Report

WHAT IS DTMF ?

Dual-tone multi-frequency signaling (DTMF) is used for telecommunication

signaling over analog telephone lines in the voice-frequency band

betweentelephone handsets and other communications devices and the switching

center. The version of DTMF that is used in push-button telephones for tone dialing is

known as Touch-Tone. It was first used by AT&T in commerce as a registered

trademark, and is standardized by ITU-T Recommendation Q.23. It is also known in the

UK as MF4.

Other multi-frequency systems are used for internal signaling within the telephone

network.

The Touch-Tone system, using the telephone keypad, gradually replaced the use

of rotary dial starting in 1963[citation needed], and since then DTMF or Touch-Tone became

the industry standard for both cell phones and landline service

When you press a button in the telephone set keypad, a connection is made that generates a resultant signal of two tones at the same time. These two tones are taken from a row frequency and a column frequency. The resultant frequency signal is called “Dual Tone Multiple Frequency”. These tones are identical and unique.A DTMF signal is the algebraic sum of two different audio frequencies, and can be expressed as follows:f(t) = A0sin(2*П*fa*t) + B0sin(2*П*fb*t) + ………..    ——->(1)

Page 11: Sumit Gupta Project Report

Where fa and fb are two different audio frequencies with A and B as their peak amplitudes and f as the resultant DTMF signal. fa belongs to the low frequency group and fb belongs to the high frequency group.Each of the low and high frequency groups comprise four frequencies from the various keys present on the telephone keypad; two different frequencies, one from the high frequency group and another from the low frequency group are used to produce a DTMF signal to represent the pressed key.The amplitudes of the two sine waves should be such that(0.7 < (A/B) < 0.9)V               ——–>(2)The frequencies are chosen such that they are not the harmonics of each other. The frequencies associated with various keys on the keypad are shown in figure (A).When you send  these DTMF signals to the telephone exchange through cables, the servers in the telephone exchange identifies these signals and makes the connection to the person you are calling.

Page 12: Sumit Gupta Project Report

SPECIFICATION OF COMPONENTS

WELCOME TO THE WORLD OF THE MICROCONTROLLERS.

Look around. Notice the smart “intelligent” systems? Be it the T.V, washing

machines, video games, telephones, automobiles, aero planes, power systems, or

any application having a LED or a LCD as a user interface, the control is likely to

be in the hands of a micro controller!

Measure and control, that’s where the micro controller is at its best.

Micro controllers are here to stay. Going by the current trend, it is obvious that

micro controllers will be playing bigger and bigger roles in the different activities

of our lives.

So where does this scenario leave us? Think about it……

The world of Micro controllers

What is the primary difference between a microprocessor and a micro controller?

Unlike the microprocessor, the micro controller can be considered to be a true

“Computer on a chip”.

In addition to the various features like the ALU, PC, SP and registers found on a

microprocessor, the micro controller also incorporates features like the ROM,

RAM, Ports, timers, clock circuits, counters, reset functions etc.

While the microprocessor is more a general-purpose device, used for read, write

and calculations on data, the micro controller, in addition to the above functions

Page 13: Sumit Gupta Project Report

also controls the environment.

We have used a whole lot of technical terms already! Don’t get worried about the

meanings at this point. We shall understand these terms as we proceed furtherFor

now just be aware of the fact, that all these terms literally mean what they say.

Bits and Bytes

Before starting on the 8051, here is a quick run through on the bits and bytes. The

basic unit of data for a computer is a bit. Four bits make a nibble. Eight bits or two

nibbles make a byte. Sixteen bits or four nibbles or two bytes make a word.

1024 bytes make a kilobyte or 1KB, and 1024 KB make a Mega Byte or 1MB.

Thus when we talk of an 8-bit register, we mean the register is capable of holding

data of 8 bits only.

The 8051

The 8051 developed and launched in the early 80`s, is one of the most popular

micro controller in use today. It has a reasonably large amount of built in ROM

and RAM. In addition it has the ability to access external memory.

The generic term `8x51` is used to define the device. The value of x defining the

kind of ROM, i.e. x=0, indicates none, x=3, indicates mask ROM, x=7, indicates

EPROM and x=9 indicates EEPROM or Flash.

A note on ROM

The early 8051, namely the 8031 was designed without any ROM. This device

could run only with external memory connected to it. Subsequent developments

lead to the development of the PROM or the programmable ROM.

Page 14: Sumit Gupta Project Report

The next in line, was the EPROM or Erasable Programmable ROM. These devices

used ultraviolet light erasable memory cells. Thus a program could be loaded,

tested and erased using ultra violet rays. A new program could then be loaded

again.

An improved EPROM was the EEPROM or the electrically erasable PROM. This

does not require ultra violet rays, and memory can be cleared using circuits within

the chip itself.

Finally there is the FLASH, which is an improvement over the EEPROM. While

the terms EEPROM and flash are sometimes used interchangeably, the difference

lies in the fact that flash erases the complete memory at one stroke, and not act on

the individual cells. This results in reducing the time for erasure.

Understanding the basic features of the 8051 core

Let’s now move on to a practical example. We shall work on a simple practical

application and using the example as a base, shall explore the various features of

the 8051 microcontroller.

Consider an electric circuit as follows,

The positive side (+ve) of the battery is connected to one side of a switch. The

other side of the switch is connected to a bulb or LED (Light Emitting Diode). The

bulb is then connected to a resistor, and the other end of the resistor is connected to

Page 15: Sumit Gupta Project Report

the negative (-ve) side of the battery.

When the switch is closed or ‘switched on’ the bulb glows. When the switch is

open or ‘switched off’ the bulb goes off

If you are instructed to put the switch on and off every 30 seconds, how would you

do it? Obviously you would keep looking at your watch and every time the second

hand crosses 30 seconds you would keep turning the switch on and off.

Imagine if you had to do this action consistently for a full day. Do you think you

would be able to do it? Now if you had to do this for a month, a year??

No way, you would say!

The next step would be, then to make it automatic. This is where we use the

Microcontroller.But if the action has to take place every 30 seconds, how will the

microcontroller keep track of time?

Execution time

Look at the following instruction,

clr p1.0

This is an assembly language instruction. It means we are instructing the

microcontroller to put a value of ‘zero’ in bit zero of port one. This instruction is

equivalent to telling the microcontroller to switch on the bulb. The instruction then

to instruct the microcontroller to switch off the bulb is,

Setb p1.0

This instructs the microcontroller to put a value of ‘one’ in bit zero of port one.

Don’t worry about what bit zero and port one means. We shall learn it in more

detail as we proceed.

Page 16: Sumit Gupta Project Report

There are a set of well defined instructions, which are used while communicating

with the microcontroller. Each of these instructions requires a standard number of

cycles to execute. The cycle could be one or more in number.

How is this time then calculated?

The speed with which a microcontroller executes instructions is determined by

what is known as the crystal speed. A crystal is a component connected externally

to the microcontroller. The crystal has different values, and some of the used

values are 6MHZ, 10MHZ, and 11.059 MHz etc.

Thus a 10MHZ crystal would pulse at the rate of 10,000,000 times per second.

The time is calculated using the formula

No of cycles per second = Crystal frequency in HZ / 12.

For a 10MHZ crystal the number of cycles would be,

10,000,000/12=833333.33333 cycles.

This means that in one second, the microcontroller would execute 833333.33333

cycles. Therefore for one cycle, what would be the time? Try it out.

The instruction clr p1.0 would use one cycle to execute. Similarly, the instruction

setb p1.0 also uses one cycle.So go ahead and calculate what would be the number

of cycles required to be executed to get a time of 30 seconds!

Getting back to our bulb example, all we would need to do is to instruct the

microcontroller to carry out some instructions equivalent to a period of 30 seconds,

like counting from zero upwards, then switch on the bulb, carry out instructions

equivalent to 30 seconds and switch off the bulb.

Just put the whole thing in a loop, and you have a never ending on-off sequence.

Simple isn’t it? Let us now have a look at the features of the 8051 core, keeping

Page 17: Sumit Gupta Project Report

the above example as a reference,

8-bit CPU.( Consisting of the ‘A’ and ‘B’ registers)

Most of the transactions within the microcontroller are carried out through the ‘A’

register, also known as the Accumulator. In addition all arithmetic functions are

carried out generally in the ‘A’ register. There is another register known as the ‘B’

register, which is used exclusively for multiplication and division.

Thus an 8-bit notation would indicate that the maximum value that can be input

into these registers is ‘11111111’. Puzzled?

The value is not decimal 111, 11,111! It represents a binary number, having an

equivalent value of ‘FF’ in Hexadecimal and a value of 255 in decimal.

We shall read in more detail on the different numbering systems namely the Binary

and Hexadecimal system in our next module.

2. 4K on-chip ROM

Once you have written out the instructions for the microcontroller, where do you

put these instructionsObviously you would like these instructions to be safe, and

not get deleted or changed during execution. Hence you would load it into the

‘ROM’The size of the program you write is bound to vary depending on the

application, and the number of lines. The 8051 microcontroller gives you space to

load up to 4K of program size into the internal

ROM. 4K, that’s all? Well just wait. You would be surprised at the amount of stuff

you can load in this 4K of space.

Of course you could always extend the space by connecting to 64K of external

ROM if required.

Page 18: Sumit Gupta Project Report

3. 128 bytes on-chip RAM

This is the space provided for executing the program in terms of moving data,

storing data etc.

4. 32 I/O lines. (Four- 8 bit ports, labeled P0, P1, P2, P3)

In our bulb example, we used the notation p1.0. This means bit zero of port one.

One bit controls one bulb.

Thus port one would have 8 bits. There are a total of four ports named p0, p1, p2,

p3, giving a total of 32 lines. These lines can be used both as input or output.

5. Two 16 bit timers / counters.

A microcontroller normally executes one instruction at a time. However certain

applications would require that some event has to be tracked independent of the

main program.

The manufacturers have provided a solution, by providing two timers. These timers

execute in the background independent of the main program. Once the required

time has been reached, (remember the time calculations described above?), they

can trigger a branch in the main program.

These timers can also be used as counters, so that they can count the number of

events, and on reaching the required count, can cause a branch in the main

program.

Page 19: Sumit Gupta Project Report

6. Full Duplex serial data receiver / transmitter.

The 8051 microcontroller is capable of communicating with external devices like

the PC etc. Here data is sent in the form of bytes, at predefined speeds, also known

as baud rates.

The transmission is serial, in the sense, one bit at a time

7. 5- interrupt sources with two priority levels (Two external and three

internal)

During the discussion on the timers, we had indicated that the timers can trigger a

branch in the main program. However, what would we do in case we would like

the microcontroller to take the branch, and then return back to the main program,

without having to constantly check whether the required time / count has been

reached?

This is where the interrupts come into play. These can be set to either the timers, or

to some external events. Whenever the background program has reached the

required criteria in terms of time or count or an external event, the branch is taken,

and on completion of the branch, the control returns to the main program.

Priority levels indicate which interrupt is more important, and needs to be executed

first in case two interrupts occur at the same time.

8. On-chip clock oscillator.

This represents the oscillator circuits within the microcontroller. Thus the hardware

is reduced to just simply connecting an external crystal, to achieve the required

pulsing rate.

Page 20: Sumit Gupta Project Report

ground pin directly. In this project we add a flash memory with the microcontroller to save all the current data of the port p2 and port 0 in the flash

Page 21: Sumit Gupta Project Report

memory. Here we use ic 24co2 memory to save all the detail of the project. This memory is a 8 pin memory. Pin no 8 is connected to the positive supply. Pin no 1,2,3,4 is connected to the ground here in this project we connect pin no 5 and 6 is to the controller directly. Pin no 8 is also connected to the positive 5 volt supply. Pin no 7 is wp pin. Here pin no 7 is also connected to the pin no 12.

SERIAL CLOCK (SCL):

The SCL input is used to positive edge clock data into eachEEPROM

device and negative edge clock data out of each device.When we want to

enter a data in the memory then we provide a low to high pulse and when

we get a data from the memory then we provide a high to low signal.

Page 22: Sumit Gupta Project Report

SERIAL DATA (SDA):

The SDA pin is bi-directional for serial data transfer. This pin is open-drain driven

and may be wire-ORed with any number of other open-drain or opencollector

devices.

DEVICE/PAGE ADDRESSES (A2, A1, A0):

The A2, A1 and A0 pins are device address inputs that are hard wired for

the AT24C01A and the AT24C02. As many aseight 1K/2K devices may be

addressed on a single bus system (device addressing is discussed in detail

under the Device Addressing section).The AT24C04 uses the A2 and A1

inputs for hard wire addressing and a total of four 4Kdevices may be

addressed on a single bus system. The A0 pin is a no connect.The

AT24C08 only uses the A2 input for hardwire addressing and a total of two

8K devices may be addressed on a single bus system. The A0 and A1 pins

are no connects.

Page 23: Sumit Gupta Project Report

WRITE PROTECT (WP):

The AT24C01A/02/04/16 has a Write Protect pin that provideshardware

data protection. The Write Protect pin allows normal read/write

operationswhen connected to ground (GND). When the Write Protect pin is

connected to VCC, thewrite protection feature is enabled and operates as

shown in the following table.

Operation CLOCK and DATA TRANSITIONS:

The SDA pin is normally pulled high with an external device. Data on the SDA

pin may change only during SCL low time periods (refer to Data Validity timing

diagram). Data changes during SCL high periods will indicate a startor stop

condition as defined below.

START CONDITION:

Page 24: Sumit Gupta Project Report

A high-to-low transition of SDA with SCL high is a start conditionwhich

must precede any other command (refer to Start and Stop Definition timing

diagram).

STOP CONDITION:

A low-to-high transition of SDA with SCL high is a stop condition.After a

read sequence, the stop command will place the EEPROM in a standby

power mode (refer to Start and Stop Definition timing diagram).

ACKNOWLEDGE:

All addresses and data words are serially transmitted to and from the

EEPROM in 8-bit words. The EEPROM sends a zero to acknowledge that it

has received each word. This happens during the ninth clock cycle.

STANDBY MODE:

The AT24C01A/02/04/08/16 features a low-power standby modewhich is

enabled: (a) upon power-up and (b) after the receipt of the STOP bit and

the completion of any internal operations.

AT24C01A/02/04/08/16

Page 25: Sumit Gupta Project Report

Device Addressing The 1K, 2K, 4K, 8K and 16K EEPROM devices all

require an 8-bit device address word following a start condition to enable

the chip for a read or write operation (refer to Figure1).The device address

word consists of a mandatory one, zero sequence for the first four most

significant bits as shown. This is common to all the EEPROM devices.The

next 3 bits are the A2, A1 and A0 device address bits for the 1K/2K

EEPROM.These 3 bits must compare to their corresponding hard-wired

input pins.The 4K EEPROM only uses the A2 and A1 device address bits

with the third bit being a memory page address bit. The two device address

bits must compare to their corresponding hard-wired input pins. The A0 pin

is no connect.The 8K EEPROM only uses the A2 device address bit with

the next 2 bits being for memory page addressing. The A2 bit must

compare to its corresponding hard-wired input pin. The A1 and A0 pins are

no connect.The 16K does not use any device address bits but instead the 3

bits are used for memory page addressing. These page addressing bits on

the 4K, 8K and 16K devices should be considered the most significant bits

of the data word address which follows.

Page 26: Sumit Gupta Project Report

The A0, A1 and A2 pins are no connect.The eighth bit of the device

address is the read/write operation select bit. A read operation is initiated if

this bit is high and a write operation is initiated if this bit is low.Upon a

compare of the device address, the EEPROM will output a zero. If a

compare is not made, the chip will return to a standby state.

Write Operations BYTE WRITE:

A write operation requires an 8-bit data word address following the device

address word and acknowledgment. Upon receipt of this address, the

EEPROM will again respond with a zero and then clock in the first 8-bit

data word. Following receipt of the 8-bit data word, the EEPROM will output

a zero and the addressing device, such as a microcontroller, must

terminate the write sequence with a stop condition.At this time the

EEPROM enters an internally timed write cycle, tWR, to the nonvolatile

memory. All inputs are disabled during this write cycle and the EEPROM

will not respond until the write is complete (refer to Figure 2).

PAGE WRITE:

The 1K/2K EEPROM is capable of an 8-byte page write, and the 4K, 8K

and 16K devices are capable of 16-byte page writes.

Page 27: Sumit Gupta Project Report

A page write is initiated the same as a byte write, but the microcontroller

does not send a stop condition after the first data word is clocked in.

Instead, after the EEPROM acknowledges receipt of the first data word, the

microcontroller can transmit up to seven (1K/2K) or fifteen (4K, 8K, 16K)

more data words. The EEPROM will respond with a zero after each data

word received. The microcontroller must terminate the page write sequence

with a stop condition The data word address lower three (1K/2K) or four

(4K, 8K, 16K) bits are internally incremented following the receipt of each

data word. The higher data word address bits are not incremented,retaining

the memory page row location. When the word address,internally

generated, reaches the page boundary, the following byte is placed at the

beginning of the same page. If more than eight (1K/2K) or sixteen (4K, 8K,

16K) data words are transmitted to the EEPROM, the data word address

will “roll over” and previous data will be overwritten.

ACKNOWLEDGE POLLING:

Once the internally timed write cycle has started and the EEPROM inputs

are disabled, acknowledge polling can be initiated. This involves send-

Page 28: Sumit Gupta Project Report

AT24C01A/02/04/08/16

3256D–SEEPR–11/03

ing a start condition followed by the device address word. The read/write bit

is representative of the operation desired. Only if the internal write cycle

has completed will the EEPROM respond with a zero allowing the read or

write sequence to continue.

Read Operations Read operations are initiated the same way as write

operations with the exception that the read/write select bit in the device

address word is set to one. There are three read operations: current

address read, random address read and sequential read.

CURRENT ADDRESS READ:

The internal data word address counter maintains the last address

accessed during the last read or write operation, incremented by one. This

address stays valid between operations as long as the chip power is

maintained. Theaddress “roll over” during read is from the last byte of the

last memory page to the first byte of the first page. The address “roll over”

Page 29: Sumit Gupta Project Report

during write is from the last byte of the current page to the first byte of the

same page.Once the device address with the read/write select bit set to

one is clocked in and acknowledged by the EEPROM, the current address

data word is serially clocked out.The microcontroller does not respond with

an input zero but does generate a following stop condition

RANDOM READ:

A random read requires a “dummy” byte write sequence to load in the data

word address. Once the device address word and data word address are

clocked in and acknowledged by the EEPROM, the microcontroller must

generate another start condition. The microcontroller now initiates a current

address read by sending a device address with the read/write select bit

high. The EEPROM acknowledges the device address and serially clocks

out the data word. The microcontroller does not respond with a zero but

does generate a following stop condition.

SEQUENTIAL READ:

Sequential reads are initiated by either a current address read or a random

address read. After the microcontroller receives a data word, it responds

Page 30: Sumit Gupta Project Report

with an acknowledge. As long as the EEPROM receives an acknowledge, it

will continue to increment the data word address and serially clock out

sequential data words. When the memory address limit is reached, the data

word address will “roll over” and the sequential read will continue. The

sequential read operation is terminated when the microcontroller does not

respond with a zero but does generate a following stop condition.

10 AT24C01A/02/04/08/16

(* = DON’T CARE bit for 1K)

Page 31: Sumit Gupta Project Report

OPTOCOUPLERS:

A lot of electronic equipment nowadays are using optocoupler in the circuit. An optocoupler or sometimes refer to as optoisolator allows two circuits to exchange signals yet remain electrically isolated. This is usually accomplished by using light to relay the signal. The standard optocoupler circuits design uses a LED shining on a phototransistor-usually it is a npn transistor and not pnp. The signal is applied to the LED, which then shines on the transistor in the ic.  The light is proportional to the signal, so the signal is thus transferred to the phototransistor. Optocouplers may also comes in few module such as the SCR, photodiodes, TRIAC of other semiconductor switch as an output, and incandescent lamps, neon bulbs or other light source. I also came across two led and two phototransistors in a package in the power supply of a NEC printer. In this article i will explain only the most commonly used opto coupler which is the combination of LED and phototransistor. See the optocoupler ic schematic diagram below: 

It is a small device that allows the transmission of a signal between parts of a circuit while keeping those two parts electrically isolated. How is this so? Inside our typical optocoupler are two things – an LED and a phototransistor. When a current runs through the LED, it switches on  - at which point the phototransitor detects the light and allows another current to flow through it. And then when the LED is off, current cannot flow through the phototransistor. All the while the two currents are completely electrically isolated (when operated within their stated parameters!)

Switching DC current will flow from A to B, causing current to flow from C to D. The schematic for figure one is a simple optocoupler, consisting of the LED and the photo-transistor. However, this is not suitable for AC current, as the diode will only conduct current in one direction. For AC currents, we

Page 32: Sumit Gupta Project Report

have an example in figure two – it has diodes positioned to allow current to flow in either polarity. Figure three is an optocoupler with a photodarlington output type. These have a much higher output gain, however can only handle lesser frequencies (that is, they need more time to switch on and off).

Physically, optocouplers can be found in the usual range of packaging, such as:

Some of you may be thinking “why use an optocoupler, I have a relay?” Good question. There are many reasons, including:

Size and weight. Relays are much larger, and heavier; Solid state – no moving parts, so no metal fatigue; Optocouplers are more suited to digital electronics – as they

don’t have moving parts they can switch on and off much quicker than a relay;

Much less current required to activate than a relay coil The input signal’s impedance may change, which could

affect the circuit – using an optocoupler to split the signal removes this issue;

Page 33: Sumit Gupta Project Report

Furthermore, the optocoupler has many more interesting uses. Their property of electrical isolation between the two signals allows many things to be done. For example:

you might wish to detect when a telephone is ringing, in order to switch on a beacon. However you cannot just tap into the telephone line. As the ring is an AC current, this can be used with an AC-input optocoupler. Then when the line current starts (ring signal) the optocoupler can turn on the rest of your beacon circuit. Please note that you most likely need to be licensed to do such things. Have a look at the example circuits in this guide from Vishay: Vishay Optocouplers.pdf.

You need to send digital signals from an external device into a computer input – an optocoupler allows the signals to pass while keeping the external device electrically isolated from the computer

You need to switch a very large current or voltage, but with a very small input current;

and so on…

But as expected, the optocoupler has several parameters to be aware of. Let’s look at a data sheet for a very common optocoupler, the 4N25 – 4N25 data sheet.pdf – and turn to page two. The parameters for the input and output stages are quite simple, as they resemble those of the LED and transistor. Then there is the input to output isolation voltage – which is critical. This is the highest voltage that can usually be applied for one second that will not breach the isolation inside the optocoupler.

Side note: You may hear about optoisolators. These are generally known as optocouplers that have output isolation voltages of greater than 5000 volts; however some people regularly interchange optocouplers and optoisolators.

Page 34: Sumit Gupta Project Report

The next parameter of interest is the current-transfer ratio, or CTR. This is the ratio between the output current flow and the input current that caused it. Normally this is around ten to fifty percent – our 4N25 example is twenty percent at optimum input current. CTR will be at a maximum when the LED is the brightest – and not necessarily at the maximum current the LED can handle. Once the CTR is known, you can

configure your circuit for an analogue response, in that the input current (due to the CTR) controls the output current.

EPROM

An EPROM (rarely EROM), or erasable programmable read only memory, is a type of memory chip that retains its data when its power supply is switched off. In other words, it is non-volatile. It is an array of floating-gate transistors individually programmed by an electronic device that supplies higher voltages than those normally used in digital circuits. Once programmed, an EPROM can be erased by exposing it to strong ultraviolet light from a mercury-vapor light source. EPROMs are easily recognizable by the transparent fused quartz window in the top of the package, through which the siliconchip is visible, and which permits exposure to UV light during erasing

OPERATION

Development of the EPROM memory cell started with investigation of faulty integrated circuits where the gate connections of transistors had broken. Stored charge on these isolated gates changed their properties. The EPROM was invented by Dov Frohman of Intel in 1971, who was awarded US patent 3660189 in 1972.

Page 35: Sumit Gupta Project Report

A cross-section of a floating-gate transistorEach storage location of an EPROM consists of a single field-effect transistor. Each field-effect transistor consists of a channel in the semiconductor body of the device. Source and drain contacts are made to regions at the end of the channel. An insulating layer of oxide is grown over the channel, then a conductive (silicon or aluminum) gate electrode is deposited, and a further thick layer of oxide is deposited over the gate electrode. The floating gate electrode has no connections to other parts of the integrated circuit and is completely insulated by the surrounding layers of oxide. A control gate electrode is deposited and further oxide covers it. 

To retrieve data from the EPROM, the address represented by the values at the address pins of the EPROM is decoded and used to connect one word (usually an 8-bit byte) of storage to the output buffer amplifiers. Each bit of the word is a 1 or 0, depending on the storage transistor being switched on or off, conducting or non-conducting.

The switching state of the field-effect transistor is controlled by the voltage on the control gate of the transistor. Presence of a voltage on this gate creates a conductive channel in the transistor, switching it on. In effect, the stored charge on the floating gate allows the threshold voltage of the transistor to be programmed.

Storing data in the memory requires selecting a given address and applying a higher voltage to the transistors. This creates an avalanche discharge of electrons, which have enough energy to pass through the insulating oxide layer and accumulate on the gate electrode. When the high voltage is removed, the electrons are trapped on the electrode. Because of the high

Page 36: Sumit Gupta Project Report

insulation value of the silicon oxide surrounding the gate, the stored charge cannot readily leak away and the data can be retained for decades.

Unlike EEPROMs, the programming process is not electrically reversible. To erase the data stored in the array of transistors, ultraviolet light is directed onto the die. Photons of the UV light create ionization within the silicon oxide, which allow the stored charge on the floating gate to dissipate. Since the whole memory array is exposed, all the memory is erased at the same time. The process takes several minutes for UV lamps of convenient sizes; sunlight would erase a chip in weeks, and indoorfluorescent lighting over several years. Generally the EPROMs must be removed from equipment to be erased, since it's not usually practical to build in a UV lamp to erase parts in-circuit.

ApplicationFor large volumes of parts (thousands of pieces or more), mask-programmed ROMs are the lowest cost devices to produce. However, these require many weeks lead time to make, since the artwork for an IC mask layer must be altered to store data on the ROMs. Initially, it was thought that the EPROM would be too expensive for mass production use and that it would be confined to development only. It was soon found that small-volume production was economical with EPROM parts, particularly when the advantage of rapid upgrades of firmware was considered.

Some microcontrollers, from before the era of EEPROMs and flash memory, use an on-chip EPROM to store their program. Such microcontrollers include some versions of the Intel 8048, the Freescale 68HC11, and the "C" versions of the PIC microcontroller. Like EPROM chips, such microcontrollers came in windowed (expensive) versions that were useful for debugging and program development. The same chip came in (somewhat cheaper) opaque OTP packages for production. Leaving the die of such a chip exposed to light can also change behavior in unexpected ways when moving from a windowed part used for development to a non-windowed part for production.

Page 37: Sumit Gupta Project Report

TRANSFORMER

PRINCIPLE OF THE TRANSFORMER:-

Two coils are wound over a Core such that they are magnetically coupled. The two coils are known as the primary and secondary windings.

In a Transformer, an iron core is used. The coupling between the coils is source of making a path for the magnetic flux to link both the coils. A core as in fig.2 is used and the coils are wound on the limbs of the core. Because of high permeability of iron, the flux path for the flux is only in the iron and hence the flux links both windings. Hence there is very little ‘leakage flux’. This term leakage flux denotes the part of the flux, which does not link both the coils, i.e., when coupling is not perfect. In the high frequency transformers, ferrite core is used. The transformers may be step-up, step-down, frequency matching, sound output, amplifier driver etc. The basic principles of all the transformers are same.

Page 38: Sumit Gupta Project Report

MINIATURE TRANSFORMER

CONVENTIONAL POWER TRANSFORMER

Page 39: Sumit Gupta Project Report

LIGHT EMITTING DIODE

A light-emitting diode  is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness.

When a light-emitting diode is forward biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. An LED is often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern.LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, faster switching, and greater durability and reliability. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output.

Light-emitting diodes are used in applications as diverse as replacements for aviation lighting, automotive lighting (particularly brake lamps, turn signals andindicators) as well as in traffic signals. The compact size, the possibility of narrow bandwidth, switching speed, and extreme reliability of LEDs has allowed new text and video displays and sensors to be developed, while their high switching rates are also useful in advanced communications technology. InfraredLEDs are also used in the remote control units of many commercial products including televisions, DVD players, and other domestic appliances.

Page 40: Sumit Gupta Project Report

Technology

Physics

The LED consists of a chip of semiconducting material doped with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—electrons and holes—flow into the junction from electrodes with different voltages. When an electron meets a hole, it falls into a lower energy level, and releases energy in the form of aphoton.

The wavelength of the light emitted, and thus its color depends on the band gap energy of the materials forming the p-n junction. In silicon orgermanium diodes, the electrons and holes recombine by a non-radiative transition which produces no optical emission, because these areindirect band gap materials. The materials used for the LED have a direct band gap with energies corresponding to near-infrared, visible or near-ultraviolet light.

LED development began with infrared and red devices made with gallium arsenide. Advances in materials science have enabled making devices with ever-shorter wavelengths, emitting light in a variety of colors.

LEDs are usually built on an n-type substrate, with an electrode attached to the p-type layer deposited on its surface. P-type substrates, while less common, occur as well. Many commercial LEDs, especially GaN/InGaN, also use sapphire substrate.

Most materials used for LED production have very high refractive indices. This means that much light will be reflected back into the material at the material/air surface interface. Thus, light extraction in LEDs is an important aspect of LED production, subject to much research and development.

Page 41: Sumit Gupta Project Report

The inner workings of an LED I-V diagram for a diode.

Ultraviolet and blue LEDsBlue LEDs are based on the wide band gap semiconductors GaN (gallium nitride) and InGaN (indium gallium nitride). They can be added to existing red and green LEDs to produce the impression of white light, though white LEDs today rarely use this principle.

The first blue LEDs were made in 1971 by Jacques Pankove (inventor of the gallium nitride LED) at RCA Laboratories. These devices had too little light output to be of much practical use. In August of 1989, Cree Inc. introduced the first commercially available blue LED.

 In the late 1980s, key breakthroughs in GaN epitaxial growth and p-type doping ushered in the modern era of GaN-based optoelectronic devices. Building upon this foundation, in 1993 high brightness blue LEDs were demonstrated.

By the late 1990s, blue LEDs had become widely available. They have an active region consisting of one or more InGaN quantum wells sandwiched between thicker layers of GaN, called cladding layers. By varying the relative InN-GaN fraction in the InGaN quantum wells, the light emission can be varied from violet to amber. AlGaN aluminium gallium nitride of varying AlN fraction can be used to manufacture the cladding and quantum well layers for ultraviolet LEDs, but these devices have not yet reached the

Page 42: Sumit Gupta Project Report

level of efficiency and technological maturity of the InGaN-GaN blue/green devices. If the active quantum well layers are GaN, instead of alloyed InGaN or AlGaN, the device will emit near-ultraviolet light with wavelengths around 350–370 nm. Green LEDs manufactured from the InGaN-GaN system are far more efficient and brighter than green LEDs produced with non-nitride material systems.

With nitrides containing aluminium, most often AlGaN and AlGaInN, even shorter wavelengths are achievable. Ultraviolet LEDs in a range of wavelengths are becoming available on the market. Near-UV emitters at wavelengths around 375–395 nm are already cheap and often encountered, for example, as black light lamp replacements for inspection of anti-counterfeiting UV watermarks in some documents and paper currencies. Shorter wavelength diodes, while substantially more expensive, are commercially available for wavelengths down to 247 nm.As the photosensitivity of microorganisms approximately matches the absorption spectrum of DNA, with a peak at about 260 nm, UV LED emitting at 250–270 nm are to be expected in prospective disinfection and sterilization devices. Recent research has shown that commercially available UVA LEDs (365 nm) are already effective disinfection and sterilization devices.

Deep-UV wavelengths were obtained in laboratories using aluminium nitride (210 nm), boron nitride (215 nm) and diamond (235 nm).

White light

There are two primary ways of producing high intensity white-light using LEDs. One is to use individual LEDs that emit three primary colors red, green, and blue and then mix all the colors to form white light. The other is to use a phosphor material to convert monochromatic light from a blue or UV LED to broad-spectrum white light, much in the same way a fluorescent light bulb works.Due to metamerism, it is possible to have quite different spectra that appear white.

Page 43: Sumit Gupta Project Report

Types

LEDs are produced in a variety of shapes and sizes. The 5 mm cylindrical package (red, fifth from the left) is the most common, estimated at 80% of world production.The color of the plastic lens is often the same as the actual color of light emitted, but not always. For instance, purple plastic is often used for infrared LEDs, and most blue devices have clear housings. There are also LEDs in SMT packages, such as those found on blinkiesand on cell phone keypads

Advantages

Efficiency: LEDs emit more light per watt than incandescent light bulbs. Their efficiency is not affected by shape and size, unlike fluorescent light bulbs or tubes.

Color: LEDs can emit light of an intended color without using any color filters as traditional lighting methods need. This is more efficient and can lower initial costs.

Size: LEDs can be very small (smaller than 2 mm2) and are easily populated onto printed circuit boards.

On/Off time: LEDs light up very quickly. A typical red indicator LED will achieve full brightness in under a microsecond. LEDs used in communications devices can have even faster response times.

Page 44: Sumit Gupta Project Report

Cycling: LEDs are ideal for uses subject to frequent on-off cycling, unlike fluorescent lamps that fail faster when cycled often, or HID lamps that require a long time before restarting.

Dimming: LEDs can very easily be dimmed either by pulse-width modulation or lowering the forward current.

Cool light: In contrast to most light sources, LEDs radiate very little heat in the form of IR that can cause damage to sensitive objects or fabrics. Wasted energy is dispersed as heat through the base of the LED.

Slow failure: LEDs mostly fail by dimming over time, rather than the abrupt failure of incandescent bulbs.

Lifetime: LEDs can have a relatively long useful life. One report estimates 35,000 to 50,000 hours of useful life, though time to complete failure may be longer. Fluorescent tubes typically are rated at about 10,000 to 15,000 hours, depending partly on the conditions of use, and incandescent light bulbs at 1,000–2,000 hours.

Shock resistance: LEDs, being solid state components, are difficult to damage with external shock, unlike fluorescent and incandescent bulbs which are fragile.

Focus: The solid package of the LED can be designed to focus its light. Incandescent and fluorescent sources often require an external reflector to collect light and direct it in a usable manner.

Disadvantages

High initial price: LEDs are currently more expensive, price per lumen, on an initial capital cost basis, than most conventional lighting technologies. The additional expense partially stems from the relatively low lumen output and the drive circuitry and power supplies needed.

Temperature dependence: LED performance largely depends on the ambient temperature of the operating environment. Over-driving an LED in high ambient temperatures may result in overheating the LED package, eventually leading to device failure. Adequate heat sinking is needed to maintain long life. This is especially important in automotive,

Page 45: Sumit Gupta Project Report

medical, and military uses where devices must operate over a wide range of temperatures, and need low failure rates.

Voltage sensitivity: LEDs must be supplied with the voltage above the threshold and a current below the rating. This can involve series resistors or current-regulated power supplies.

Light quality: Most cool-white LEDs have spectra that differ significantly from a black body radiator like the sun or an incandescent light. The spike at 460 nm and dip at 500 nm can cause the color of objects to be perceived differently under cool-white LED illumination than sunlight or incandescent sources, due to metamerism,[91] red surfaces being rendered particularly badly by typical phosphor based cool-white LEDs. However, the color rendering properties of common fluorescent lamps are often inferior to what is now available in state-of-art white LEDs.

Area light source: LEDs do not approximate a “point source” of light, but rather a lambertian distribution. So LEDs are difficult to apply to uses needing a spherical light field. LEDs cannot provide divergence below a few degrees. In contrast, lasers can emit beams with divergences of 0.2 degrees or less.[92]

Blue hazard: There is a concern that blue LEDs and cool-white LEDs are now capable of exceeding safe limits of the so-called blue-light hazard as defined in eye safety specifications such as ANSI/IESNA RP-27.1–05: Recommended Practice for Photobiological Safety for Lamp and Lamp Systems.[93][94]

Electrical Polarity : Unlike incandescent light bulbs, which illuminate regardless of the electrical polarity, LEDs will only light with correct electrical polarity.

Blue pollution: Because cool-white LEDs (i.e., LEDs with high color temperature) emit proportionally more blue light than conventional outdoor light sources such as high-pressure sodium vapor lamps, the strong wavelength dependence of Rayleigh scattering means that cool-white LEDs can cause more light pollution than other light sources.

Page 46: Sumit Gupta Project Report

The International Dark-Sky Associationdiscourages using white light sources with correlated color temperature above 3,000 K.

Droop: The efficiency of LEDs tends to decrease as one increases current.

Application

Indicators and signs

The low energy consumption, low maintenance and small size of modern LEDs has led to uses as status indicators and displays on a variety of equipment and installations. Large-area LED displays are used as stadium displays and as dynamic decorative displays. Thin, lightweight message displays are used at airports and railway stations, and as destination displays for trains, buses, trams, and ferries.

One-color light is well suited for traffic lights and signals, exit signs, emergency vehicle lighting, ships' navigation lights or lanterns (chromacity and luminance standards being set under the Convention on the International Regulations for Preventing Collisions at Sea 1972, Annex I and the CIE) and LED-based Christmas lights. In cold climates, LED traffic lights may remain snow covered.[101] Red or yellow LEDs are used in indicator and alphanumeric displays in environments where night vision must be retained: aircraft cockpits, submarine and ship bridges, astronomy observatories, and in the field, e.g. night time animal watching and military field use.

Because of their long life and fast switching times, LEDs have been used in brake lights for cars high-mounted brake lights, trucks, and buses, and in turn signals for some time, but many vehicles now use LEDs for their rear light clusters. The use in brakes improves safety, due to a great reduction in the time needed to light fully, or faster rise time, up to 0.5 second faster than an incandescent bulb. This gives drivers behind more time to react. It is reported that at normal highway speeds, this equals one car length

Page 47: Sumit Gupta Project Report

equivalent in increased time to react. In a dual intensity circuit (i.e., rear markers and brakes) if the LEDs are not pulsed at a fast enough frequency, they can create a phantom array, where ghost images of the LED will appear if the eyes quickly scan across the array. White LED headlamps are starting to be used. Using LEDs has styling advantages because LEDs can form much thinner lights than incandescent lamps with parabolic reflectors.

Due to the relative cheapness of low output LEDs, they are also used in many temporary uses such as glowsticks, throwies, and the photonic textile Lumalive . Artists have also used LEDs for LED art.

Weather/all-hazards radio receivers with Specific Area Message Encoding (SAME) have three LEDs: red for warnings, orange for watches, and yellow for advisories & statements whenever issued.

Lighting

With the development of high efficiency and high power LEDs it has become possible to use LEDs in lighting and illumination. Replacement light bulbs have been made, as well as dedicated fixtures and LED lamps. LEDs are used as street lights and in other architectural lighting where color changing is used. The mechanical robustness and long lifetime is used in automotive lighting on cars, motorcycles and on bicycle lights.

LED street lights are employed on poles and in parking garages. In 2007, the Italian village Torraca was the first place to convert its entire illumination system to LEDs.[102]

LEDs are used in aviation lighting. Airbus has used LED lighting in their Airbus A320 Enhanced since 2007, and Boeing plans its use in the 787. LEDs are also being used now in airport and heliport lighting. LED airport fixtures currently include medium-intensity runway lights, runway centerline lights, taxiway centerline & edge lights, guidance signs and obstruction lighting.

Page 48: Sumit Gupta Project Report

LEDs are also suitable for backlighting for LCD televisions and lightweight laptop displays and light source for DLP projectors (See LED TV). RGB LEDs raise the color gamut by as much as 45%. Screens for TV and computer displays can be made thinner using LEDs for backlighting.

LEDs are used increasingly in aquarium lights. Particularly for reef aquariums, LED lights provide an efficient light source with less heat output to help maintain optimal aquarium temperatures. LED-based aquarium fixtures also have the advantage of being manually adjustable to emit a specific color-spectrum for ideal coloration of corals, fish, and invertebrates while optimizing photosynthetically active radiation (PAR) which raises growth and sustainability of photosynthetic life such as corals, anemones, clams, and macroalgae. These fixtures can be electronically programmed to simulate various lighting conditions throughout the day, reflecting phases of the sun and moon for a dynamic reef experience. LED fixtures typically cost up to five times as much as similarly rated fluorescent or high-intensity discharge lighting designed for reef aquariums and are not as high output to date.

The lack of IR/heat radiation makes LEDs ideal for stage lights using banks of RGB LEDs that can easily change color and decrease heating from traditional stage lighting, as well as medical lighting where IR-radiation can be harmful. In energy conservation, LED's lower heat output also means air conditioning(cooling) systems have less heat to dispose of, reducing carbon emmissions.

LEDs are small, durable and need little power, so they are used in hand held devices such as flashlights. LED strobe lights or camera flashes operate at a safe, low voltage, instead of the 250+ volts commonly found in xenon flashlamp-based lighting. This is especially useful in cameras on mobile phones, where space is at a premium and bulky voltage-raising circuitry is undesirable.

LEDs are used for infrared illumination in night vision uses including security cameras. A ring of LEDs around a video camera, aimed

Page 49: Sumit Gupta Project Report

forward into aretroreflective background, allows chroma keying in video productions.

LED’s are now used commonly in all market areas from commercial to home use (standard lighting and AV installations, stage and theatrical, architectural and public spaces, in fact anywhere and everywhere that artificial light is used.

In many countries incandescent lighting for homes and offices is no longer available and building regulations insist on new premises being fitted out at day one with LED fixtures and fittings.

Increasingly the adaptability of colour LED’s are finding uses in medical and educational applications such as mood enhancement and new technologies, such as AmBX, for the control of colour LED’s have been developed to exploit LED versatility. Nasa has even sponsored research for the use of LED's to promote health for astronauts. 

Page 50: Sumit Gupta Project Report

CIRCUIT WORKING

IN this project our first part is dtmf decoder. DTMF ic receive the dtmf pulse and

then converted into binary coded decimal . Pin no 18 of the the ic is connected to

positive supply ,. In this circuit we use 5 volt regulated power supply for the

smooth working.

DTMF signal is applied to the pin no 2 and 3 of the ic through resistor and

capacitor network. Capacitor .1 microfarad work as a dc blocking capacitor. Pin no

5,6,9 is connected to the ground pin. Pin n0 7 and 8 is connected to the 3.57945

Mhz crystal. Pin no 16 and 17 is connected to rc network work as a auto reset,

when we switch on the power supply.

BCD output is available on the pin no 11,12,13,1,4, and this output is connected

to the microcontroler 89c51.

Our next part of the circuit is ic 89c51. 89c51 is 40 pin ic. Pin no 40 of the ic is

connected to the positive supply. Pin no 9 is rest pin. One capacitor and resistor

network is connected to pin no 9. this microcontroller has a total of four input

output ports each 8 bit wide.

Page 51: Sumit Gupta Project Report

We use port 2 as a bcd input. Output from the 8870 is connected to the p2 – 4

pins.

8870 port2 IC pin

Pin 11 p2.0 21

Pin 12 p2.1 22

Pin 13 p2.2 23

Pin 14 p2.3 24

Output is available on the port1 and port 3, here we use only 10 output from the

microcontroller. All the output is available on the port p1

P1.0 pin no 39

P1.1 pin no 38

P1.2 pin no 37

Page 52: Sumit Gupta Project Report

P1.3 pin no 36

P1.4 pin no 35

P1.5 pin no 34

P1.6 pin no 33

P1.7 pin no 32

P3.0 pin no 10

P3.1 pin no 11

All the output led is connected to this output. Note that 0 logic is available on

these pin , so cathode of the led is connected to this pin.

Another pins of the port 3 is also connected for another useful uses.

P3.3 acknowledge of code lock

P3.4 Time indication of the code lock

Page 53: Sumit Gupta Project Report

P3.5 led indication of sound output for on/off signal

P3.2 output frequency for opto-coupler input.

LED output of the microcontroller is further connected to the triac circuit through

opto-coupler circuit. Output from the microcontroller is firstly connected to the

optocoupler pin no 1. this optocoupler is a special optocoupler. The MOC3121 is

optically isolated triac driver devices. These devices contain a infra red emitting

diode and a light activated silicon bilateral switch. They are specially designed for

interfacing between electronics controls and power triaces to control resistive

and inductive loads for 240 volt Ac operation.

Pin no 1 is anode pin of infra red transmitter

Pin no2 is cathode pin of infra red transmitter

Pin no 4 and 6 is the output pin

Pin no 6 is output pin and connected to the gate of the triac through 100 ohm

resistor.At the output of the triac we control any 220 load. In this project its our

choice, how many optocoupler we interface this circuit. If we use 10 opto coupler

then we interface 10 load output with this circuit.

Page 54: Sumit Gupta Project Report

Now when ic receive any pulse then output led is on and then load is on. Again

we press the same code then led is off and load is also off.

Working of this microcontroller is depend on the combination lock. When

combination lock gives a output on port3.3 then only ic sense the signal

ELECTRONICS COMBINATION LOCK

In this section we use two ic one is ic 74154 and second is ic 4017 . Both ic

generate a combination sequence by which we enable the microcontroller.

When we want to switch on the base unit by outer phone then phone is

automatic on after few bells, this is achive by another circuit. But after few bells

when phone is on and unit require a code of 9 numbers. When we press a proper

code then only micrcontroller allow us to switch on the circuit.

First ic of this section is ic 74154. IC 74154 is bcd to decimal decoder. 74154 is

active low ic. Pin no 20,21,22,23 is connected to dtmf decoder ic.

Pin no 18 and 19 of this ic is connected to the collector of one npn transistor Base

of the npn transistor is connected to the pin no 15 of the ic 8870. When dtmf

Page 55: Sumit Gupta Project Report

decoder decode the signal at that time pin no 15 is on for a time and acknowledge

the signal. This signal is fed to the base of NPN transistor through 1 kohm

resistor. When this signal is coming then 74154 is on and gives a output.

If we press the proper code in steps then at every digit of code 74154 is on and

gives the corresponding output as per the digit. Output of the ic 74154 is

connected to the pnp transistor

base point through 10 k ohm resistor. Emitter of the all pnp transistor is

connected output of the decade counter circuit. Here we use ic 4017 as a decade

counter circuit. Pin no 16 is the positive supply pin and pin no 8 is the negative

pin. Pin no 14 of the ic is clock input of the ic.. On starting mode when is in on

reset mode then its start from the zero point.. O means first output is available on

the pin no 3. Its means pin no 3 is positive in first output. Now ic 4017 receive a

clock pulse on pin no 14 then counter shifts its output from pin no 3 to nest

output not 1 , pin no 2.

As we press the proper code then ic 74154 gives a output and this output is

available on the output pin, with the help of this output pnp transistor is on and

positive output is available on the collector point of the pnp transistor. All the pnp

Page 56: Sumit Gupta Project Report

transistor collector point is connected together is and reconnected to the clock

input of the ic 4017 through rc network to another npn transistor. By this npn

transistor we give a clock pulse to the pin no 14 of the ic 4017. As the counter

move after incoming clock pulse then last output is available on the pin no 9. As

the last output is available on the pin no 9. After getting a voltage on the pin no 9

we switch on the next pair of npn transistor. Output of first npn transistor is on

collector is connected to the port p3.4 to give a acknowledge signal that code

lock is loaded successfully. Output of the this npn transistor is again connected to

the connected to the base of next npn transistor. Collector of this npn transistor

disable the pin no 18 of the ic to receive any further code input of the signal

AUTO SWITH ON PHONE FORM INCOMING CALL.

In this project if we use mobile phone as a receiver then we use handfree kit.

After using a handfree kit we assign our phone to a auto action mode. In auto

action mode we assign our phone to on itself after some time. In every phone

there is a option of auto answer mode after few bell.

Our next circuit is Automatic switch on this circuit on the incoming call. In the

case of landline phone we use auto hook up circuit to switch on the base unit

automatically.For this circuit we use one optocoupler circuit + one timer circuit +

one counter circuit.

Page 57: Sumit Gupta Project Report

Signal from telephone lines is connected to the optocoupler pin no1. Pin no 2 is

ground pin. Pin no 3 is also ground pin. Pin no 4 is the output pin no of this

optocoupler,. When incoming call connected to optocoupler the optocoupler is

on and output pulse is connected to the pin no 2 of the monostable timer circuit.

Pin no 4 and 8 is connected to the positive supply and pin no 1 is connected to the

negative supply. Pin no 3 is output pin and this pin is connected to the next ic.

Next ic is counter circuit. In counter circuit we use ic 4017. Pin no 16 is connected

to the positive supply. Pin no 8 is connected to the negative supply. Pin no 13 and

7 is a output pin and connected to the relay through npn transistor.

When call in coming then due to short pulse from the bell optocoupler is

on/off for the frequency of the bell. But when output is connected to ic 555 then

ic555 is switch on for a time period. And for every pulse timer is on for a second

and output from timer is connected to counter circuit. We use forth output of the

counter so that after receiving forth pulse counter is on and switch on the relay

circuit and connect the main circuit to the telephone instrument.

Page 58: Sumit Gupta Project Report

PROGRAM CODE

PROGRAMMING DETAIL OF THE MOBILE CONTROL MOBILE CONTROL PROGRAM

IS TO BE WRIITEN IN THE ASSEMBLLY LANGUAGE IN THE 8051 ASSEMBLER.

ASSEMBLER ASSEMBLE THE SOFTWARE AND THEN THIS SOFTWARE IS FURTHER

CONVERTED INTO THE HEX CODE WITH THE HELP OFASSEMBLER ITSELF.

In this program we receive the data from the dtmf decoder i.c and then this bcd

input is processed by the microcontroller.

org 0000h

ORG 0000H IS OUR FIRST OPERATION CODE . WE WRITTEN OUR CODE IN THE

0000H LOCATION AND THEN START FROM 0000H LOCATION AND JUMP TO THE

MAIN PROGRGRAM BY USING COMMAND SJMP MAIN

Sjmp main

org 30h

main:

mov p3,#0ffh

Page 59: Sumit Gupta Project Report

mov p1,#0ffh

mov p2,#0ffh

mov p0,#0ffh

first of all we get a data on one port and then this is to be compare with the

accumulator for different value

back: mov a,p3

cjne a,#1,l1

cpl sw_1

call sound

s1: mov a,p3

cjne a,#1,l1

jmp s1

here we use a command mov a, p3 . Here p3 means port 3 , from where we get a

data to the accumulator, We change this location as per the pcb design, If the

port position is change we change the command also, if the input is port p2 then

we use mov a,p2 command

l1: mov a,p3

anl a,#0fh

cjne a,#2,l2

call sound

s2: mov a,p3

Page 60: Sumit Gupta Project Report

cjne a,#2,l2

jmp s2

l2: mov a,p3

cjne a,#3,l3

call sound

s3: mov a,p3

cjne a,#3,l3

jmp s3

l3: mov a,p3

cjne a,#4,l4

call sound

s4: mov a,p3

cjne a,#4,l4

jmp s4

l4: mov a,p3

cjne a,#5,l5

call sound

s5: mov a,p3

cjne a,#5,l5

jmp s5

Page 61: Sumit Gupta Project Report

l5: mov a,p3

anl a,#0fh

cjne a,#6,l6

call sound

s6: mov a,p3

cjne a,#6,l6

jmp s6

l6: mov a,p3

cjne a,#7,l7

call sound

s7: mov a,p3

cjne a,#7,l7

jmp s7

l7: mov a,p3

cjne a,#8,l8

call sound

s8: mov a,p3

cjne a,#8,l8

Page 62: Sumit Gupta Project Report

jmp s8

l8: mov a,p3

anl a,#0fh

cjne a,#9,l9

call sound

s9: mov a,p3

cjne a,#9,l9

jmp s9

l9: mov a,p3

cjne a,#10,l10

call sound

s10: mov a,p3

cjne a,#10,l10

jmp s10

l10: jmp back

Page 63: Sumit Gupta Project Report

sound:

mov tick,#2

go_back:call delay100ms

go: mov tick,#1

jmp go_back

clr buzzer

call delay

setb buzzer

call delay

ret

delay:

mov r0,#20

loop: djnz r0,loop

ret

mov r5,#4

sim_4: call delay100ms

Page 64: Sumit Gupta Project Report

djnz r5,sim_4