122
Temperature Sensors (LM35) Introduction: The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1/4°C at room temperature and ±3/4°C over a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35’s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°C temperature range, while the LM35C is rated for a - 40° to +110°C range (-10° with improved accuracy). The LM35 series is available packaged plastic TO-92 transistor

Temperature Sensors LM35

Embed Size (px)

DESCRIPTION

nujmnj

Citation preview

Page 1: Temperature Sensors LM35

Temperature Sensors (LM35)

Introduction:

The LM35 series are precision integrated-circuit temperature sensors, whose

output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35

thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is

not required to subtract a large constant voltage from its output to obtain convenient

centigrade scaling. The LM35 does not require any external calibration or trimming to

provide typical accuracies of ±1/4°C at room temperature and ±3/4°C over a full -55 to

+150°C temperature range. Low cost is assured by trimming and calibration at the wafer

level. The LM35’s low output impedance, linear output, and precise inherent calibration

make interfacing to readout or control circuitry especially easy. It can be used with single

power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply,

it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over

a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C

range (-10° with improved accuracy). The LM35 series is available packaged plastic TO-

92 transistor package. The LM35D is also available in an 8-lead surface mount small

outline package and a plastic TO-220 package.

Features:

1. Calibrated directly in ° Celsius (Centigrade)

2. Linear + 10.0 mV/°C scale factor

3. 0.5°C accuracy guaranteeable (at +25°C)

4. Rated for full -55° to +150°C range

5. Suitable for remote applications

6. Low cost due to wafer-level trimming

7. Operates from 4 to 30 volts

8. Less than 60 µA current drain

9. Low self-heating, 0.08°C in still air

Page 2: Temperature Sensors LM35

10. Nonlinearity only ±1/4°C typical

11. Low impedance output, 0.1 for 1 mA load

Pin diagram:

Applications:

The LM35 can be applied easily in the same way as other integrated-circuit

temperature sensors. It can be glued or cemented to a surface and its temperature will be

within about 0.01°C of the surface temperature. This presumes that the ambient air

temperature is almost the same as the surface temperature; if the air temperature were

much higher or lower than the surface temperature, the actual temperature of the LM35

die would be at an intermediate temperature between the surface temperature and the air

temperature. This is expecially true for the TO-92 plastic package, where the copper

leads are the principal thermal path to carry heat into the device, so its temperature might

be closer to the air temperature than to the surface temperature. To minimize this

problem, be sure that the wiring to the LM35, as it leaves the device, is held at the same

temperature as the surface of interest. The easiest way to do this is to cover up these wires

with a bead of epoxy which will insure that the leads and wires are all at the same

temperature as the surface, and that the LM35 die’s temperature will not be affected by

the air temperature. The TO-46 metal package can also be soldered to a metal surface or

pipe without damage. Of course, in that case the V- terminal of the circuit will be

grounded to that metal. Alternatively, the LM35 can be mounted inside a sealed-end

metal tube, and can then be dipped into a bath or screwed into a threaded hole in a tank.

Page 3: Temperature Sensors LM35

As with any IC, the LM35 and accompanying wiring and circuits must be kept insulated

and dry, to avoid leakage and corrosion. This is especially true if the circuit may operate

at cold temperatures where condensation can occur. Printed-circuit coatings and

varnishes such as Humiseal and epoxy paints or dips are often used to insure that

moisture cannot corrode the LM35 or its connections. These devices are sometimes

soldered to a small light-weight heat fin, to decrease the thermal time constant and speed

up the response in slowly-moving air. On the other hand, a small thermal mass may be

added to the sensor, to give the steadiest reading despite small deviations in the air

temperature.

Page 4: Temperature Sensors LM35

A MAIN PROJECT REPORT ON

AUTOMATIC MEASUREMENT AND REPORTING SYSTEM OF WATER

QUALITY BASED ON GSM

Submitted to

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY

ANANTAPUR

For the partial fulfillment of the requirement for the Award of Degree for

BACHELOR OF TECHNOLOGY

In

ELECTRONICS AND COMMUNICATION ENGINEERING

By

M.NAJMA (09L41A0492)

G.KAMAL CHOWDHARY (09L41A04A0)

B.BHUVAN CHANDH (09L41A04A5)

B.RAJA RAO (09L41A0499)

Under the Esteemed Guidance of

Mr.G.NARENDRANATH REDDY, M.TECH.

(Assistant Professor, Dept. of ECE)

Department of Electronics and Communication Engineering

MEKAPATI RAJAMOHAN REDDY INSTITUTE OF TECHNOLOGY SCIENCE

(Affiliated to Jawaharlal Nehru Technology University, Anantapur-515001)

UDAYAGIRI-524226, S.P.S.R.NELLORE (D.T),A.P.

Page 5: Temperature Sensors LM35

MEKAPATI RAJAMOHAN REDDY INSTITUTE OF

TECHNOLOGY AND SCIENCE

(Affiliated to Jawaharlal Nehru Technology University, Anantapur-515001)

UDAYAGIRI-524226, S.P.S.R.NELLORE (D.T), A.P

BONAFIED CERTIFICATE

This is to certify that the project work entitled

AUTOMATIC MEASUREMENT AND REPORTING SYSTEM OF WATER

QUALITY BASED ON GSM

Is the bonafide work done by

M.NAJMA (09L41A0492)

G.KAMAL CHOWDARY (09L41A04A0)

B.BHUVAN CHANDH (09L41A04A5)

B.RAJA RAO (09L41A0499)

In the department of ELECTRONICS AND COMMUNICATION ENGINEERING

in MEKAPATI RAJA MOHAN REDDY INSTITUTE OF TECHNOLOGY &

SCIENCE, Udayagiri. is submitted to JAWAHARLAL NEHRU TECHNOLOGICAL

UNIVERSITY, Ananthapur in the partial fulfillment of the requirements of the

requirements for the award of B.Tech degree in ELECTRONICS AND

COMMUNICATION ENGINEERING

Internal Guide Head of the Department

Mr.G.NARENDRANATH REDDY, M.Tech. Mr.

K.VENKATESHWARLU,M.Tech,(Ph.D).

(Assistant professor,Dept.of ECE ) (Assistant professor, Dept. of ECE)

______________________________________________________________________

Submitted for Viva Voce Examination held on________________

Page 6: Temperature Sensors LM35

INTERNAL EXAMINER EXTERNAL

EXAMINER

ACKNOWLEDGEMENT

Our first and foremost thanks to the almighty for his blessings in the successful

completion of project.

We are extremely thankful to our beloved Chairman SRI

M.RAJAMOHANREDDY Sir who took interest and encouraged us in every effort

though the course.

We are extremely thankful to our beloved Secretary, SRI M.CHANDRA

SEKHAR REDDY Sir who took interest and encouraged us in every effort throughout

the course.

We are extremely thankful to our correspondent commodre

SRI.A.MASTHANAIAH Sir who took interest and encouraged us in every effort

throughout the course.

We owe our gratitude to our Principal SRI.Dr.V.K.R.JEYA SINGH, B.E,

M.Sc(Engg.), Ph.D ., F.I.E, M.I.S.T.E for his kind attention in the valuable guidance

to us throughout the course.

We profound respect, we express our deep sense of gratitude to our head of the

department SRI K.VENKATESWARULU, M.Tech, (Ph.D),Assistant professor. for

being the source of inspiration throughout our study in this college

We sincerely thank our guide SRI.G.NARENDRANATH REDDY, M.Tech.,

for his guidance, valuable suggestions and support in the completion of the mini project.

Above all we gratefully acknowledge and express our thanks to all teaching and

non teaching staff of “ELECTRONICS AND COMMUNICATION

ENGINEERING” department.

Finally, we thank all our friends who helped in getting this project report ready.

PROJECT MEMBERS

Page 7: Temperature Sensors LM35

M.NAJMA (09L41A0492)

G.KAMAL CHOWDARY (09L41A04A0)

B.BHUVAN CHANDH

(09L41A04A5)

B.RAJARAO (09L41A0499)

Page 8: Temperature Sensors LM35

CONTENTS

CHAPTER TITLE PAGE

NO

1 INTRODUCTION

2

1.1 INTRODUCTION 2

2 EMBEDDED SYSTEMS

4

2.1 INTRODUCTION To EMBEDDED SYSTEMS

4

2.1.1 HISTORY

5

2.1.2 TOOLS

6

2.1.3 RESOURCES

7

2.1.4 REAL TIME ISSUES

2.2.1 DEBUGGING

7

2.2.2 RELLABILITY

8

2.3 EXPLANATION OF EMBEDDED SYSTEMS

9

2.3.1 SOFTWARE ARCHITECTUE

9

2.3.2 STAND ALONE EMBEDDED SYSTEMS

10

Page 9: Temperature Sensors LM35

2.3.3 REAL TIME EMBEDDED SYSTEMS

10

2.3.4 NETWORK COMMUNICATION

EMBEDDED SYSTEMS 11 2.4 OVERVIEW OF EMBEDDEE SYSTEM ARCHITECTURE

2.5 CONCLUSION

Page 10: Temperature Sensors LM35

3. EXPLANATION OF EACH BLOCK AND COMPONENTS

3.1 POWER SUPPLY 3.1.1 TRANSFORMER

3.1.2 RECTIFIER 3.1.3 FILTER 3.1.4 VOLTAGE REGULATOR 3.2 AT89S52 MICROCONTROLLER

3.2.1 FEATURES

3.2.2 DESCRIPTION 15

3.2.3 PIN CONFIGURATION

3.2.4 PIN DESCRIPTION

3.2.5 MEMORIES 18

3.3 TEMPARATURE SENSOR

3.3.1 INTRODUCTION

3.3.2 FEATURES

3.3.3 PIN DIAGRAM

3.3.4 APPLICATIONS

3.4 pH METER

3.4.1 PRINCIPLE AND OPERATION

3.4.2 pH SENSOR

3.5 ANALOG TO DIGITAL CONVERTER3.5.1 INTRODUCTION3.5.2 FEATURES3.5.3 KEY SPECIFICATIONS3.5.4PINDIAGRAM3.5.5 I/O PINS3.8 LCD

3.8.1introduction

3.8.2 features 3.8.3 shapes&sizes3.7 SERIAL COMMUNICATION3.7.1 RS232 STANDADS3.7.2 DB253.7.3DB93.7.4 MAX2323.8 GSM 3.8.1 GSM ARCHITECTURE

Page 11: Temperature Sensors LM35

3.8.2 THE GSM NETWORKS PARTS

3.9 BUZZER

4.ADVANTAGES

5.APPLICATIONS

6.FUTURE SCOPE

7.CONCLUSION

8.BIBILOGRAPH

Page 12: Temperature Sensors LM35

ABSTRACT

With the rapid development of the economy, more and more serious problems of

environment arise. Water pollution is one of these problems.This method waste

too much manpower and material resource, has the limitations of the samples

collecting.

Various parameters of water quality are automatically detected under the

control of single chip ‘MICROOCONTROLLER’.The system uses SENSORS which

converts non-power information into electrical signals.

Microcontroller analyses the water samples and water quality.If it is abnormal

then the data will be sent to monitoring center and managements mobile in the same way

at the same time using GSM In this project implements automation, intelligence and

