speed checker for highwayskaushikscienceprojects.com/.../2016/05/temperature-as.docx · web...

67
1 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52 TEMPRATURE INDICATOR USING AT89C52 A project report submitted in partial fulfillment of the requirement of the diploma in Electronics and Communication Engineering (DEC. 2012 TO MAY 2013) Submitted By AJAY SHARMA - 10006100003 KAVITA - 10006100020 PUJA RANI - 10006100036 Under the guidance of MR. VIKRAM DOGRA ( Lect. In Electronics & Communication Engg.)

Upload: doancong

Post on 08-Mar-2018

216 views

Category:

Documents


4 download

TRANSCRIPT

1 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

TEMPRATURE INDICATOR USINGAT89C52

A project report submitted in partial fulfillment of the requirement of the diploma in

Electronics and Communication Engineering (DEC. 2012 TO MAY 2013)

Submitted By AJAY SHARMA - 10006100003 KAVITA - 10006100020 PUJA RANI - 10006100036

Under the guidance ofMR. VIKRAM DOGRA

( Lect. In Electronics & Communication Engg.)

Govt. Polytechnic Mandi Adampur ( Hisar ), Haryana Department of Electronics & Communication Engg.

2 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CERTIFICATECERTIFICATE

We here by certify the work which is being presented in the project entitled “Temperature

Indicator using AT89C52” by “Ajay Sharma, Kavita,Puja Rani” in partial fulfillment of

requirements for the award of diploma (Electronics & Communication Engg.) submitted in the

“Department of Electronics & Communication Engg.” at G. P. MANDI AADAMPUR

under HSBTE is carried out during a period from DEC 2012 to MAY 2013 under the

supervision of “Mr. Vikram Dogra” Department of Electronics & Communication

Engineering, GP ADAMPUR. The matter presented in this project has not been submitted by

us in any other University/ Institute for the award of Diploma.\

AJAY SHARMA - 10006100003 KAVITA - 10006100020 PUJA RANI - 10006100036

This is to certify that the above statement made by the candidate is correct to the best of my/our

knowledge.

Mr. Vikram Dogra Lect. (ECE ) Govt. Polytechnic Mandi Adampur (Hisar)

Haryana

3 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

ACKNOWLEDGEMENT

Many lives & destinies are destroyed due to the lack of proper guidance, directions &

opportunities. The process of completion of this project was a tedious job & requires careful &

support at all stages. We would like to highlight the role played by individuals toward this.

Firstly we are very thankful to our parents and family members for providing us the

opportunity to build our carrier in field of engineering.

We are very thankful to Mr. Vikram Dogra , Head of The Department, for his kind support &

faith in us. I am very thankful to honourable Principle Mr. Rajeev Vasudeva for

providing me the opportunity & infrastructure to complete the project as a partial

fulfillment for the award of DIPLOMA

Last but definitely not the least the assistance provided by Lab Technician on the finer practical

spects that prevented many errors which would have been fatal for our project.

We also thankful to all the visible and invisible hands which helped us to complete this project

with a feeling of success.

4 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

ABSTRECT ABSTRECT

This report aims at giving an insight to the project entitled “Temperature Indicator using

AT89C52”. This project is prepared for the partial fulfillment of the diploma course in E.C.E

This primary objective of Report is:

To maintain the right blend of theory and practical and in mythological way in

analyzing a given circuit.

To develop the understanding and ability to design the practical circuit.

To expose to the reader this practical circuit which has been build and Laboratory

tested.

A glance at the contents revels that the report is logically subdivided into no. of topics. The first

topic gives a brief introduction to the project. The 2nd topic covers the complete list of the

components and third one explains the components used. Next is the description of the project.

The report also explains the approximate cost of the project and also the problems faced during

fabrication.

The project is being made with the intention of getting into practical application of above

mention components, which we had studied during our engineering course. The report

comprises of detailed hardware description, circuit and P.C.B layout and block diagram used

which further helps in better understanding of the subject under consideration.

For our and objective has been top priority in the preparation of this project. We are confident

that the overall contents will please most of the readers.

CONTENTS

5 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

PAGE NO.

Chapter 1: INTRODUCTION 61.1 General Overview of Project 7-8

Chapter 2: LITERATURE REVIEW 92.1 List of Components 10

2.2 Components Description 11

2.2.1 IC At89C52 Microcontroller 12-17

2.2.2 IC DS1621 17-21

2.2.3 Voltage Regulator 21-22

2.2.4 Diode 22-24

2.2.5 L.E.D. 24-25

2.2.6 L.C.D. 26

2.2.7 Resistors 27-30

2.2.8 Capacitors 31-32

2.2.9 Transformer 33-34

2.2.10 PCB Layout 35-38

Chapter 3: CIRCUIT DIAGRAM & WORKING 393.1 Circuit diagram description 40

3.2 Working 41-43

Chapter 4: RESULTS & DISCUSSION 44-46

Chapter 5: CONCLUSION 47-48

Chapter 6: Troubleshooting 49REFERENCES 51-52

6 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CHAPTER 1 CHAPTER 1

(INTRODUCTIO) (INTRODUCTIO)

INTRODUCTIONINTRODUCTION

7 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Here’s a microcontroller-based temperature indicator that displays the Temperature in the range of -55*C to 125*C. Besides AT89C52 microcontroller, it uses a temperature sensor chip and an LCD module. The indicator outputs the calibrated in digital form. The program for the microcontroller is written in C and not is Assembly language. Since C program has well-defined syntax, it for outweighs the merits of the Assembly language program.

Features

There is no time lag to operate the device.

Accuracy.

These operations can also be displayed on the LCD screen.

This circuit does not require any complex IC, so any one with little knowledge of

electronics can construct this circuit.

8 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CHAPTER 2 CHAPTER 2

(LITERATURE REVIEW) (LITERATURE REVIEW)

9 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.1 LIST OF COMPONENTS2.1 LIST OF COMPONENTS

PARTS LISTSemiconductors:IC1IC2IC3D1-D4LED1

7805 regulator ICAT89C52 microcontrollerDS1621 temperature sensorIN4007 rectifier diodesGreen LED

Resistor (all ¼-watt,+-5%carbon, unless stated otherwise):R1R2R3R4, R5VR1

1-kilo-ohm47-kilo-ohm10-kilo-ohm4.7-kilo-ohm1-kilo-ohm preset

Capacitors:C1C2, C3, C4C5C6, C7

470uF, 25V electrolytic capacitor0.1uF, ceramic disk10uF, 16V electrolytic capacitor33uF, ceramic capacitor

Miscellaneous:Transformer

CrystalLCD

230V AC primary to 0-9V, 250mA secondary12MHz16*1 LCD module

10 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2 2.2 COMPONENT DESCRIPTIONCOMPONENT DESCRIPTION

11 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.1 IC AT89C522.2.1 IC AT89C522.2.1.1. Introduction Microcontroller unit: Microcontroller AT89C52 (IC2) is a 40-pin IC from Atmel. Its pin details are shown in fig.

Like AT89C52 , it also belongs to the 8031/8051 family Microcontroller At89C52 has a 256*8-bit internal random access memory (RAM), 8 interrupt sources and 8 KB of flash memory compared to 128*8-bit internal RAM, 6 interrupt sources and 4 KB of flash memory in AT89C52. By combining a

12 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

versatile 8-bit CPU with flash memory on a monolithic chip, Atmel AT89C52 is a powerful, highly flexible and cost-effective solution to many embedded control applications. Port 0 and 2 are8-bit bidirectional input/ output (I/O) ports. These ports haven’t been used in this temperature indicator. Port 1 is an 8- bit bidirectional I/O port with internal pull-puss. Ports 1.0 through 1.7 are connected to pins 7 through 14 of the LCD. Port-1 output buffers can sink/source 4 TTL input. Port 3 is an 8-bit bidirectional I/O port with internal pull- puss. Ports 3.0 and 3.1 of IC2, are connected to serial clock line (SCL) and serial data line (SDA) of IC3, respectively. Port 3.2 through 3.4 are connected to pins 4 through 6 of the

13 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

LCD, respectively. Port-3 output buffers can sink/source 4 TTL input.

14 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

A 12MHz crystal oscillator is connected to XTAL1 and XTAL2 pins for operation of the microcontroller. A high pulse on RST pin 9 while the oscillator is running resets the microcontroller. In this circuit, this pin is connected to + Vcc through capacitor C5 (10uF, 16V). The external-access enable pin (EA) is connected to + Vcc for internal program executions. This pin also receives the 12V programming-enable voltage (Vpp) during flash programming when 12V programming is selected.