network of water quality monitoring, and uses manpower, material and financial

resources sparingly.

To develop an embedded system, which is used to

measure and report the water quality parameters such as pH and temperature,

therefore it will be automatically detected under the control of single chip

microcontroller all day using GSM technology .

BLOCK DIAGRAM:

Page 13: Temperature Sensors LM35

Power supply:

Page 14: Temperature Sensors LM35

CHAPTER-1

INTRODUCTION

With the rapid development of the economy, more and more serious problems of

environment arise. Water pollution is one of these problems.This method waste

too much manpower and material resource, has the limitations of the samples

collecting.The system uses SENSORS which converts non-power information into

electrical signals.

Microcontroller analyses the water samples and water

quality.If it is abnormal then the data will be sent to monitoring center and

managements mobile in the same way at the same time using GSM In this project

Page 15: Temperature Sensors LM35

implements automation, intelligence and network of water quality monitoring, and

uses manpower, material and financial resources sparingly

Page 16: Temperature Sensors LM35

CHAPTER-2

Page 17: Temperature Sensors LM35

EMBEDDED SYSTEMS 2.1 Introduction To Embedded system:

An embedded system is a computer system designed to perform one or a few

dedicated functions often with real-time computing constraints. It is embedded as part of

a complete device often including hardware and mechanical parts. By contrast, a general-

purpose computer, such as a personal computer (PC), is designed to be flexible and to

meet a wide range of end-user needs. Embedded systems control many devices in

common use today.

Embedded systems are controlled by one or more main processing cores that are

typically either microcontrollers or digital signal processors (DSP). The key

characteristic, however, is being dedicated to handle a particular task, which may require

very powerful processors. For example, air traffic control systems may usefully be

viewed as embedded, even though they involve mainframe computers and dedicated

regional and national networks between airports and radar sites. (Each radar probably

includes one or more embedded systems of its own.)

Since the embedded system is dedicated to specific tasks, design engineers can

optimize it to reduce the size and cost of the product and increase the reliability and

performance. Some embedded systems are mass-produced, benefiting from economies of

scale.

Physically embedded systems range from portable devices such as digital watches

and MP3 players, to large stationary installations like traffic lights, factory controllers, or

the systems controlling nuclear power plants. Complexity varies from low, with a single

microcontroller chip, to very high with multiple units, peripherals and networks mounted

inside a large chassis or enclosure.

In general, "embedded system" is not a strictly definable term, as most systems

have some element of extensibility or programmability. For example, handheld

computers share some elements with embedded systems such as the operating systems

and microprocessors which power them, but they allow different applications to be

loaded and peripherals to be connected. Moreover, even systems which don't expose

programmability as a primary feature generally need to support software updates. On a

Page 18: Temperature Sensors LM35

continuum from "general purpose" to "embedded", large application systems will have

subcomponents at most points even if the system as a whole is "designed to perform one

or a few dedicated functions", and is thus appropriate to call "embedded". A modern

example of embedded system is shown in fig: 2.1.

Fig 2.1:A modern example of embedded system

Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded

systems programming is not like normal PC programming. In many ways, programming

for an embedded system is like programming PC 15 years ago. The hardware for the

system is usually chosen to make the device as cheap as possible. Spending an extra

dollar a unit in order to make things easier to program can cost millions. Hiring a

programmer for an extra month is cheap in comparison. This means the programmer must

make do with slow processors and low memory, while at the same time battling a need

for efficiency not seen in most PC applications. Below is a list of issues specific to the

embedded field.

2.1.1 HISTORY:

In the earliest years of computers in the 1930–40s, computers were sometimes

dedicated to a single task, but were far too large and expensive for most kinds of tasks

performed by embedded computers of today. Over time however, the concept

Page 19: Temperature Sensors LM35

of programmable controllers evolved from traditional electromechanical sequencers, via

solid state devices, to the use of computer technology.

One of the first recognizably modern embedded systems was the Apollo Guidance

Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At

the project's inception, the Apollo guidance computer was considered the riskiest item in

the Apollo project as it employed the then newly developed monolithic integrated circuits

to reduce the size and weight. An early mass-produced embedded system was the

autonetics D-17 guidance computer for the Minuteman missile, released in 1961. It was

built from transistor logic and had a hard disk for main memory. When the Minuteman II

went into production in 1966, the D-17 was replaced with a new computer that was the

first high-volume use of integrated circuits.

2.1.2 TOOLS

Embedded development makes up a small fraction of total programming. There's

also a large number of embedded architectures, unlike the PC world where 1 instruction

set rules, and the Unix world where there's only 3 or 4 major ones. This means that the

tools are more expensive. It also means that they're lowering featured, and less

developed. On a major embedded project, at some point you will almost always find a

compiler bug of some sort.

Debugging tools are another issue. Since you can't always run general programs

on your embedded processor, you can't always run a debugger on it. This makes fixing

your program difficult. Special hardware such as JTAG ports can overcome this issue in

part. However, if you stop on a breakpoint when your system is controlling real world

hardware (such as a motor), permanent equipment damage can occur. As a result, people

doing embedded programming quickly become masters at using serial IO channels and

error message style debugging.

2.1.3 RESOURCES:

To save costs, embedded systems frequently have the cheapest processors that can

do the job. This means your programs need to be written as efficiently as possible. When

dealing with large data sets, issues like memory cache misses that never matter in PC

programming can hurt you. Luckily, this won't happen too often- use reasonably efficient

Page 20: Temperature Sensors LM35

algorithms to start, and optimize only when necessary. Of course, normal profilers won't

work well, due to the same reason debuggers don't work well.

Memory is also an issue. For the same cost savings reasons, embedded systems

usually have the least memory they can get away with. That means their algorithms must

be memory efficient

(unlike in PC programs, you will frequently sacrifice processor time for memory, rather

than the reverse). It also means you can't afford to leak memory. Embedded applications

generally use deterministic memory techniques and avoid the default "new" and "malloc"

functions.

2.1.4 REAL TIME ISSUES:

Embedded systems frequently control hardware, and must be able to respond to

them in real time. Failure to do so could cause inaccuracy in measurements, or even

damage hardware such as motors. This is made even more difficult by the lack of

resources available. Almost all embedded systems need to be able to prioritize some tasks

over others, and to be able to put off/skip low priority tasks such as UI in favor of high

priority tasks like hardware control.

2.2 NEED FOR EMBEDDED SYSTEMS:

The uses of embedded systems are virtually limitless, because every day new

products are introduced to the market that utilizes embedded computers in novel ways. In

recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have

become much cheaper. So when implementing a new form of control, it's wiser to just

buy the generic chip and write your own custom software for it. Producing a custom-

made chip to handle a particular task or set of tasks costs far more time and money.

2.2.1 DEBUGGING:

Embedded debugging may be performed at different levels, depending on the

facilities available. From simplest to most sophisticate they can be roughly grouped into

the following areas:

1. Interactive resident debugging, using the simple shell provided by the

embedded operating system (e.g. Forth and Basic)

Page 21: Temperature Sensors LM35

2. External debugging using logging or serial port output to trace operation

using either a monitor in flash or using a debug server like the Remedy

Debugger which even works for heterogeneous multi core systems.

3. An in-circuit debugger (ICD), a hardware device that connects to the

microprocessor via a JTAG or Nexus interface. This allows the operation of

the microprocessor to be controlled externally, but is typically restricted to

specific debugging capabilities in the processor.

4. An in-circuit emulator replaces the microprocessor with a simulated

equivalent, providing full control over all aspects of the microprocessor.

5. A complete emulator provides a simulation of all aspects of the hardware,

allowing all of it to be controlled and modified and allowing debugging on a

normal PC.

6. Unless restricted to external debugging, the programmer can typically load

and run software through the tools, view the code running in the processor,

and start or stop its operation. The view of the code may be as assembly

code or source-code.

2.2.2 RELIABILITY:

Embedded systems often reside in machines that are expected to run continuously

for years without errors and in some cases recover by them if an error occurs. Therefore

the software is usually developed and tested more carefully than that for personal

computers, and unreliable mechanical moving parts such as disk drives, switches or

buttons are avoided.

Specific reliability issues may include:

1. The system cannot safely be shut down for repair, or it is too inaccessible to

repair. Examples include space systems, undersea cables, navigational

beacons, bore-hole systems, and automobiles.

2. The system must be kept running for safety reasons. "Limp modes" are less

tolerable. Often backups are selected by an operator. Examples include

aircraft navigation, reactor control systems, safety-critical chemical factory

controls, train signals, engines on single-engine aircraft.

Page 22: Temperature Sensors LM35

3. The system will lose large amounts of money when shut down: Telephone

switches, factory controls, bridge and elevator controls, funds transfer and

market making, automated sales and service.

2.3 EXPLANATION OF EMBEDDED SYSTEMS:

2.3.1 SOFTWARE ARCHITECTURE:

There are several different types of software architecture in common use.

1. Simple Control Loop:

In this design, the software simply has a loop. The loop calls subroutines, each of

which manages a part of the hardware or software.

2. Interrupt Controlled System:

Some embedded systems are predominantly interrupt controlled. This means that

tasks performed by the system are triggered by different kinds of events. An interrupt

could be generated for example by a timer in a predefined frequency, or by a serial port

controller receiving a byte. These kinds of systems are used if event handlers need low

latency and the event handlers are short and simple.

Usually these kinds of systems run a simple task in a main loop also, but this task

is not very sensitive to unexpected delays. Sometimes the interrupt handler will add

longer tasks to a queue structure. Later, after the interrupt handler has finished, these

tasks are executed by the main loop. This method brings the system close to a

multitasking kernel with discrete processes.

3. Cooperative Multitasking:

A non-preemptive multitasking system is very similar to the simple control loop

scheme, except that the loop is hidden in an API. The programmer defines a series of

tasks, and each task gets its own environment to “run” in. When a task is idle, it calls

an idle routine, usually called “pause”, “wait”, “yield”, “nop” (stands for no operation),

etc.

Page 23: Temperature Sensors LM35

4. Primitive Multitasking:

In this type of system, a low-level piece of code switches between tasks or threads

based on a timer (connected to an interrupt). This is the level at which the system is

generally considered to have an "operating system" kernel. Depending on how much

functionality is required, it introduces more or less of the complexities of managing

multiple tasks running conceptually in parallel.

2.3.2 STAND ALONE EMBEDDED SYSTEM:

These systems takes the input in the form of electrical signals from transducers or

commands from human beings such as pressing of a button etc.., process them and

produces desired output. This entire process of taking input, processing it and giving

output is done in standalone mode. Such embedded systems comes under stand alone

embedded system.

2.3.3 REAL-TIME EMBEDDED SYSTEMS:

Embedded systems which are used to perform a specific task or operation in a

specific time period those systems are called as real-time embedded systems. There are

two types of real-time embedded systems.

1. Hard Real-time embedded systems:

These embedded systems follow an absolute dead line time period i.e.., if the

tasking is not done in a particular time period then there is a cause of damage to the entire

equipment.

Eg: consider a system in which we have to open a valve within 30 milliseconds. If

this valve is not opened in 30 ms this may cause damage to the entire equipment. So in

such cases we use embedded systems for doing automatic operations.