15 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.2. IC DS1621

Temperature sensor:- Temperature sensor chip DS1621 (IC 3) is an 8-pin DIP IC. Its pin details are shown in Fig. and the internal block diagram in Fig. The chip can measure temperatures from -55*C to +125*C in 0.5*C increments, which are read as 9-bit values. It can operate off 2.7V to 5.6V. Data is read / written via a 2-wire serial interface. Pins 1 and 2 of the temperature IC are connected to pins 11 and 10 of the microcontroller, respectively.

The thermal alarm output (Tout) of IC DS1621 activates when the temperature exceeds user-defined high temperature TH. The output remains active until the temperature drops below user-defined low temperature TL. User-defined temperature settings are stored in the non-volatile memory. Temperature settings and temperature readings are all communicated to/ from IC DS 1621 over a 2-wire serial cable. The most significant bit (MSB) of the data is transmitted first and the last significant bit (LSB) is transmitted last.

16 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

17 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

TABLE DS1621 Command Set

Instruction DescriptionRead Temperature Reads last converted temperature

Value from temperature registerRead Counter Reads value of count remaining

From counter.Read Slope Reads value of the slope

Accumulator.Start Convert T Initiates temperature conversionStop Convert T Halts Temperature conversion.Access TH Reads or writer high

temperatureLimit value into TH register.

Access TL Reads or writes lowTemperature limit value into TLRegister

Access Configuration

Reads or writes configurationData to configuration register.

18 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

DONE THF TLF NVB 1 0 POL 1SHOT MSB LSB

Addressing: The chip address of DS1621 comprises internal preset code nibble ‘1001’ (binary) followed by externally configurable address pins/bits A2, A1 and A0. The eighth bit of the address byte is determined by the type of operation (either read or write) that is to be performed. For writing to the device the eighth bit is ‘0’ and for reading from the device the eighth bit ‘1’. In our case, A2, A1 and A0 pins are grounded and hence the device address for writing is ‘1001000b’ or 90(hex) and for reading the device address is ‘1001000b’ or 91(hex).

Configuration/status register: This register can be accessed for reading or writing by issuing command byte AC (hex) from the master (82C52). This register is particularly required if DS1621 is used for thermostat control, since it contains flag bits THF (high-temperature flag) and TLF (low-temperature flag) which are set to ‘1’ when temperature crosses the respective limits earlier written into TH and TL register. It also contains the flag bit (Done), which is set to ‘1’ when results of conversion are available after issuing of start conversion command EE (hex). The other bits of configuration register are defined above. ‘NVB’ is the non-volatile memory busy flag ‘1’ is write to an E2 memory cell in progress, ‘0’ indicates that non-volatile output polarity bit (‘1’ = active-high and ‘0’ = active-low) and ‘1SHOT’ is one-shot mode. A copy to E2 may take up to 10 ms. If 1SHOT is ‘1’ , DS1621 will perform one temperature conversion upon reception of the Start Convert T protocol. If 1SHOT is ‘0’, DS1621 will continuously perform temperature conversions. This bit is non-volatile.

2.2.3 VOLTAGE REGULATOR

19 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Voltage regulation means to prevent the voltage from dropping down or rising above a specific value. A 12 volt regulator circuit will provide exactly 12V under load as well as without load. On the other hand, an un-regulated 12V power supply output voltage with drop under while the load will increase and will rise when not under load. For example, an un-regulated 12V power supply can output 14V when not under load and can drop the voltage to 11V when under 1A load and 10V when under 2A load. This rise and drop of voltage in un-regulated power supplies can sometimes burn sensitive electronics equipments.I, once, went to market to buy a voltage regulated supply but was amazed to see the cost. I decided to build my own power supply and researched a bit on the internet. My required load was 12V and 1A so I ended up designing the following voltage regulator circuit which is very low cost but at the same time it is efficient.

7805 is a very good voltage regulator integrated circuit (IC). It is cheap but efficient, that is why I selected it for this regulator circuit. 7805 Pin2 connections are also explained in my regulator circuit diagram. You can see that Pin 1 is input, Pin 2 is Ground (which is often –V) and Pin 3 is output. It is very simple to understand 7805. The 220uF 25V capacitor is used as a buffer to cover frequency gap. The second capacitor is used as an extra filter. IN4001 rectifiers are used to convert AC current into DC current. Transformer is used to convert 240V AC into 15V AC. If you have 110V mains then you can use a 110V AC to 15 AC transformer.I have successfully used this voltage regulator circuit to power up my ADSL modem. In fact, the ADSL modem was restarted every one hour or so with its original power supply but after I replaced it with this voltage regulator circuit, the modem is never restarted by itself. Any electronic device which requires 12V 1A power can be powered by this circuit so feel free to use it

CHARACTERISTICS

Vo- The regulated output voltage is fixed at a value which is specified by manufactures

and it is indicated by the IC number.

Vin- The unregulated input must be at least 2V more than regulated output voltage

Io max- The output current on the load may vary from zero to maximum output current

and to protect it from thermal breakdown heat sinks are used.

Thermal Shut Down-There is internal temperature sensors which turn OFF the IC when

it becomes too hot. The IC again starts working when it is cooling up to given specified

level.

20 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.4 DIODE

The simplest semiconductor device is made up of a sandwich of P and N type semiconductor

material, with contacts provided to connect the P-type layers to an external circuits, this is a

junction diode. A diode allows current to flow easily in one direction but not in the other, i.e. its

resistance is low in the conducting or forward direction but very high in the opposing or reverse

direction. Most semiconductor diodes are made from silicon or germanium. A diode has two

leads, the anode and the cathode. Diodes are the electrical versions of the valve and early

diodes were actually called valves.

Fig 2.6 Diode

Forward Voltage Drop

Electricity uses up a little energy pushing its way through the diode, rather like a person

pushing through a door with a spring. This means that there is a small voltage across a

conducting diode, it is called the forward voltage drop and is about 0.7 volts for all normal

diodes which are made from silicon. The forward voltage drop of a diode is almost constant

whatever the current passing through the diode so they have a very steep characteristic (current-

voltage graph).

21 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig 2.7 Forward and reverse bias characteristics of silicon diode.

Reverse Voltage

When a reverse voltage is applied a perfect diode does not conduct, but all real diodes leak a

very tiny current of few µA or less. This can be ignored in most circuits because it will be very

much smaller than the current flowing in the forward direction. However, all diodes have a

maximum reverse voltage (usually 50V or more) and if this is exceeded the diode will fail and

pass a large current in the reverse direction, this is called breakdown.

Ordinary diodes can be split into two types: Signal diodes which pass small currents of 100 mA

or less and Rectifier diodes which can pass large currents. In addition there are LEDs and

Zenger diodes.

Rectifier Diodes

Rectifier diodes are used in power supplies to convert alternating current (AC) to direct current

(DC), a process called rectification. They are also used elsewhere in circuits when a large

current must pass through the diode. All rectifier diodes are made from silicon and therefore

have a forward voltage drop of 0.7V.

Bridge RectifiersThere are several ways of connecting diodes to make a rectifier to convert AC to DC. The

bridge rectifier is one of them and it is available in special packages containing the four diodes

required. Bridge rectifiers are rated by their maximum current and maximum reverse voltage.

22 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig2.8 Bridge Rectifier Diode

Features Reverse Voltage-50 to 1000V

Forward Current-1.0amp

Construction utilizes void free molded plastic technique.

Low reverse leakage current

High temperature soldering (250ºC/10sec).

23 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.5 L.E.D. (LIGHT EMITTING DIODE)

Light emitting diode (LED) is basically a P-N junction semiconductor diode particularly

designed to emit visible light. There are infrared emitting LED’s which emit invisible light. The

LED’s are now available in many colors red, green and yellow. A normal LED emits at 2.4V

and consumes mA of current. The LED’s are made in the form of flat tiny P-N junction

enclosed in a semi-spherical dome made up of clear colored epoxy resin. The dome of a LED

acts as a lens and diffuser of light. The diameter of the base is less than a quarter of an inch.

The actual diameter varies somewhat with different makes. LED’s often have leads of

dissimilar length and the shorter one is the cathode. This is not strictly adhered to by all

manufacturers. Sometimes the cathode side has a flat base. If there is doubt, the polarity of the

diode should be identified. Simple bench methods to use the ohmmeter incorporating 3-volts

cells for ohmmeter function. When connected with the ohmmeter: one way there will be no

deflection and when connected the other way round there will be a large deflection of a pointer.