2. Soft Real Time embedded systems:

These embedded systems follow a relative dead line time period i.e.., if the task is

not done in a particular time that will not cause damage to the equipment.

Eg: Consider a TV remote control system, if the remote control takes a few

milliseconds delay it will not cause damage either to the TV or to the remote control.

These systems which will not cause damage when they are not operated at considerable

time period those systems comes under soft real-time embedded system.

Page 24: Temperature Sensors LM35

2.3.4 NETWORK COMMUNICATION EMBEDDED SYSTEMS:

A wide range network interfacing communication is provided by using embedded.

1. Consider a web camera that is connected to the computer with internet can be used

to spread communication like sending pictures, images, videos etc.., to another

computer with internet connection throughout anywhere in the world.

2. Consider a web camera that is connected at the door lock.Whenever a person comes

near the door, it captures the image of a person and sends to the desktop of your

computer which is connected to internet. This gives an alerting message with image

on to the desktop of your computer, and then you can open the door lock just by

clicking the mouse. Fig: 2.2 show the network communications in embedded

systems.

Fig 2.3.4: Network communication embedded systems

2.2 OVERVIEW OF EMBEDDED SYSTEM ARCHITECTURE

Page 25: Temperature Sensors LM35

Every embedded system consists of custom-built hardware built around a Central

Processing Unit (CPU). This hardware also contains memory chips onto which the

software is dded system for security applications is one of the most lucrative businesses

nowadays. loaded. The software residing on the memory chip is also called the

‘firmware’. The embedded system architecture can be represented as a layered

architecture as shown in Fig

The operating system runs above the hardware, and the application software runs

above the operating system. The same architecture is applicable to any computer

including a desktop computer. However, there are significant differences. It is not

compulsory to have an operating system in every embedded system. For small appliances

such as remote control units, air conditioners, toys etc., there is no need for an operating

system and you can write only the software specific to that application. For applications

involving complex processing, it is advisable to have an operating system. In such a case,

you need to integrate the application software with the operating system and then transfer

the entire software on to the memory chip. Once the software is transferred to the

memory chip, the software will continue to run for a long time you don’t need to reload

new software.

Now, let us see the details of the various building blocks of the hardware of an

embedded system. As shown in Fig. the building blocks are;

a. Central Processing Unit (CPU)

Page 26: Temperature Sensors LM35

b. Memory (Read-only Memory and Random Access Memory)

c. Input Devises

d. Output devises

e. Communication interfaces

f. Application-specific circuitry

Fig.1.3: blocks of the hardware of an embedded system

2.2.1 CENTRAL PROCESSING UNIT (CPU)

The Central Processing Unit (processor in short) can be any of the following:

microcontroller, microprocessor or Digital Signal Processor (DSP). A micro-controller is

a low-cost processor. Its main attraction is that on the chip itself, there will be many other

components such as memory, serial communication interface, analog-to digital converter

etc. So, for small applications, a micro-controller is the best choice as the number of

external components required will be very less. On the other hand, microprocessors are

more powerful, but you need to use many external components with them. D5P is used

mainly for applications in which signal processing is involved such as audio and video

processing.

2.2.2 MEMORY

The memory is categorized as Random Access 11emory (RAM) and Read Only

Memory (ROM). The contents of the RAM will be erased if power is switched off to the

chip, whereas ROM retains the contents even if the power is switched off. So, the

firmware is stored in the ROM. When power is switched on, the processor reads the

ROM; the program is program is execute.

INPUT DEVICES:

Page 27: Temperature Sensors LM35

Unlike the desktops, the input devices to an embedded system have very limited

capability. There will be no keyboard or a mouse, and hence interacting with the

embedded system is no easy task. Many embedded systems will have a small keypad-you

press one key to give a specific command. A keypad may be used to input only the digits.

Many embedded systems used in process control do not have any input device for user

interaction; they take inputs from sensors or transducers 1’fnd produce electrical signals

that are in turn fed to other systems.

2.2.4 OUTPUT DEVICES

The output devices of the embedded systems also have very limited capability.

Some embedded systems will have a few Light Emitting Diodes (LEDs) to indicate the

health status of the system modules, or for visual indication of alarms. A small Liquid

Crystal Display (LCD) may also be used to display some important parameters.

COMMUNICATION INTERFACES:

The embedded systems may need to, interact with other embedded systems at they may

have to transmit data to a desktop. To facilitate this, the embedded systems are provided

Page 28: Temperature Sensors LM35

with one or a few communication interfaces such as RS232, RS422, RS485, Universal

Serial Bus (USB), IEEE 1394, Ethernet etc.

2.2.6 APPLICATION-SPECIFIC CIRCUITRY

Sensors, transducers, special processing and control circuitry may be required fat

an embedded system, depending on its application. This circuitry interacts with the

processor to carry out the necessary work. The entire hardware has to be given power

supply either through the 230 volts main supply or through a battery. The hardware has to

design in such a way that the power consumption is minimized.

2.3 CONCLUSION:

Embedded systems plays a vital role in our day to day life. They are used for household

appliances like microwave oven to the satellite applications. They provide good man to

machine interface.

Automation is the further step in the world of embedded systems, which includes the

elimination of the human being in the mundane applications. They are cost effective,

accurate and can work in any conditions and round the clock

CHAPTER-3

Page 29: Temperature Sensors LM35

EXPLANATION OF EACH BLOCK AND COMPONENTS

3.1 Power supply:

Page 30: Temperature Sensors LM35

All digital circuits require regulated power supply. In this article, we are going to learn

how to get a regulated positive supply from the mains supply.

 

Figure 1 shows the basic block diagram of a fixed regulated power supply. Let us go

through each block.

3.1.1 TRANSFORMER:

A transformer consists of two coils also called as “WINDINGS” namely PRIMARY &

SECONDARY.

They linked together through inductively coupled electrical conductors also called as

CORE. A changing current in the primary causes a change in the Magnetic Field in the

core & this in turn induces an alternating voltage in the secondary coil. If load applied to

the secondary then an alternating current will flow through the load. If we consider an

ideal condition then all the energy from the primary circuit will transferred to the

secondary circuit through the magnetic field.

Page 31: Temperature Sensors LM35

So  

 The secondary voltage of the transformer depends on the number of turns in the Primary as well as in

the secondary.

3.1.2 RECTIFIER:

A rectifier is a device that converts an AC signal into DC signal. For rectification purpose

we use a diode, a diode is a device that allows current to pass only in one direction i.e.

when the anode of the diode is positive with respect to the cathode also called as forward

biased condition & blocks current in the reversed biased condition.

 

Rectifier classified as follows:

3.1.2.1    Half Wave rectifier

This is the simplest type of rectifier as you can see in the diagram a half wave rectifier

consists of only one diode. When an AC signal applied to it during the positive half cycle,

the diode is forward biased & current flows through it. However, during the negative half

cycle diode is reverse biased & no current flows through it. Since only one-half of the

input reaches the output, it is very inefficient to use in power supplies.

Page 32: Temperature Sensors LM35

  3.1.2.2   Full wave rectifier

Half wave rectifier is quite simple but it is very inefficient, for greater efficiency

we would like to use both the half cycles of the AC signal. This can achieve by using a

center-tapped transformer i.e. we would have to double the size of secondary winding &

provide connection to the center. Therefore, during the positive half cycle diode, D1

conducts & D2 is in reverse biased condition. During the negative half cycle diode, D2

conducts & D1 is reverse biased. Thus, we get both the half cycles across the load.

One of the disadvantages of Full Wave Rectifier design is the necessity of using a center

tapped transformer, thus increasing the size & cost of the circuit. This can avoid by using

the Full Wave Bridge Rectifier.

Page 33: Temperature Sensors LM35

  3.1.2.3 Bridge Rectifier

As the name suggests it converts the full wave i.e. both the positive & the negative half

cycle into DC thus it is much more efficient than Half Wave Rectifier & that too without

using a center tapped transformer thus much more cost effective than Full Wave

Rectifier.

Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4. During

the positive half cycle diodes D1 & D4 conduct whereas in the negative half cycle diodes

D2 & D3 conduct thus the diodes keep switching the transformer connections so we get

positive half cycles in the output.

 

Page 34: Temperature Sensors LM35

If we use a center-tapped transformer for a bridge rectifier, we can get both positive &

negative half cycles, which can thus used for generating fixed positive & fixed negative

voltages.

3.1.3 FILTER CAPACITOR

Even though half wave & full wave rectifier give DC output, none of them provides a

constant output voltage. For this we require to smoothen the waveform received from the

rectifier. This can be done by using a capacitor at the output of the rectifier this capacitor

is also called as “FILTER CAPACITOR” or “SMOOTHING CAPACITOR” or

“RESERVOIR CAPACITOR”. Even after using this capacitor a small amount of ripple

will remain.

We place the Filter Capacitor at the output of the rectifier the capacitor will charge to the peak voltage

during each half cycle then will discharge its stored energy slowly through the load whilethe rectified

voltage drops to zero, thus trying to keep the voltage as constant as possible.

Page 35: Temperature Sensors LM35

If we go on increasing the value of the filter capacitor then the Ripple will decrease. Then the costing

will increase. The value of the Filter capacitor depends on the current consumed by the circuit, the

frequency of the waveform & the accepted ripple.

 Where,

Vr= accepted ripple voltage.( should not be more than 10% of  the voltage)

I= current consumed by the circuit in Amperes.

F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25 Hz

Whereas a full wave rectifier has Two peaks in one cycle so F=100 Hz.

3.1.4 VOLTAGE REGULATOR 

A Voltage regulator is a device which converts varying input voltage into a constant

regulated output voltage. Voltage regulator can be of two types

1). Linear Voltage Regulator: Also called as Resistive Voltage regulator because they dis

sipate  the excessive voltage resistively as heat.

2)  Switching RegulatorsThey regulate the output voltage by switching the Current

ON/OFF very rapidly. Since either their output is ON or OFF it dissipates very low

power thus achieving higher efficiency as compared to linear voltage regulators.

However, they are more complex & generate high noise due to their switching action. For

low level of output power, switching regulators tend to be costly but for higher output

wattage, they are much cheaper than linear regulators.

The most commonly available Linear Positive Voltage Regulators are the 78XX series

where the XX indicates the output voltage. In addition, 79XX series is for Negative

Voltage Regulators.

Page 36: Temperature Sensors LM35

 After filtering the rectifier output, the signal is given to a voltage regulator. The

maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3

Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher

than the output voltage. If the input voltage gets below the Vmin of the regulator due to

the ripple voltage or due to any other reason the voltage regulator will not be able

To pro produce the correct regulated voltage.

3.Circuitdiagram:

Fig2.3circuitdiagramofpowersupply

HARDWARE DESCRIPTION

3.2 INTRODUCTION:

In this chapter the block diagram of the project and design aspect of independent

modules are considered. In this diagram the main modules are micro controller, zigbee

transmitter LCD,crystal oscillator,reset and LED indicators.

3.2.1 AT89S52

3.2.1.1 A BRIEF HISTORY OF 8051

In 1981, Intel Corporation introduced an 8 bit microcontroller called 8051. This

microcontroller had 128 bytes of RAM, 4K bytes of chip ROM, two timers, one serial