When this occurs, the anode lead is connected to the negative of test lead and cathode to the

positive test lead of the ohmmeter.

ACTION

An LED consists of a junction diode made from the semiconductor compound gallium arsenide

phosphide. It works by the effect of electroluminescence It emits light when the diode is

forward biased (switched on), electrons are able to recombine with holes and energy is released

in the form of light .This effect is called electroluminescence and the color of light is

determined by the energy gap of the semiconductor. At present red, yellow and green LED’s

are available. When a p-n junction diode is forward biased, electrons move across the junction

from the n-type side to the p-type side where they recombine with holes near the junction from

the n-type side to the p-type side. The same occurs with holes going across the junction from

the p-type side. Every recombination results in the release of a certain amount of energy,

causing in most

24 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig. 2.9 LED

Semiconductors, a temperature rise. In gallium arsenide phosphide some of the energy is

emitted as light, which gets out of the LED because the junction is formed very close to the

surface of the material. An LED does not light when reverse biased and if the bias is 5V or

more it may be damaged.

25 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

LCD: 6For display, a Lampex make 16x1 LCD (model GDM1601A) was used. Pin connections of this LCD are given in Table II. Pins15 and 16 haven’t been used. Pin 3 is connected to the circuit ground through a 1-kilo-ohm preset that is used to control the light intensity of the LCD. Note that the Hitachi make 16×1 LCD (HD44780A00) will not work in this project.

26 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.7 RESISTORS

Resistance refers to the property of the substance that impedes the flow of electric current.

Some substances resist the flow of electric current more than others. If a substance offers high

resistance to the current flow it is called insulator. If its resistance to current flow is very low, it

is called a conductor. Resistivity refers to the ability of substance to resist current flow. Good

conductors have low resistivity and insulators have high resistivity.

Types of ResistorsResistors come in variety of value and types. The most common type is the fixed resistor. Fixed

resistors have single value of resistance, which remain constant. There are also variable

resistors that can be adjusted to vary or change the amount of resistance in the circuit.

Fig 2.3 Resistors

The value of resistance of the resistors is given in ohms. Resistors can have values from less

than one ohm to many millions of ohms.

Fixed resistorsThe most common fixed resistor is the composition type. The resistance element is made of

graphite, or some other form of carbon, and alloy materials. These resistors generally have

resistance values that range from 1KΩ to 47 KΩ. Another kind of fixed resistor is the wire

wound type. The resistance element is usually made of nickel-chromium wire wound on a

ceramic rod. These resistors generally have resistance values that range from 1Ω to 100kΩ.

Variable resistorsVariable resistors are used to adjust the amount of resistance in a circuit. A variable resistor

consists of a sliding contact arm that makes contact with a stationary resistance element. As the

27 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

sliding arm moves across the element, its point of contact on the element changes, effectively

changing the length of the element. The rating of a variable resistor is its resistance at the

highest setting.

Variable resistors are also called as rheostats or potentiometers. The resistance elements of

rheostats are usually wire wound. They are most often used to control very high currents, such

as in motors and lamps. Potentiometers generally have composition elements. They are used as

control devices in radios, amplifiers, televisions, and electrical instruments.

Rating Tolerances

The actual resistance of a resistor may be greater or less than its indicated rating. The possible

range of variance from the indicated rating is called its tolerance.

Table 2.2 Tolerance Codes

PERCENTAGE COLOUR

+- 5% Gold

+- 10% Silver

+- 20% No Color

Resistance rating color code table

Composition resistors generally have four color bands. The color code is read as follows.

First, look up the number values of the first two bands on the table and combine the two

numbers.

Then multiply this two digit number by the value of the third band, the multiplier band.

The resulting number is the resistance value of the resistor in ohms.

The fourth band is the tolerance band. If the 4th band is gold, the resistor is guaranteed

to be within 5% of the rated value. If the 4th band is silver, it is guaranteed to be within

10%. If there is no 4th band, the resistor is guaranteed to be within 20% of the rated

value.

28 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig 2.4 Color Coding

29 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2.2.8 CAPACITOR

A Capacitor stores electric charge. It does not allow direct current to flow through it and it

behaves as if alternating current does flow through its simplest dielectric. A capacitor is

essentially two conductive plates, separated by an insulator (the dielectric). To conserve space,