Page 37: Temperature Sensors LM35

port, and four ports all on a single chip. At the time it was also referred as “A SYSTEM

ON A CHIP”

AT89S52:

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K

bytes of in-system programmable Flash memory. The device is manufactured using

Atmel’s high-density nonvolatile memory technology and is compatible with the

industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the

program memory to be reprogrammed in-system or by a conventional nonvolatile

memory programmer. By combining a versatile 8-bit CPU with in-system programmable

Flash on a monolithic chip, the Atmel AT89S52 is a powerful micro-controller, which

provides a highly flexible and cost-effective solution to many, embedded control

applications. The AT89S52 provides the following standard features: 8K bytes of Flash,

256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit

timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-

chip oscillator, and clock circuitry. In addition, the AT89S52 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 con-tents but freezes the oscillator, disabling all other chip functions until the next

interrupt

Page 38: Temperature Sensors LM35

8031 has 128 bytes of RAM, two timers and 6 interrupts.

8051 has 4K ROM, 128 bytes of RAM, two timers and 6

interrupts.

8052 has 8K ROM, 256 bytes of RAM, three timers and 8

interrupts.

Of the three microcontrollers, 8051 is the most preferable. Microcontroller

supports both serial and parallel communication.

In the concerned project 8052 microcontroller is used. Here microcontroller used

is AT89S52, which is manufactured by ATMEL laboratories.

The 8051 is the name of a big family of microcontrollers. The device which we

are going to use along this tutorial is the 'AT89S52' which is a typical 8051

microcontroller manufactured by Atmel™. Note that this part doesn't aim to explain the

functioning of the different components of a 89S52 microcontroller, but rather to give

you a general idea of the organization of the chip and the available features, which shall

be explained in detail along this tutorial.

Page 39: Temperature Sensors LM35

The block diagram provided by Atmel™ in their datasheet showing the architecture the

89S52 device can seem very complicated, and since we are going to use the C high level

language to program it, a simpler architecture can be represented as the figure 1.2.A.

This figure shows the main features and components that the designer can interact with.

You can notice that the 89S52 has 4 different ports, each one having 8 Input/output lines

providing a total of 32 I/O lines. Those ports can be used to output DATA and orders do

other devices, or to read the state of a sensor, or a switch. Most of the ports of the 89S52

have 'dual function' meaning that they can be used for two different functions: the fist one

is to perform input/output operations and the second one is used to implement special

features of the microcontroller like counting external pulses, interrupting the execution of

the program according to external events, performing serial data transfer or connecting

the chip to a computer to update the software.

3.2.2 NECESSITY OF MICROCONTROLLERS:

Microprocessors brought the concept of programmable devices and made many

applications of intelligent equipment. Most applications, which do not need large amount

of data and program memory, tended to be costly.

The microprocessor system had to satisfy the data and program requirements so,

sufficient RAM and ROM are used to satisfy most applications .The peripheral control

equipment also had to be satisfied. Therefore, almost all-peripheral chips were used in the

design. Because of these additional peripherals cost will be comparatively high.

An example:

8085 chip needs:

An Address latch for separating address from multiplex address and data.32-KB RAM

and 32-KB ROM to be able to satisfy most applications. As also Timer / Counter, Parallel

programmable port, Serial port, and Interrupt controller are needed for its efficient

applications.

Page 40: Temperature Sensors LM35

In comparison a typical Micro controller 8051 chip has all that the 8051 board has

except a reduced memory as follows. 4K bytes of ROM as compared to 32-KB, 128

Bytes of RAM as compared to 32-KB.

Bulky: On comparing a board full of chips (Microprocessors) with one chip with all

components in it (Microcontroller).

Debugging: Lots of Microprocessor circuitry and program to debug. In Micro controller

there is no Microprocessor circuitry to debug.

Slower Development time: As we have observed Microprocessors need a lot of

debugging at board level and at program level, where as, Micro controller do not have the

excessive circuitry and the built-in peripheral chips are easier to program for operation.

So peripheral devices like Timer/Counter, Parallel programmable port, Serial Co

mmunication Port, Interrupt controller and so on, which were most often used were

integrated with the Microprocessor to present the Micro controller .RAM and ROM also

were integrated in the same chip. The ROM size was anything from 256 bytes to 32Kb or

more. RAM was optimized to minimum of 64 bytes to 256 bytes or more.

Microprocessor has following instructions to perform:

1. Reading instructions or data from program memory ROM.

2. Interpreting the instruction and executing it.

3. Microprocessor Program is a collection of instructions stored in a Nonvolatile memory.

4. Read Data from I/O device

5. Process the input read, as per the instructions read in program memory.

6. Read or write data to Data memory.

7. Write data to I/O device and output the result of processing to O/P device.

3.2.3 INTRODUCTION TO AT89S52

The system requirements and control specifications clearly rule out the use of 16,

32 or 64 bit micro controllers or microprocessors. Systems using these may be earlier to

implement due to large number of internal features. They are also faster and more reliable

but, the above application is satisfactorily served by 8-bit micro controller. Using an

inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive

Page 41: Temperature Sensors LM35

market place. Coming to the question of why to use 89S52 of all the 8-bit Microcontroller

available in the market the main answer would be because it has 8kB Flash and 256 bytes

of data RAM32 I/O lines, three 16-bit timer/counters, a Eight-vector two-level interrupt

architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.

In addition, the AT89S52 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. The Flash

program memory supports both parallel programming and in Serial In-System

Programming (ISP). The 89S52 is also In-Application Programmable (IAP), allowing the

Flash program memory to be reconfigured even while the application is running.

By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel

AT89S52 is a powerful microcomputer which provides a highly flexible and cost

effective solution to many embedded control applications.

3.2.4 FEATURES

1.Compatible with MCS-51 Products

2.8K Bytes of In-System Reprogrammable Flash Memory

3.Fully Static Operation: 0 Hz to 33 MHz

4.Three-level Program Memory Lock

5.256 x 8-bit Internal RAM

6.32 Programmable I/O Lines

7.Three 16-bit Timer/Counters

8.Eight Interrupt Sources

9.Programmable Serial Channel

10.Low-power Idle and Power-down Modes

11.Operating Range.4.0V to 5.5V

12.Full Duplex UART Serial Channel

13.Interrupt Recovery from Power-down Mode

14.Watchdog Timer

15.Dual Data Pointer

Page 42: Temperature Sensors LM35

16.Power-off Flag

17.Fast Programming Time

18.Flexible ISP Programming (Byte and Page Mode)

3.2.5 DESCRIPTIONThe AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K

bytes of in-system programmable Flash memory. The device is manufactured using

Atmel’s high-density nonvolatile memory technology and is compatible with the

industry-standard 80C51 instruction set and pin out. The on-chip Flash allows the

program memory to be reprogrammed in-system or by a conventional nonvolatile

memory programmer. By combining a versatile 8-bit CPU with in-system programmable

Flash on a monolithic chip, the Atmel AT89S52 is a powerful micro-controller, which

provides a highly flexible and cost-effective solution to many embedded control

applications.

The AT89S52 provides the following standard features:

8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers,

three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex

serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 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

con-tents but freezes the oscillator, disabling all other chip functions until the next

interrupt

3.2.6 PIN CONFIGURATIONS Block diagram:

Page 43: Temperature Sensors LM35

3.2.6.1 Pin diagram of AT9S52 Microcontroller

3.2.7 PIN DIAGRAM:

Page 44: Temperature Sensors LM35

FIG-3.2.7.1 Pin diagram of 89S52 IC

3.2.8 PIN DESCRIPTION

VCC:

Supply voltage.

GND: Ground

Port 0

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink

eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high

impedance inputs. Port 0 can also be configured to be the multiplexed low order

address/data bus during accesses to external program and data memory. In this mode, P0

has internal pull-ups. Port 0 also receives the code bytes during Flash programming and

outputs the code bytes during program verification.External pull-ups are required during

program verification.

Page 45: Temperature Sensors LM35

Port 1Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers

can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high

by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are

externally being pulled low will source current (IIL) because of the internal pull-ups. In

addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input

(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in

the following table. Port 1 also receives the low-order address bytes during Flash

programming and verification.

Table:3.2.8.1: Alternative Functions Of Port1 Pins

Port 2Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers

can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high

by

the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally

being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits

the high-order address byte during fetches from external program memory and during

accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this

application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to

external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents

of the P2 Special Function Register. Port 2 also receives the high-order address bits and

some control signals during Flash programming and verification.

Port3

Page 46: Temperature Sensors LM35

Port3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers

can sink/source four TTL inputs. 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 AT89S52, as shown in the

following table. Port 3 also receives some control signals for Flash programming and

verification.

Table:3.2.8.2:Alternative functions of port3 pin

RSTReset input. A high on this pin for two machine cycles while the oscillator is

running resets the device. This pin drives High for 96 oscillator periods after the

Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to

disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is

enabled.

ALE/PROG

Address Latch Enable (ALE) is an output pulse for latching the low byte of the address

during accesses to external memory. This pin is also the program pulse input (PROG)

during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6

the oscillator frequency and may be used for external timing or clocking purposes. Note,

however, that one ALE pulse is skipped during each access to external data memory. If

desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit

set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is

weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in

external execution mode.

PSEN

Page 47: Temperature Sensors LM35

Program Store Enable (PSEN) is the read strobe to external program memory. When the

AT89S52 is executing code from external program memory, PSEN is activated twice

each machine cycle, except that two PSEN activations are skipped during each access to

external data memory.

EA/VPPExternal Access Enable. EA must be strapped to GND in order to enable the

device to fetch code from external program memory locations starting at 0000H up to

FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on

reset. EA should be strapped to VCC for internal program executions. This pin also

receives the 12-volt programming enable voltage (VPP) during Flash programming.

XTAL1Input to the inverting oscillator amplifier and input to the internal clock operating

circuit.XTAL2: Output from the inverting oscillator amplifier.

FIG-3.2.8.3Functional block diagram of microcontroller

Page 48: Temperature Sensors LM35

3.2.9 THE 8052 OSCILLATOR AND CLOCK:

The heart of the 8051 circuitry that generates the clock pulses by

which all the internal all internal operations are synchronized. Pins XTAL1

And XTAL2 is provided for connecting a resonant network to form an

oscillator. Typically a quartz crystal and capacitors are employed. The

crystal frequency is the basic internal clock frequency of the microcontroller.

The manufacturers make 8051 designs that run at specific minimum and

maximum frequencies typically 1 to 16 MHz

Fig-3.2.9.1Oscillator and timing circuit

Page 49: Temperature Sensors LM35

3.2.10 MEMORIES

Types of memory:

The 8052 have three general types of memory. They are on-chip memory, external Code

memory and external Ram. On-Chip memory refers to physically existing memory on the

micro controller itself. External code memory is the code memory that resides off chip.

This is often in the form of an external EPROM. External RAM is the Ram that resides

off chip. This often is in the form of standard static RAM or flash RAM.

a) Code memory

Code memory is the memory that holds the actual 8052 programs that is to be run.

This memory is limited to 64K. Code memory may be found on-chip or off-chip. It is

possible to have 8K of code memory on-chip and 60K off chip memory simultaneously.