the assembly is commonly rolled up, or consists of many small plates in parallel for each

terminal, each separated from the other by a thin plastic film. Capacitors come in two primary

versions- polarized and non-polarized. Polarized capacitors must have DC present at all times,

of the correct polarity and exceeding any AC that may be present on the DC polarizing voltage.

Reverse connection will result in the device failing, often in spectacular fashion, and sometimes

with the added excitement of flames, or high speed pieces of casing and electrolyte (an internal

fluid in many polarized capacitors).Capacitors are rated in Farads, and the standard symbol is

“C” or “F”, depending upon the context. A Farad is so big unit that capacitors are most

commonly rated in micro-Farads (µF).All capacitors have a voltage rating, and this must not be

exceeded. If a higher than rated voltage is applied, the insulation between the plates of the

capacitor breaks down, and an arc will often weld the plates together, short circuiting the

component. The “working voltage” is DC unless otherwise specified, and application of an

equivalent AC signal will probably destroy the capacitor.

Fig2.5 Capacitors

Types of Capacitors

1. Ceramic: These capacitors are usually used when extremely low values are needed. These

range in values from 1pF up to 100 no, but in some cases and styles this will vary. They are

commonly marked in pF (such as 100p), or a multiplier is used (such as 101, meaning 100pF-

10 plus one zero).

30 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

2. Plastic film: These are available in many different materials. Polyester is one of the most

popular capacitor types, and these combine predictable size (especially the MKT types) and

good performance.

3. Electrolytic: Used where large values are needed, these capacitors are (nearly) always

marked directly with the value in µF and the maximum voltage. Sometimes the maximum

temperature is also indicated. Electrodes are polarized and the negative terminal is marked

clearly on the case.

2.2.9 TRANSFORMER

31 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig 2.18 Transformer

A transformer is a device that transfers electrical energy from one circuit to another through

inductively coupled conductors — the transformer’s coils. A varying current in the first or

primary winding creates a varying magnetic field through the secondary winding. This varying

magnetic field induces a varying electromotive force (EMF) or “voltage” in the “secondary”

winding. This effect is called mutual induction.

If a load is connected to the secondary, an electric current will flow in the secondary winding

and electrical energy will be transferred from the primary circuit through the transformer to the

load. In an ideal transformer, the induced voltage in the secondary winding (VS) is in

proportion to the primary voltage (VP), and is given by the ratio of the number of turns in the

secondary (NS) to the number of turns in the primary (NP) as follows:

By appropriate selection of the ratio of turns, a transformer thus allows an alternating current

(AC) voltage to be “stepped up” by making NS greater than NP, or “stepped down” by making

NS less than NP.

In the vast majority of transformers, the coils are wound around a ferromagnetic core, air-core

transformers being a notable exception.

Transformers come in a range of sizes from a thumbnail-sized coupling transformer hidden

inside a stage microphone to huge units weighing hundreds of tons used to interconnect

portions of national power grids. All operate with the same basic principles, although the range

of designs is wide. While new technologies have eliminated the need for transformers in some

electronic circuits, transformers are still found in nearly all electronic devices designed for

32 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

household (“mains”) voltage. Transformers are essential for high voltage power transmission,

which makes long distance transmission economically practical.

Basic Principle

The transformer is based on two principles: firstly, that an electric current can produce a

magnetic field (electromagnetism) and secondly that a changing magnetic field within a coil of

wire induces a voltage across the ends of the coil (electromagnetic induction). Changing the

current in the primary coil changes the magnetic flux that is developed. The changing magnetic

flux induces a voltage in the secondary coil.

2.2.10 P.C.B. LAYOUT

33 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

The entire circuit can be easily assembled on a general purpose PCB board. Layout of desired

diagram and preparation is first and most important operation in any printed circuit board

manufacturing process. First of all layout of component side is to be made in accordance with

available components dimensions.

The following points are to be observed while forming the layout of PCB Between two components, sufficient space should be maintained.

High voltage/max. dissipated components should be mounted at sufficient distance from

semiconductors and electrolytic capacitors.

The most important points are that the component layout is making proper compromise

with copper side circuit layout.

Printed circuit boards (PCBs) are used to avoid most of all the disadvantages of

conventional breadboard. These also avoid the use of thin wires for connecting the

components; they are small in size and efficient in performance.

PREPARING CIRCUIT LAYOUT