If only off-chip memory is available then there can be 64K of off chip ROM. This is

controlled by pin provided as EA

b) Internal RAM

The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is found

on-chip. So it is the fastest Ram available. And also it is most flexible in terms of reading

and writing. Internal Ram is volatile, so when 8051 is reset, this memory is cleared. 256

bytes of internal memory are subdivided. The first 32 bytes are divided into 4 register

banks. Each bank contains 8 registers. Internal RAM also contains 256 bits, which are

addressed from 20h to 2Fh. These bits are bit addressed i.e. each individual bit of a byte

can be addressed by the user. They are numbered 00h to FFh. The user may make use of

these variables with commands such as SETB and CLR.

Special Function registered memory:

Special function registers are the areas of memory that control specific

functionality of the 8052 micro controller.

a) Accumulator (0E0h)

As its name suggests, it is used to accumulate the results of large no of

instructions. It can hold 8 bit values.

b) B registers (0F0h)

Page 50: Temperature Sensors LM35

The B register is very similar to accumulator. It may hold 8-bit value. The b

register is only used by MUL AB and DIV AB instructions. In MUL AB the higher byte

of the product gets stored in B register. In div AB the quotient gets stored in B with the

remainder in A.

c) Stack pointer (81h)

The stack pointer holds 8-bit value. This is used to indicate where the next value

to be removed from the stack should be taken from. When a value is to be pushed on to

the stack, the 8052 first store the value of SP and then stores the value at the resulting

memory location. When a value is to be popped from the stack, the 8052 returns the

value from the memory location indicated by SP and then decrements the value of SP.

d) Data pointer

The SFRs DPL and DPH work together work together to represent a 16-bit value

called the data pointer. The data pointer is used in operations regarding external RAM

and some instructions code memory. It is a 16-bit SFR and also an addressable SFR.

e) Program counter

The program counter is a 16 bit register, which contains the 2 byte address, which

tells the 8052 where the next instruction to execute to be found in memory. When the

8052 is initialized PC starts at 0000h. And is incremented each time an instruction is

executes. It is not addressable SFR.

f) PCON (power control, 87h)

The power control SFR is used to control the 8051’s power control modes.

Certain operation modes of the 8051 allow the 8051 to go into a type of “sleep mode”

which consumes much lee power.

g) TCON (timer control, 88h)

The timer control SFR is used to configure and modify the way in which the

8051’s two timers operate. This SFR controls whether each of the two timers is running

or stopped and contains a flag to indicate that each timer has overflowed. Additionally,

some non-timer related bits are located in TCON SFR. These bits are used to configure

Page 51: Temperature Sensors LM35

the way in which the external interrupt flags are activated, which are set when an

external interrupt occurs.

h) TMOD (Timer Mode, 89h)

The timer mode SFR is used to configure the mode of operation of each of the

two timers. Using this SFR your program may configure each timer to be a 16-bit timer,

or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally you may

configure the timers to only count when an external pin is activated or to count “events”

that are indicated on an external pin.

i) TO (Timer 0 low/high, address 8A/8C h)

These two SFRs taken together represent timer 0. Their exact behavior depends

on how the timer is configured in the TMOD SFR; however, these timers always count

up. What is configurable is how and when they increment in value.

j) T1 (Timer 1 Low/High, address 8B/ 8D h)

These two SFRs, taken together, represent timer 1. Their exact behavior depends on

how the timer is configured in the TMOD SFR; however, these timers always count up.

k)P0 (Port 0, address 90h, bit addressable)

This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro

controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0

of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this SFR will send a

high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

l) P1 (port 1, address 90h, bit addressable)

This is port latch1. Each bit of this SFR corresponds to one of the pins on a micro

controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0

Page 52: Temperature Sensors LM35

of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR will send

a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

m) P2 (port 2, address 0A0h, bit addressable):

This is a port latch2. Each bit of this SFR corresponds to one of the pins on a

micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g.,

bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR will

send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low

level.

n) P3 (port 3, address B0h, bit addressable) :

This is a port latch3. Each bit of this SFR corresponds to one of the pins on a

micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g.,

bit 0 of port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR will

send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low

level.

o) IE (interrupt enable, 0A8h)

The Interrupt Enable SFR is used to enable and disable specific interrupts. The low 7 bits

of the SFR are used to enable/disable the specific interrupts, where the MSB bit is used to

enable or disable all the interrupts. Thus, if the high bit of IE is 0 all interrupts are

disabled regardless of whether an individual interrupt is enabled by setting a lower bit

p) IP (Interrupt Priority, 0B8h)

The interrupt priority SFR is used to specify the relative priority of each interrupt.

On 8051, an interrupt may be either low or high priority. An interrupt may interrupt

interrupts. For e.g., if we configure all interrupts as low priority other than serial

interrupt. The serial interrupt always interrupts the system, even if another interrupt is

currently executing. However, if a serial interrupt is executing no other interrupt will be

able to interrupt the serial interrupt routine since the serial interrupt routine has the

highest priority.

Page 53: Temperature Sensors LM35

q) PSW (Program Status Word, 0D0h)

The program Status Word is used to store a number of important bits that are set

and cleared by 8052 instructions. The PSW SFR contains the carry flag, the auxiliary

carry flag, the parity flag and the overflow flag. Additionally, it also contains the register

bank select flags, which are used to select, which of the “R” register banks currently in

use.

r) SBUF (Serial Buffer, 99h)

SBUF is used to hold data in serial communication. It is physically two registers. One is writing only and is used to hold data to be transmitted out of 8052 via TXD. The

other is read only and holds received data from external sources via RXD. Both mutually exclusive registers use address 99h.

3.3 Temperature Sensor (LM35)3.3.1 INTRODUCTION:

The LM35 series are precision integrated-circuit temperature sensors, whose

output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35

thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is

not required to subtract a large constant voltage from its output to obtain convenient

centigrade scaling. The LM35 does not require any external calibration or trimming to

provide typical accuracies of ±1/4°C at room temperature and ±3/4°C over a full -55 to

+150°C temperature range. Low cost is assured by trimming and calibration at the wafer

level. The LM35’s low output impedance, linear output, and precise inherent calibration

make interfacing to readout or control circuitry especially easy. It can be used with single

power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply,

it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over

a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C

range (-10° with improved accuracy). The LM35 series is available packaged plastic TO-

Page 54: Temperature Sensors LM35

92 transistor package. The LM35D is also available in an 8-lead surface mount small

outline package and a plastic TO-220 package.

3.3.2 FEATURES:

12. Calibrated directly in ° Celsius (Centigrade)

13. Linear + 10.0 mV/°C scale factor

14. 0.5°C accuracy guaranteeable (at +25°C)

15. Rated for full -55° to +150°C range

16. Suitable for remote applications

17. Low cost due to wafer-level trimming

18. Operates from 4 to 30 volts

19. Less than 60 µA current drain

20. Low self-heating, 0.08°C in still air

21. Nonlinearity only ±1/4°C typical

22. Low impedance

3.3.3 PIN DIAGRAM:

Fig 3.3.3.1 Lm35 Temparature sensor

3.3.4 APPLICATIONS: The LM35 can be applied easily in the same way as other integrated-circuit temperature sensors. It can be glued or cemented to a surface and its temperature will be within about 0.01°C of the surface temperature. This presumes that the ambient air temperature is almost the same as the surface temperature; if the air temperature were much higher or lower than the surface temperature, the actual temperature of the LM35

Page 55: Temperature Sensors LM35

die would be at an intermediate temperature between the surface temperature and the air temperature. This is expecially true for the TO-92 plastic package, where the copper leads are the principal thermal path to carry heat into the device, so its temperature might be closer to the air temperature than to the surface temperature. To minimize this problem, be sure that the wiring to the LM35, as it leaves the device, is held at the same temperature as the surface of interest. The easiest way to do this is to cover up these wires with a bead of epoxy which will insure that the leads and wires are all at the same temperature as the surface, and that the LM35 die’s temperature will not be affected by the air temperature. The TO-46 metal package can also be soldered to a metal surface or pipe without damage. Of course, in that case the V- terminal of the circuit will be grounded to that metal. Alternatively, the LM35 can be mounted inside a sealed-end metal tube, and can then be dipped into a bath or screwed into a threaded hole in a tank. As with any IC, the LM35 and accompanying wiring and circuits must be kept insulated and dry, to avoid leakage and corrosion. This is especially true if the circuit may operate at cold temperatures where condensation can occur. Printed-circuit coatings and varnishes such as Humiseal and epoxy paints or dips are often used to insure that moisture cannot corrode the LM35 or its connections. These devices are sometimes soldered to a small light-weight heat fin, to decrease the thermal time constant and speed up the response in slowly-moving air. On the other hand, a small thermal mass may be added to the sensor, to give the steadiest reading despite small deviations in the air temperature.

3.4 pH METER

3.4.1Principles of operation of a pH meter

A pH meter is essentially a voltmeter with a high input impedance which

measures the voltage of an electrode sensitive to the hydrogen ion concentration, relative

to another electrode which exhibits a constant voltage. The key feature of the pH-

sensitive electrode is a thin glass membrane whose outside surface contacts the solution

to be tested. The inside surface of the glass membrane is exposed to a constant

concentration of hydrogen ions (0.1 M HCl).

Inside the glass electrode assembly, a silver wire, coated with silver chloride and

immersed in the HCl solution, is called an Ag/AgCl electrode. This electrode carries

current through the half-cell reaction. The potential between the electrode and the

Page 56: Temperature Sensors LM35

solution depends on the chloride ion concentration, but, since this is constant (0.1 M), the

electrode potential is also constant.

A reference electrode is needed to complete the electrical circuit. A common choice is to

use another Ag/AgCl electrode as the reference. The Ag/AgCl electrode is immersed in

an 0.1 M KCl solution which makes contact with the test solution through a porous fiber

which allows a small flow of ions back and forth to conduct the current. The potential

created at this junction between the KCl solution and the test solution is nearly zero and

nearly unaffected by anything in the solution, including hydrogen ions.

Using the pH Meter: Allow the meter a few minutes to stabilize after you plug it in.

When you are not using the meter, keep the electrode immersed in pH 7.0 buffer to a

depth of about one inch. The meter must be calibrated by using standards of known pH

before an unknown is measured. Since the unknowns are acidic, the pH 4.00 and pH 7.00

standards should be used.

An accurate pH reading depends on standardization, the degree of static charge, and the

temperature of the solution.

Glass electrode Reference electrode Combined electrode

Page 57: Temperature Sensors LM35

1. The pH meter should be standardized each time it is used with a buffer of known

pH, preferably one closest to the desired final pH. To calibrate the pH meter, expose

the hole in the electrode, rinse the electrode with deionized water, and place the

electrode in a standard solution, e.g., pH 7. Turn the selector to "pH". Adjust the pH

meter to the appropriate pH. Rinse electrode with deionized water and place in a

second standard buffer solution. The choice of the second standard depends on the

final he standard pH buffers used should be 7 and 10. If the final pH desired, for

example, if the final pH desired is 8.5, t pH desired is 5.5, the standard pH buffers

used should be 4 and 7. Turn the selector to "pH". Adjust the temperature knob to the

second standard pH. Rinse the electrode with deionized water, and return the