First of all the actual size circuit layout is to be drawn on the copper side of the copper clad

board. Then enamel paint is applied on the tracks of connection with the help of a shade brush.

We have to apply the paints surrounding the point at which the connection is to be made. It

avoids the disconnection between the leg of the component and circuit track. After completion

of painting work, it is allowed to dry.

DRILLINGAfter completion of painting work, holes of 1/23 inch (1 mm) diameter are drilled at desired

points where we have to fix the components.

ETCHINGIt is kept so for the removal of excess of copper on the plate apart from the printed circuit is

known as etching. From this process the copper clad board with printed circuit is placed in the

solution of FeCl with 3-4 drops of HCl in about 10 to 15 minutes and is taken out when all the

excess copper is removed from the PCB. After etching, the PCB is kept in clean water for about

half an hour in order to get PCB away from acidic field, which may cause poor performance of

the circuit. After the PCB has been thoroughly washed, paint is removed by soft piece of cloth

34 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

dipped in thinner or turbine. Then PCB is checked as per the layout, now the PCB is ready for

use.

SOLDERINGSoldering is the process of joining two metallic conductors the joint where two metal

conductors are to be joined or fused is heated with a device called soldering iron and then as

allow of tin and lead called solder is applied which melts and converse the joint.

The solder cools and solidifies quickly to ensure is good and durable connection between the

jointed metal converting the joint solder also present oxidation.

SOLDERING & DESOLDERING TECHNIQUES

There are basically two soldering techniques:

Manual soldering with iron.

Mass soldering.

The iron consist of an insulated handle connected via a metal shank to the bit the

function of bit is to state host & convey it to the component.

Stare host & convey it to the component

To store and deliver molten solder 7 flux.

To remove surplus solder from joints.

35 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Soldering bit is made of copper because it has good heat capacity & thermal

conductivity. It may erode after long term use to avoid it coating of nickel or tin is used.

SOLDERING WITH IRON

The surface to be soldered must be cleaned & fluxed. The soldering iron switched on &

bellowed to attain soldering temperature. The solder in form of wire is allied hear the

component to be soldered and heated with iron. The surface to be soldered is filled, iron is

removed & the joint is cold without disturbing.

Solder joint are supposed to Provide permanent low resistance path

Make a robust mechanical link between PCB & leads of components.

Allow heat flow between component, joining elements & PCB.

Retain adequate strength with temperature variation.

Precautions

Use always an iron plated copper core tip for soldering iron.

Slightly for the tip with a cut file when it is cold.

Use a wet sponge to wipe out dirt from the tip before soldering instead of asking the

iron.

Tighten the tip screw if necessary before iron is connected to power supply.

Clean component lead & copper pad before soldering.

Use proper tool for component handling instead of direct handling.

Apply solder between component leads, PCB pattern & tip of soldering iron.

Iron should be kept in contact with the joint s for 2-3 second s only instead of keeping

for very long or very small time.

Use optimum quantity of solder.

Use multistoried wire instead of single strands solvent like isopropyl alcohol.

Every time soldering is over, put a little clean solder on the tip.

36 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CHAPTER 3CHAPTER 3

(CIRCUIT DIAGRAM AND WORKING) (CIRCUIT DIAGRAM AND WORKING)

37 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CIRCUIT DIAGRAM :-

38 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig 3.2 Power Supply

3.1 CIRCUIT DIAGRAM DESCRIPTION

39 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

Fig. shows the block diagram of the temperature indicator using microcontroller AT89C52. The power supply foe the circuit is regulated by IC 7805 and supplied to different parts of the unit. DS1621 is the temperature sensor chip. The microcontroller unit (MCU) reads the temperature from the sensor. The temperature data is compared with certain user defined temperature values and processed inside the MCU as per the program and then sent to the LCD for display.

Power supply

The power supply unit consists of a step-down transformer (230V AC primary to 0-9V, 250mA secondary), bridge rectifier and voltage regulator. The output of the transformer is fed to bridge rectifier diodes D1 through D4 (each IN 4007). The ripple from the output bridge rectifier is filtered by capacitor C1 and fed to regulator IC 7805. The regulated output is given to the temperature sensor, microcontroller unit and LCD module, respectively.

When switch S1 is closed, LED1 glows to indicate the presence of power in the system.

3.2 WORKING

40 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