electrode to the soaking solution.

2. When rinsing the electrode, never wipe the end, but blot gently since wiping can

create a static electric charge, which can cause erroneous readings,

3. Make sure the solution you are measuring is at room temperature since the pH can

change with a change in temperature.

4. The pH-sensitive glass membrane is very thin and very easily broken. Do not

touch the membrane with anything harder than a Kim-Wipe and do that very gently.

Do not drop the electrode or bump it on the bottom of the beaker when immersing it

in a solution.

5. The glass membrane must be thoroughly hydrated to work properly. Do not allow

the electrode to remain out of water any longer than necessary. When the electrode is

not in use, keep it immersed in the pH 7.00 buffer. Do not put the electrode down on

the desk.

Page 58: Temperature Sensors LM35

3.4.2 pH SENSOR:-It is converted non electrical information into electrical form .The lower-case letter pH stands for the negative common(base ten)log.while the uppercase letter’H’ stands for the eiement hydrogen.Thus pH is a logarithmic measurement of the number of moles of hydrogen(H+)per liter of solution.pH = 0 for neutrals >7 for bases <7for acidsMeasuring range=0to 14.00pH

Sensitivity=0.002Ph

Weight=1lb(0.45kgs)

3.4.3pH SENSOR ( pH100):- 3.4.3.1 Diagram:

t 3.5 ANALOG TO DIGITAL CONVERTER 08083.5.1 INTRODUCTION The ADC0808 data acquisition component is a monolithic CMOS device with

an 8-bit analog-to-digital converter, 8-channel multiplexer and microprocessor

compatible control logic. The 8-bit A/D converter uses successive approximation as the

Page 59: Temperature Sensors LM35

conversion technique. The converter features a high impedance chopper stabilized

comparator, a 256R voltage divider with analog switch tree and a successive

approximation register. The 8-channel multiplexer can directly access any of 8-single-

ended analog signals. The device eliminates the need for external zero and full-scale

adjustments. Easy interfacing to microprocessors is provided by the latched and decoded

multiplexer address inputs and latched TTL tri-state outputs. The design of the ADC0808

has been optimized by incorporating the most desirable aspects of several A/D

conversion techniques. The ADC0808 offers high speed, high accuracy, minimal

temperature dependence, excellent long-term accuracy and repeatability, and consumes

minimal power. These features make this device ideally suited to applications from

process and machine control to consumer and automotive applications.

3.5.2 FEATURES:

1. Easy interface to all microprocessors

2. Operates ratio metrically or with 5 VDC or analog span

adjusted voltage reference

3. No zero or full-scale adjust required

4. 8-channel multiplexer with address logic

5. 0V to 5V input range with single 5V power supply

6. Outputs meet TTL voltage level specifications

7. Standard hermetic or molded 28-pin DIP package

8. 28-pin molded chip carrier package

9. ADC0808 equivalent to MM74C949

3.5.3 KEY SPECIFICATIONS:1. Resolution 8 Bits

2. Total Unadjusted Error ±1/2 LSB and ±1 LSB

3. Single Supply 5 VDC

4. Low Power 15 mW

5. Conversion Time 100 µs

3.5.4 PIN DIAGRAM OF ADC0808

Page 60: Temperature Sensors LM35

Fig: 3.5.4.1 pin diagram of ADC0808

3.5.5 I/O PINS

3.5.5.1 ADDRESS LINES A, B, C

The device contains 8-channels. A particular channel is selected by using the

address decoder line. The table shown below the input states for address lines to select

any channel.

Fig 3.5.5.1 Address linesAB,C

3.5.5.2 ADDRESS LATCH ENABLE ALE

The address is latched on the Low – High transition of ALE.

Page 61: Temperature Sensors LM35

3.5.5.2a START

The ADC’s Successive Approximation Register (SAR) is reset on the positive edge

i.e. Low- High of the Start Conversion pulse. Whereas the conversion is begun on the

falling edge i.e. High – Low of the pulse.

3.5.5.2b OUTPUT ENABLE

Whenever data has to be read from the ADC, Output Enable pin has to be pulled high

thus enabling the TRI-STATE outputs, allowing data to be read from the data pins D0-

D7.

The device contains 8-channels. A particular channel is selected by

using the addres s decoder line. The table shown below t he input states for address

lines to select any channel

 3.5.5..2c END OF CONVERSION (EOC)

This Pin becomes High when the conversion has ended, so the controller comes to

know that the data can now be read from the data pins.

3.5.5.3   Clock

External clock pulses are to be given to the ADC; this can be given either from

LM 555 in Astable mode or the controller can also be used to give the pulses.

3.6 LCD (LIQUID CRYSTAL DISPLAY)3.6.1 INTRODUCTION: A liquid crystal display (LCD) is a thin, flat display device made up of

any number of color or monochrome pixels arrayed in front of a light source or reflector.

Each pixel consists of a column of liquid crystal molecules suspended between two

transparent electrodes, and two polarizing filters, the axes of polarity of which are

perpendicular to each other. Without the liquid crystals between them, light passing

through one would be blocked by the other. The liquid crystal twists the polarization of

light entering one filter to allow it to pass through the other. A program must interact

with the outside world using input and output devices that communicate directly with a

human being. One of the most common devices attached to an controller is an LCD

display. Some of the most common LCDs connected to the contollers are 16X1, 16x2 and

20x2 displays. This means 16 characters per line by 1 line 16 characters per line by 2

lines and 20 characters per line by 2 lines, respectively.

Page 62: Temperature Sensors LM35

Many microcontroller devices use 'smart LCD' displays to output visual

information. LCD displays designed around LCD NT-C1611 module, are inexpensive,

easy to use, and it is even possible to produce a readout using the 5X7 dots plus cursor of

the display.

available. Line lengths of 8, 16, 20, 24, 32 and 40 characters are all standard, in one, two

Page 63: Temperature Sensors LM35

They have a standard ASCII set of characters and mathematical

symbols. For an 8-bit data bus, the display requires a +5V supply plus 10 I/O lines (RS

RW D7 D6 D5 D4 D3 D2 D1 D0). For a 4-bit data bus it only requires the supply lines

plus 6 extra lines(RS RW D7 D6 D5 D4). When the LCD display is not enabled, data

lines are tri-state and they do not interfere with the operation of the microcontroller.

3.6.2FEATURES:

(1) Interface with either 4-bit or 8-bit microprocessor.

(2) Display data RAM

(3) 80x8 bits (80 characters).

(4) Character generator ROM

(5). 160 different 5 7 dot-matrix character patterns.

(6). Character generator RAM

(7) 8 different user programmed 5 7 dot-matrix patterns.

(8).Display data RAM and character generator RAM may be

Accessed by the microprocessor.

(9) Numerous instructions

(10) .Clear Display, Cursor Home, Display ON/OFF,

CursorON/OFF, Blink Character, Cursor Shift, Display Shift.

(11). Built-in reset circuit is triggered at power ON.

(12). Built-in oscillator.

Data can be placed at any location on the LCD. For 16×1 LCD, the address locations are:

Fig : 3.6.2 .1Address locations for a 1x16 line LCD3.6.3SHAPES AND SIZES:

Page 64: Temperature Sensors LM35

Fig 3.6.3.1 different shapes and size Even limited to character based modules,there is still a wide variety of shapes

and sizes available. Line lenghs of 8,16,20,24,32 and 40 charecters are all standard, in one, two and four line versions. Several different LC technoCDlogies exists. “supertwist” types, for example, offer

Improved contrast and viewing angle over the older “twisted nematic” types. Some

modules are available with back lighting, so so that they can be viewed in dimly-lit

conditions. The back lighting may be either “electro-luminescent”, requiring a high

voltage inverter circuit, or simple LED illumination.

3.6.4ELECTRICAL BLOCK DIAGRAM:

Page 65: Temperature Sensors LM35

Fig 3.6.4.1 LCD electrical block diagram

3.6.5POWER SUPPLY FOR LCD DRIVING:

Fig 3.6.5.1 LCD power supply and driving circuit

3.6.6 PIN DESCRIPTION:Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins

(two pins are extra in both for back-light LED connections).

Page 66: Temperature Sensors LM35

Fig:3.6.6.1 pin diagram of 1x16 lines lcd

3.6.7 CONTROL LINES:

EN:

Line is called "Enable." This control line is used to tell the LCD that you are

sending it data. To send data to the LCD, your program should make sure this line is low

(0) and then set the other two control lines and/or put data on the data bus. When the

other lines are completely ready, bring EN high (1) and wait for the minimum

amount of time required by the LCD datasheet (this varies from LCD to LCD), and end

by bringing it low (0) again.

Page 67: Temperature Sensors LM35

RS:

Line is the "Register Select" line. When RS is low (0), the data is to be treated as

a command or special instruction (such as clear screen, position cursor, etc.). When RS is

high (1), the data being sent is text data which sould be displayed on the screen. For

example, to display the letter "T" on the screen you would set RS high.

RW:

Line is the "Read/Write" control line. When RW is low (0), the information on the

data bus is being written to the LCD. When RW is high (1), the program is effectively

querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read

command. All others are write commands, so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation

selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,

DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

3.6.8 LOGIC STATUS ON CONTROL LINES:

• E - 0 Access to LCD disabled

- 1 Access to LCD enabled

• R/W - 0 Writing data to LCD

- 1 Reading data from LCD

• RS - 0 Instructions

- 1 Character

3.6.9 WRITING DATA TO LCD:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

Page 68: Temperature Sensors LM35

3.6.10 READ DATA FROM DATA LINES (if it is reading)ON LCD:1) Set R/W bit to high

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

3.6.11 ENTERING TEXT: First, a little tip: it is manually a lot easier to enter characters and commands in

hexadecimal rather than binary (although, of course, you will need to translate commands

from binary couple of sub-miniature hexadecimal rotary switches is a simple matter,

although a little bit into hex so that you know which bits you are setting). Replacing the

d.i.l. switch pack with a of re-wiring is necessary.

The switches must be the type where On = 0, so that when they are turned to the

zero position, all four outputs are shorted to the common pin, and in position “F”, all four

outputs are open circuit.

All the available characters that are built into the module are shown in Table 3.

Studying the table, you will see that codes associated with the characters are quoted in

binary and hexadecimal, most significant bits (“left-hand” four bits) across the top, and

least significant bits (“right-hand” four bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and

Greek characters (and a few other things) are obvious exceptions. Since these intelligent

modules were designed in the “Land of the Rising Sun,” it seems only fair that their

Katakana phonetic symbols should also be incorporated.

The more extensive Kanji character set, which the Japanese share with the

Chinese, consisting of several thousand different characters, is not included! Using the

switches, of whatever type, and referring to Table 3, enter a few characters onto the

display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when

sending the characters, and switch E (S9) must be pressed for each of them. Thus the

operational order is: set RS high, enter character, trigger E, leave RS high, enter another

character, trigger E, and so on.

The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the

Page 69: Temperature Sensors LM35

CGRAM. This is the Character Generator RAM (random access memory), which can be

used to hold user-defined graphics characters. This is where these modules really start to

show their potential, offering such capabilities as bar graphs, flashing symbols, even

animated characters. Before the user-defined characters are set up, these codes will just

bring up strange looking symbols.

Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank

characters. ASCII codes “proper” start at 00100000 ($20) and end with 01111111 ($7F).

Codes 10000000 to 10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0

to $DF) are the Japanese characters.

Page 70: Temperature Sensors LM35
Page 71: Temperature Sensors LM35

3.6.12 INTIALIZATION BY INSTRUCTIONS:

If the power conditions for the normal operation of the internal reset circuit

are not satisfied, then executing a series of instructions must initialize LCD unit. The

procedure for this initialization process is as above show.

Page 72: Temperature Sensors LM35

3.7 SERIAL DATA COMMUNICATION:

For serial data communication to work the byte of data must be converted to

serial bits using a parallel-in-serial-out shift register; then it can be transmitted over a

single data line. This also means that at the receiving end there must be a serial-in-

parallel-out shift register to receive the serial data and pack them into a byte. Of course, if

data is to be transferred on the telephone line, it must be converted from 0s and 1s to

audio tones, which are sinusoidal-shaped signals. This conversion is performed by a

peripheral device called a modem, which stands for “modulator/demodulator”.

3.7.1: RS232 STANDARDS:

To allow compatibility among data communication equipment made by various

manufacturers, an interfacing standard called RS232 was set by the Electronics Industries

Association (EIA) in 1960. Today, RS232 is the most widely used serial I/O interfacing

standard. However, since the standard was set long before the advent of TTL logic

family, its input and output voltage levels are not TTL compatible. In RS232, a 1 is

represented by -3 to -25V, while a 0 bit is +3 to +25V, making -3 to +3 undefined. For

this reason, to connect any RS232 to a microcontroller system we must use voltage

converters such as MAX232 to convert the TTL logic levels to the RS232 voltage levels,

and vice versa. MAX232 IC chips are commonly referred to as line drivers.

3.7.2: DB-25 Connector:

The following table provides the pins and their labels for the RS232 cable,

commonly referred to as the DB-25 connector. In labeling, DB-25P refers to the plug

connector (male) and DB-25S is for the socket connector (female).

PIN DESCRIPTION

1 Protective ground

2 Transmitted data (TxD)

3 Received data (RxD)

4 Request to send (RTS)

5 Clear to send (CTS)

Page 73: Temperature Sensors LM35

6 Data set ready (DSR)

7 Signal ground (GND)

8 Data carrier detect (DCD)

9/10 Reserved for data testing

11 Unassigned

12 Secondary data carrier detect

13 Secondary clear to send

14 Secondary transmitted data

15 Transmit signal element timing

16 Secondary received data

17 Receive signal element timing

18 Unassigned

19 Secondary request to send

20 Data terminal ready (DTR)

21 Signal quality detector

22 Ring indicator

23 Data signal rate select

24 Transmit signal element timing

Unassigned

Table 3.7.2.1: Pin Description of DB-25 Connector.

3.7.3: DB-9 Connector:

Since not all the pins are used in PC cables, IBM introduced the DB-9 version

of the serial I/O standard, which uses 9 pins only, as shown in the following table:

PIN DESCRIPTION

1 Data carrier detect (DCD)2 Received data (RxD)

3 Transmitted data (TxD)

4 Data terminal ready (DTR)

5 Signal ground (GND)

6 Data set ready (DSR)

7 Request to send (RTS)

8 Clear to send (CTS)

9 Ring indicator (RI)

Page 74: Temperature Sensors LM35

Table 3.7.3.1: Pin Description of DB-9 Connector.

Fig 3.7.3.2: D-Subminiature.

The D-subminiature or D-sub is a common type of electrical connector used

particularly in computers. At the time of introduction they were some of the smaller

connectors used on computer systems. A D-sub contains two or more parallel rows of

pins or sockets usually surrounded by a D-shaped metal shield that provides mechanical

support, some screening against electromagnetic interference, and ensures

correctorientation.

3.7.4 MAX 232

3.7.4.1INTRODUCTION: A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is

-3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins

of the microcontroller thus need a converter chip. A MAX232 chip has long been using in

Page 75: Temperature Sensors LM35

many microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all

RS232 specifications while using only +5V power supply. It has two onboard charge

pump voltage converters which generate +10V to -10V power supplies from a single 5V

supply. It has four level translators, two of which are RS232 transmitters that convert

TTL/CMOS input levels into +9V RS232 outputs. The other two level translators are

RS232 receivers that convert RS232 input to 5V. Typical MAX232 circuit is shown

below.

3.7.5 Pin diagram of MAX232:

3.7.5.1 SCHEMATIC DIAGRAM OF MAX 232

3.7.6 FEATURES:1. Operates With Single 5-V Power Supply

Page 76: Temperature Sensors LM35

2.LinBiCMOSE Process Technology

3.Two Drivers and Two Receivers

4.±30-V Input Levels

5.Low Supply Current . 8 mA Typical

6.Meets or Exceeds TIA/EIA-232-F and ITURecommendation V.28

7.Designed to be Interch Maxim MAX232

3.7.7APPLICATIONS:

TIA/EIA-232-F

Battery-Powered Systems

Terminals

Modems

Computers

9.ESD Protection ExceedMIL-STD-883, Method 3015

10.Package Options Include small-Outline (D, DW) Packages and

Standard Plastic (N) DIPs

3.7.8CIRCUIT CONNECTIONS:

A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -

3V to -12V and logic '0' is +3V to +12V. To convert a TTL logic, say, TxD and RxD pins

of the uC chips, thus need a converter chip. A MAX232 chip has long been using in

many uC boards.

It provides 2-channel RS232C port and requires external 10uF pacitors.

Carefully check the polarity of capacitor when soldering the board. A DS275 however,

no need external capacitor and smaller. Either circuit can be used without any problems.

Page 77: Temperature Sensors LM35

Fig 3.7.8.2 circuit connection of MAX232

3. 8 GSM (Global System for Mobile communications)3.8.1 1INTRODUCTION

GSM (Global System for Mobile communications) is a cellular network, which means

that mobile phones connect to it by searching for cells in the immediate vicinity. GSM

networks operate in four different frequency ranges. Most GSM networks operate in the

900 MHz or 1800 MHz bands. Some countries in the Americas use the 850 MHz and

1900 MHz bands because the 900 and 1800 MHz frequency bands were already

allocated.

The rarer 400 and 450 MHz frequency bands are assigned in some countries, where these

frequencies were previously used for first-generation systems.

GSM-900 uses 890–915 MHz to send information from the mobile station to the base

station (uplink) and 935–960 MHz for the other direction (downlink), providing 124 RF

channels (channel numbers 1 to 124) spaced at 200 kHz. Duplex spacing of 45 MHz is

used. In some countries the GSM-900 band has been extended to cover a larger frequency

range. This 'extended GSM', E-GSM, uses 880–915 MHz (uplink) and 925–960 MHz

(downlink), adding 50 channels (channel numbers 975 to 1023 and 0) to the original

Page 78: Temperature Sensors LM35

GSM-900 band. Time division multiplexing is used to allow eight full-rate or sixteen

half-rate speech channels per radio frequency channel. There are eight radio timeslots

(giving eight burst periods) grouped into what is called a TDMA frame. Half rate

channels use alternate frames in the same timeslot. The channel data rate is

270.833 kbit/s, and the frame duration is 4.615 ms.

3.8.2 GSM ADVANTAGES:

GSM also pioneered a low-cost, to the network carrier, alternative to voice calls, the

Short t message service (SMS, also called "text messaging"), which is now supported on

other mobile standards as well. Another advantage is that the standard includes one

worldwide Emergency telephone number, 112. This makes it easier for international

travelers to connect to emergency services without knowing the local emergency number.

3.8.3 THE GSM NETWORK:

GSM provides recommendations, not requirements. The GSM specifications

define the functions and interface requirements in detail but do not address the hardware.

The GSM network is divided into three major systems: the

switching system (SS), the base station system (BSS), and the operation and support

system (OSS).

Page 79: Temperature Sensors LM35

Fig 3.8.3.1 The architecture of GSM

3.6.3.1The Switching System:

The switching system (SS) is responsible for performing call processing and subscriber-

related functions. The switching system includes the following functional units.

Home location register (HLR): The HLR is a database used for storage and

management of subscriptions. The HLR is considered the most important

database, as it stores permanent data about subscribers, including a subscriber's

service profile, location information, and activity status. When an individual buys

a subscription from one of the PCS operators, he or she is registered in the HLR

of that operator.

Page 80: Temperature Sensors LM35

Mobile services switching center (MSC): The MSC performs the telephony

switching functions of the system. It controls calls to and from other telephone

and data systems. It also performs such functions as toll ticketing, network

interfacing, common channel signaling, and others.

Visitor location register (VLR): The VLR is a database that contains temporary

information about subscribers that is needed by the MSC in order to service

visiting subscribers. The VLR is always integrated with the MSC. When a mobile

station roams into a new MSC area, the VLR connected to that MSC will request

data about the mobile station from the HLR. Later, if the mobile station makes a

call, the VLR will have the information needed for call setup without having to

interrogate the HLR each time.

Authentication center (AUC): A unit called the AUC provides authentication

and encryption parameters that verify the user's identity and ensure the

confidentiality of each call. The AUC protects network operators from different

types of fraud found in today's cellular world.

Equipment identity register (EIR): The EIR is a database that contains

information about the identity of mobile equipment that prevents calls from

stolen, unauthorized, or defective mobile stations. The AUC and EIR are

implemented as stand-alone nodes or as a combined AUC/EIR node.

3.8.3.2The Base Station System (BSS):

All radio-related functions are performed in the BSS, which consists of base station

controllers (BSCs) and the base transceiver stations (BTSs).

BSC: The BSC provides all the control functions and physical links between the

MSC and BTS. It is a high-capacity switch that provides functions such as

handover, cell configuration data, and control of radio frequency (RF) power

levels in base transceiver stations. A number of BSCs are served by an MSC.

BTS: The BTS handles the radio interface to the mobile station. The BTS is the

radio equipment (transceivers and antennas) needed to service each cell in the

network. A group of BTSs are controlled by a BSC.

Page 81: Temperature Sensors LM35

3.8.3.3The Operation and Support System

The operations and maintenance center (OMC) is connected to all equipment in the

switching system and to the BSC. The implementation of OMC is called the operation

and support system (OSS). The OSS is the functional entity from which the network

operator monitors and controls the system. The purpose of OSS is to offer the customer

cost-effective support for centralized, regional and local operational and maintenance

activities that are required for a GSM network. An important function of OSS is to

provide a network overview and support the maintenance activities of different operation

and maintenance organizations.

3.8.4 ADDITIONAL FUNCTIONAL ELEMENTS

Message center (MXE): The MXE is a node that provides integrated voice, fax,

and data messaging. Specifically, the MXE handles short message service, cell

broadcast, voice mail, fax mail, e-mail, and notification.

Mobile service node (MSN): The MSN is the node that handles the mobile

intelligent network (IN) services.

Gateway mobile services switching center (GMSC): A gateway is a node used

to interconnect two networks. The gateway is often implemented in an MSC. The

MSC is then referred to as the GMSC.

GSM inter-working unit (GIWU): The GIWU consists of both hardware and

software that provides an interface to various networks for data communications.