The C-language program for microcontroller AT89C52 is compiled using cross-compiler C51 Version 7.10 from Keil Software. The demo version of this compiler is available for free on the Website ‘www.keil.com.’ It can compile programs up to 2 kB only, which is sufficient for writing most programs. For testing the display, the program Hello.c is given here. This program, when loaded to AT89C52, displays “Hello! How R U?” on the LCD. The Hello.c program has nothing to do with temperature. It just guarantees a perfect communication between the LCD and the microcontroller. For temperature indication, the program Temp52.c is used. The programs Hello.c and Temp52.c, along with the hex files, are given at the end of this article.

The communication interface between the temperature sensor and the microcontroller chip follows the I2C (Inter Integrated Circuit) standard, which is implemented in ‘C’ here. I2C is a simple master/slave type interface.Simplicity of the I²C system is primarily due to the bidirectional 2-wire (SDA and SCL) design and the protocol format.

Bidirectional communication is through 2- wire lines (which are either active-low or passive-high). In the program, the i2c_stop, i2c_start, i2c_write and i2c_read functions are used for communicating Clock and Data from DS1621 to P3.0 and P3.1 of AT89C52, respectively. Such functions as command, ready and display in the program are used for driving the LCD.

Keil C51 can compile C programs for most of the Atmel family microcontrollers. It also supports other devices.Unlike other cross-compilers (Hi-Tech, IAR, SDCC, etc), Keil C51 offers such features as fast code generation, strong multitasking environment, real-time operating system and inbuilt code optimisation.

To enjoy these features, you’ll need full version of the compiler.Keil C51 has options to generate Assembly code and all the code listing supported by 8051 family, but Assembly language generated cannot be recompiled on any other assembler.

As far as code generation is concerned, it uses minimum RAM and on-chip flash, allowing faster and optimised program in Intel-Hex format, which can be loaded to the microcontroller using any programmer. Conversion of C program into Intel-Hex format takes only a few seconds. In fact, you don’t require all that long Assembly program In order to generate the output hex file.

41 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

42 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CHAPTER 4 CHAPTER 4

(RESULT AND DISCUSSION) (RESULT AND DISCUSSION)

RESULT

With the hard work we are able to complete this project. While making this project we had

faced many difficulties. But we overcame all those problems and finally we got positive results.

This project is made to provide ease to human being.

43 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

PROBLEM FACED AND TROUBLESHOOTING

During the fitting of IC on PCB, programmed IC was lost.

During the fabrication in the etching no. of tracks got broken and to overcome this

Problem, we have made these tracks again by soldering the jumper wire.

Due to the problem of dry soldering we have soldered some components again.

PRECAUTIONS Care should be taken while soldering. There should be no shorting off joints.

Proper power supply should be maintained.

Project should be handled with care since IC is delicate.

44 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

CHAPTER 5CHAPTER 5

((CONCLUSION AND FUTURE PROSPECTSCONCLUSION AND FUTURE PROSPECTS))

COTRUSION COTRUSION

It also saves some auxiliary structure as well as the expenditure on attendant.

Temperature indication is easy . We know that though it is very beneficial

45 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

but it is also impossible to install such system at each and every places, but it

gives certainly a considerable benefit to us, thereby to our nation.

Troubleshooting1. Check the COM port on your PC beforeprogramming.2. In case there is no message even if

46 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

all the connections are correct, adjust theintensity control potentiometer (VR1) fordisplay.3. Check whether your hex filematches with the hex file given below inthe article.4. If the LCD shows wrong characters,replace it with another make LCD.5. If DS1621 is not connected properlyto AT89C52, the display will be completelyblank.

47 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

REFERENCES

REFERENCES REFERENCES

The books referred for completing this project report are as follows:-

48 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52

1. Kenneth J. Ayala (1997)” Penram. International Publishing Pvt. Ltd, Mumbai.

2. M.A.Mazidi& Robin D. McKinley (2006) Pearson education, New Delhi

WEB REFRENCES

The websites referred for completing this project report are as follows:-

http://www.alldatasheets.com

http://www.atmel.com

http://www.discovercircuits.com

http://www.google.com.(Google search microcontroller)

http://www.intel.com

http://www.wikipedia.org

http://www.yahoo.com.(yahoo search microcontroller)

49 PROJECT REPORT TEMPERATURE INDICATOR USING AT89C52