Through the GIWU, users can alternate between speech and data during the same

call. The GIWU hardware equipment is physically located at the MSC/VLR.

3.8.5 GSM NETWORK AREAS:

The GSM network is made up of geographic areas. As shown in bellow figure, these

areas include cells, location areas (LAs), MSC/VLR service areas, and public land mobile

network (PLMN) areas.

Page 82: Temperature Sensors LM35

Fig 3.8.5.1 GSM network area

Location Areas:

The cell is the area given radio coverage by one base transceiver station. The GSM

network identifies each cell via the cell global identity (CGI) number assigned to each

cell. The location area is a group of cells. It is the area in which the subscriber is paged.

Each LA is served by one or more base station controllers, yet only by a single MSC

Each LA is assigned a location area identity (LAI) number.

MSC/VLR service areas:

An MSC/VLR service area represents the part of the GSM network that is covered by one

MSC and which is reachable, as it is registered in the VLR of the MSC.

PLMN service areas:

The PLMN service area is an area served by one network operator.

3.8.6 GSM SPECIFICATIONS:

Specifications for different personal communication services (PCS) systems vary among the different PCS networks. Listed below is a description of the specifications and characteristics for GSM.

Page 83: Temperature Sensors LM35

Frequency band: The frequency range specified for GSM is 1,850 to 1,990 MHz

(mobile station to base station).

Duplex distance: The duplex distance is 80 MHz. Duplex distance is the distance

between the uplink and downlink frequencies. A channel has two frequencies, 80

MHz apart.

Channel separation: The separation between adjacent carrier frequencies. In

GSM, this is 200 kHz.

Modulation: Modulation is the process of sending a signal by changing the

characteristics of a carrier frequency. This is done in GSM via Gaussian minimum

shift keying (GMSK).

Transmission rate: GSM is a digital system with an over-the-air bit rate of 270

kbps.

Access method: GSM utilizes the time division multiple access (TDMA) concept.

TDMA is a technique in which several different calls may share the same carrier.

Each call is assigned a particular time slot.

Speech coder: GSM uses linear predictive coding (LPC). The purpose of LPC is

to reduce the bit rate. The LPC provides parameters for a filter that mimics the

vocal tract. The signal passes through this filter, leaving behind a residual signal.

Speech is encoded at 13 kbps.

3.8.7 GSM SUBSCRIBER SERVICE:

Dual-tone multifrequency (DTMF): DTMF is a tone signaling scheme often used for

various control purposes via the telephone network, such as remote control of an

answering machine. GSM supports full-originating DTMF.

Facsimile group III—GSM supports CCITT Group 3 facsimile. As standard fax

machines are designed to be connected to a telephone using analog signals, a special fax

converter connected to the exchange is used in the GSM system. This enables a GSM–

connected fax to communicate with any analog fax in the network.

Page 84: Temperature Sensors LM35

Short message services: A convenient facility of the GSM network is the short message

service. A message consisting of a maximum of 160 alphanumeric characters can be sent

to or from a mobile station. This service can be viewed as an advanced form of

alphanumeric paging with a number of advantages. If the subscriber's mobile unit is

powered off or has left the coverage area, the message is stored and offered back to the

subscriber when the mobile is powered on or has reentered the coverage area of the

network. This function ensures that the message will be received.

Cell broadcast: A variation of the short message service is the cell broadcast facility. A

message of a maximum of 93 characters can be broadcast to all mobile subscribers in a

certain geographic area. Typical applications include traffic congestion warnings and

reports on accidents.

Voice mail: This service is actually an answering machine within the network, which is

controlled by the subscriber. Calls can be forwarded to the subscriber's voice-mail box

and the subscriber checks for messages via a personal security code.

Fax mail: With this service, the subscriber can receive fax messages at any fax machine.

The messages are stored in a service center from which they can be retrieved by the

subscriber via a personal security code to the desired fax number

3.8.8 SUPPLEMENTARY SERVICES:

GSM supports a comprehensive set of supplementary services that can complement and

support both telephony and data services.

Call forwarding: This service gives the subscriber the ability to forward incoming calls

to another number if the called mobile unit is not reachable, if it is busy, if there is no

reply, or if call forwarding is allowed unconditionally.

Barring of outgoing calls: This service makes it possible for a mobile subscriber to

prevent all outgoing calls.

Page 85: Temperature Sensors LM35

Barring of incoming calls: This function allows the subscriber to prevent incoming

calls. The following two conditions for incoming call barring exist: baring of all

incoming calls and barring of incoming calls when roaming outside the home PLMN.

Advice of charge (AoC): The AoC service provides the mobile subscriber with an

estimate of the call charges. There are two types of AoC information: one that provides

the subscriber with an estimate of the bill and one that can be used for immediate

charging purposes. AoC for data calls is provided on the basis of time measurements.

Call hold: This service enables the subscriber to interrupt an ongoing call and then

subsequently reestablish the call. The call hold service is only applicable to normal

telephony.

Call waiting: This service enables the mobile subscriber to be notified of an incoming

call during a conversation. The subscriber can answer, reject, or ignore the incoming call.

Call waiting is applicable to all GSM telecommunications services using a circuit-

switched connection.

Multiparty service: The multiparty service enables a mobile subscriber to establish a

multiparty conversation—that is, a simultaneous conversation between three and six

subscribers. This service is only applicable to normal telephony.

Calling line identification presentation/restriction: These services supply the called

party with the integrated services digital network (ISDN) number of the calling party.

The restriction service enables the calling party to restrict the presentation. The restriction

overrides the presentation.

Closed user groups (CUGs): CUGs are generally comparable to a PBX. They are a

group of subscribers who are capable of only calling themselves and certain numbers

3.8.9 MAIN AT COMMANDS:

"AT command set for GSM Mobile Equipment” describes the Main AT commands to

communicate via a serial interface with the GSM subsystem of the phone.

Page 86: Temperature Sensors LM35

AT commands are instructions used to control a modem. AT is the abbreviation of

Attention. Every command line starts with "AT" or "at". That's why modem commands

are called AT commands. Many of the commands that are used to control wired dial-up

modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to

online data state), are also supported by GSM/GPRS modems and mobile phones.

Besides this common AT command set, GSM/GPRS modems and mobile phones support

an AT command set that is specific to the GSM technology, which includes SMS-related

commands like AT+CMGS (Send SMS message), AT+CMSS (Send SMS message from

storage), AT+CMGL (List SMS messages) and AT+CMGR (Read SMS messages).

Note that the starting "AT" is the prefix that informs the modem about the start of a

command line. It is not part of the AT command name. For example, D is the actual AT

command name in ATD and +CMGS is the actual AT command name in AT+CMGS.

However, some books and web sites use them interchangeably as the name of an AT

command.

Here are some of the tasks that can be done using AT commands with a GSM/GPRS

modem or mobile phone:

Get basic information about the mobile phone or GSM/GPRS modem. For

example, name of manufacturer (AT+CGMI), model number (AT+CGMM),

IMEI number (International Mobile Equipment Identity) (AT+CGSN) and

software version (AT+CGMR).

Get basic information about the subscriber. For example, MSISDN (AT+CNUM)

and IMSI number (International Mobile Subscriber Identity) (AT+CIMI).

Get the current status of the mobile phone or GSM/GPRS modem. For example,

mobile phone activity status (AT+CPAS), mobile network registration status

(AT+CREG), radio signal strength (AT+CSQ), battery charge level and battery

charging status (AT+CBC).

Establish a data connection or voice connection to a remote modem (ATD, ATA,

etc).

Page 87: Temperature Sensors LM35

Send and receive fax (ATD, ATA, AT+F*).

Send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write

(AT+CMGW) or delete (AT+CMGD) SMS messages and obtain notifications of

newly received SMS messages (AT+CNMI).

Read (AT+CPBR), write (AT+CPBW) or search (AT+CPBF) phonebook entries.

Perform security-related tasks, such as opening or closing facility locks

(AT+CLCK), checking whether a facility is locked (AT+CLCK) and changing

passwords (AT+CPWD).

(Facility lock examples: SIM lock [a password must be given to the SIM card

every time the mobile phone is switched on] and PH-SIM lock [a certain SIM

card is associated with the mobile phone. To use other SIM cards with the mobile

phone, a password must be entered.])

Control the presentation of result codes / error messages of AT commands. For

example, you can control whether to enable certain error messages (AT+CMEE)

and whether error messages should be displayed in numeric format or verbose

format (AT+CMEE=1 or AT+CMEE=2).

Get or change the configurations of the mobile phone or GSM/GPRS modem. For

example, change the GSM network (AT+COPS), bearer service type

(AT+CBST), radio link protocol parameters (AT+CRLP), SMS center address

(AT+CSCA) and storage of SMS messages (AT+CPMS).

Save and restore configurations of the mobile phone or GSM/GPRS modem. For

example, save (AT+CSAS) and restore (AT+CRES) settings related to SMS

messaging such as the SMS center address.

3. 9 BUZZER

Page 88: Temperature Sensors LM35

A buzzer or beeper is a signaling device, usually electronic, typically used in

automobiles, household appliances such as a microwave oven, or game shows.

Fig 3.9.1 buzzer diagram

It most commonly consists of a number of switches or sensors connected to a control unit

that determines if and which button was pushed or a preset time has lapsed, and usually

illuminates a light on the appropriate button or control panel, and sounds a warning in the

form of a continuous or intermittent buzzing or beeping sound. Initially this device was

based on an electromechanical system which was identical to an electric bell without the

metal gong . Often these units were anchored to a wall or ceiling and used the ceiling or

wall as a sounding board. Another implementation with some AC-connected devices was

to implement a circuit to make the AC current into a noise loud enough to drive a

loudspeaker and hook this circuit up to a cheap 8-ohm speaker.

Nowadays, it is more popular to use a ceramic-based piezoelectric sounder like a

Son alert which makes a high-pitched tone. Usually these were hooked up to "driver"

circuits which varied the pitch of the sound or pulsed the sound on and off.In game shows

it is also known as a "lockout system," because when one person signals ("buzzes in"), all

others are locked out from signaling. Several game shows have large buzzer buttons

which are identified as "plungers".

The word "buzzer" comes from th e

rasping noise that buzzers made when they were electromechanica l devices,

operated from stepped- down AC lin e voltage at 50 or 60 cycles. Other sounds

commonly used to indicate that a button has been pressed are a ring or a beep. Features:

Page 89: Temperature Sensors LM35

Rated Frequency: 2 KHz Continuous Tone

Operating Voltage: 5 - 7Vdc

Sound Pressure Level (10cm): 80dB @ 5Vdc

These high reliability electromagnetic buzzers are applicable to

general electronics equipment. Compact, pin terminal type electromagnetic buzzer with

2048 Hz output. Pin type terminal construction enables direct mounting onto printed

circuit boards

APPLICATIONS: Security Alerts,

Clocks,

Travel watches,

Keyboards,

Toys,

Various all.

CHAPTER-4

Page 90: Temperature Sensors LM35

ADVANTAGES:

Page 91: Temperature Sensors LM35

APPLICATIONS& FUTURE SCOPE

Page 92: Temperature Sensors LM35

CONCLUSION:-

Page 93: Temperature Sensors LM35