154164443 Digital Thermometer Using 8051 Microcontroller Project Report

Embed Size (px)

DESCRIPTION

thermometer

Citation preview

  • INDEX

    OBJECTIVE

    CIRCUIRT DESCRIPTION

    LIST OF COMPONENTS USED

    CIRCUIT DIAGRAM

    HARDWARE DETAILS OF 8051 CIRCUIT TRAINER

    COMPONENT DESCRIPTION LM35 Temperature Sensor AT89C51 Seven Segment Display ADC0804 741 op-amp Preset Resistors Transistor 2N2222 Capacitors

    DESIGN SPECIFICATIONS:

    1. Steps taken while preparing circuit: (A) PCB DESIGNING (B) P CB L AY OUT DE SIG N (C) ETCHING PROCESS (D) COMPONENT ASSEMBLY (E) SOLDERING

    2. Types of PCB:

    (A) SINGLE SIDED PCB (B) DOUBLE SIDED PCB (C) MULTI LAYER PCB

    PCB Manufacturing Process

    PRACTICAL APPLICATIONS

    CONCLUSION

  • OBJECTIVE:

    The objective of this project is to design a digital thermometer using 8051 microcontroller. Digital

    thermometer displays the ambient temperature through a LCD display. It consists of two sections.

    One is that which senses the temperature. This is a temperature sensor LM 35. The other section

    converts the temperature value into a suitable number in Celsius scale which is done by the

    ADC0804.

    CIRCUIRT DESCRIPTION:

    The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. LM35 is an analogue temperature sensor IC which can measure a temperature range of -55 to 150C. Its output voltage varies 10mV per C change in temperature.

    Celsius scale thermometer displays the ambient temperature through a LCD display. It consists of two sections. One is that which senses the temperature.

    This is a temperature sensor LM 35. The other section converts the temperature value into a suitable number in Celsius scale which is done by the ADC0804.

    A digital thermometer can be easily made by interfacing a temperature sensor to the microcontroller AT89C51. The temperature sensor used in the project isLM35. The LM 35 IC generates a 10mV variation to its output voltage for every degree Celsius change in temperature.

    The Output of the temperature sensor is analog in nature so we need an analog to digital convertor for converting the analog input to its equivalent binary output.

    ADC 0804 is an analog to digital convertor IC used in the project. 0804 is a single channel convertor which converts the analog input up to a range of 5V to an equivalent 8-bit binary output.

    The step size is defined by the voltage applied at the Vref/2 pin of the ADC IC. For example, if the voltage at Vref/2 pin is set to 1.28V then ADC has a step size of 10 mV. So if the input voltage is 1V the equivalent binary output of ADC will be 100 or 0110 0100 in binary.

    The 8 bit binary output of the ADC is incremented by one for every 10 mV rise of input voltage. Different step size can be selected by changing the voltage input to the Vref/2 pin. The step size of the ADC is calibrated using a preset to match the actual temperature.

    Once the ADC is calibrated it will give the correct output further. The binary output of ADC is fed parallel to a port of the microcontroller .The microcontroller reads the input through ADC and displays the corresponding decimal value on LCD indicating the temperature.

  • LIST OF COMPONENTS USED:

    LM35 Temperature Sensor

    AT89C51 Microcontroller Seven segment LED display

    ADC0804

    IC 741

    Potentiometer 200K

    Resistors:

    10k 3 8.2k 1 100 ohm 10

    Capacitors:

    150Pf 1

    10 micro f 1 2n2222 Transistors

  • CIRCUIT DIAGRAM:

  • HARDWARE DETAILS OF 8051 CIRCUIT TRAINER:

    On Board Features of 8051 Advance Trainer with P89V51RD2 Microcontroller:

    1. RS232 interface 2. 38KHZ RC5 IR receiver 3. Buzzer 4. Light Sensor (LDR) 5. Temperature Sensor 6. Three Analog Inputs via presets 7. All port open 89V51RD2 Microcontroller 8. Four 7-Segment Display 9. Real time clock with DS1307 10. EEPROM 24C256 11. Eight LEDs 12. Two Relays 13. Four Switches 14. Eight bit Analog to Digital Converter 15. Matrix keypad 4x4 16. Stepper Motor driver ULN2803 17. LCD 16 character by 2 lines 18. DC Motor Driver L293D

  • COMPONENT DESCRIPTION:

    LM35 Temperature Sensor:

    LM35 is a precision IC temperature sensor with its output proportional to the temperature (in oC). The sensor circuitry is sealed and therefore it is not subjected to oxidation and other processes. With LM35, temperature can be measured more accurately than with a thermistor. It also possess low self heating and does not cause more than 0.1 oC temperature rise in still air.

    The LM35 series are precision integrated-circuit LM35 temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 sensor does not require any external calibration or trimming to provide typical accuracies of C at room temperature and C over a full -55 to +150C temperature range.

    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.1C in still air. The LM35 is rated to operate over a -55 to +150C temperature range, while the LM35C sensor is rated for a -40 to +110C range (-10 with improved accuracy).

    Pin Diagram:

    Pin Description:

    Pin No

    Function Name

    1 Supply voltage; 5V (+35V to -2V) Vcc

    2 Output voltage (+6V to -1V) Output

    3 Ground (0V) Ground

  • AT89C51:

    AT89C51 is an 8-bit microcontroller and belongs to Atmel's 8051 family. ATMEL 89C51 has 4KB of Flash programmable and erasable read only memory (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000 times.

    In 40 pin AT89C51, there are four ports designated as P1, P2, P3 and P0. All these ports are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except P0 which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are written to these port pins, they are pulled high by the internal pull-ups and can be used as inputs. These ports are also bit addressable and so their bits can also be accessed individually.

    Pin Diagram:

    Pin Description:

    Pin No Function Name

    1

    8 bit input/output port (P1) pins

    P1.0

    2 P1.1

    3 P1.2

    4 P1.3

  • 5 P1.4

    6 P1.5

    7 P1.6

    8 P1.7

    9 Reset pin; Active high Reset

    10 Input (receiver) for serial communication

    RxD

    8 bit input/output port (P3) pins

    P3.0

    11 Output (transmitter) for serial communication

    TxD P3.1

    12 External interrupt 1 Int0 P3.2

    13 External interrupt 2 Int1 P3.3

    14 Timer1 external input T0 P3.4

    15 Timer2 external input T1 P3.5

    16 Write to external data memory Write P3.6

    17 Read from external data memory Read P3.7

    18 Quartz crystal oscillator (up to 24 MHz)

    Crystal 2

    19 Crystal 1

    20 Ground (0V) Ground

    21

    8 bit input/output port (P2) pins/High-order address bits when interfacing with external memory

    P2.0/ A8

    22 P2.1/ A9

    23 P2.2/ A10

    24 P2.3/ A11

    25 P2.4/ A12

    26 P2.5/ A13

    27 P2.6/ A14

    28 P2.7/ A15

    29 Program store enable; Read from external program memory PSEN

    30 Address Latch Enable ALE

    Program pulse input during Flash programming Prog

    31 External Access Enable; Vcc for internal program executions EA

    Programming enable voltage; 12V (during Flash programming) Vpp

    32

    8 bit input/output port (P0) pins Low-order address bits when interfacing with external memory

    P0.7/ AD7

    33 P0.6/ AD6

    34 P0.5/ AD5

    35 P0.4/ AD4

    36 P0.3/ AD3

    37 P0.2/ AD2

    38 P0.1/ AD1

    39 P0.0/ AD0

    40 Supply voltage; 5V (up to 6.6V) Vcc

  • Seven Segment Display:

    Pin Diagram:

    A seven segment display is the most basic electronic display device that can display digits from 0-9.

    They find wide application in devices that display numeric information like digital clocks, radio,

    microwave ovens, electronic meters etc.

    The most common configuration has an array of eight LEDs arranged in a special pattern to display

    these digits. They are laid out as a squared-off figure 8.

    Every LED is assigned a name from 'a' to 'h' and is identified by its name. Seven LEDs 'a' to 'g' are

    used to display the numerals while eighth LED 'h' is used to display the dot/decimal.

    A seven segment is generally available in ten pin package. While eight pins correspond to the eight

    LEDs, the remaining two pins (at middle) are common and internally shorted.

    These segments come in two configurations, namely, Common cathode (CC) and Common anode

    (CA).In CC configuration, the negative terminals of all LEDs are connected to the common pins. The

    common is connected to ground and a particular LED glows when its corresponding pin is given high.

    In CA arrangement, the common pin is given a high logic and the LED pins are given low to display a

    number.

  • ADC0804: ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel IC. The digital outputs vary from 0 to a maximum of 255. ADC0804 needs a clock to operate. The time taken to convert the analog value to digital value is dependent on this clock source. An external clock can be given at the Clock IN pin.

    Pin Diagram:

    Pin Description:

    Pin No Function Name

    1 Activates ADC; Active low Chip select

    2 Input pins Read

    3 Input pin; Low to high pulse is given to start the conversion Write

    4 Clock Input pin; to give external clock. Clock IN

    5 Output pin; Goes low when conversion is complete Interrupt

    6,7 Analog non-inverting input & Analog inverting Input. Vin(+) & Vin(-)

    8 Ground(0V) Analog Ground

    9 Input pin; sets the reference voltage for analog input Vref/2

    10 Ground(0V) Digital Ground

    11to18 8 bit digital output pins D7 to D0

    19 Used with Clock IN pin when internal clock source is used Clock R

    20 Supply voltage; 5V Vcc

  • 741 op-amp:

    The 741 is a versatile op-amp IC. Commonly available 741 is an eight pin dual-in-line package op-

    amp IC. It has only a single op-amp module inside it and it requires dual-power supply.

    Pin-outs:

    The pin-out of the 741 op-amp is shown below. Pin 2 & 3 are input pins and pin 6 is the output pin.

    Pin 4 & 7 are provided for dual-power supply.

    Pin-out of 741

    An op-amp is supposed to have zero output voltage whenever the input difference voltage is zero.

    But practically this is hard to achieve, because of certain current mismatch at the input terminals. The

    741 has two terminals for setting the output voltage to zero, when the input voltage is zero. The pins

    provided for this function are called offset null. Among the input pins, the pin2 is called inverting input

    and the pin3 is called non-inverting input.

  • Preset:

    A preset is a three legged electronic component which can be made to offer varying resistance in a

    circuit. The resistance is varied by adjusting the rotary control over it.The resistance does not vary

    linearly but rather varies in exponential or logarithmic manner. Such variable resistors are commonly

    used for adjusting sensitivity along with a sensor.The variable resistance is obtained across the single

    terminal at front and one of the two other terminals. The two legs at back offer fixed resistance which

    is divided by the front leg. So whenever only the back terminals are used, a preset acts as a fixed

    resistor. Presets are specified by their fixed value resistance.

    Working of presets is quite simple. It works by having a resistive track and a small plate having dents

    to short the track. This small plate can be rotated using a screw driver or some similar tool. Position of

    the dents on the track determines the amount of resistance that is to be used in the circuit.

    Pin Diagram:

  • RESISTORS:

    Resistor is a passive component used to control current in a circuit. Its resistance is given by the ratio of voltage applied across its terminals to the current passing through it. Resistors can be either fixed or variable. Negative temperature coefficient (NTC), positive temperature coefficient (PTC) and light dependent resistor (LDR) are some such resistors. These special resistors are commonly used as sensors. Read and learn about internal structure and working of a resistor.

    Pin Diagram:

    How to Read Resistor Color Coding Scheme:

    The resistor color code is always read one band at a time starting from left to the right, with the larger width tolerance band oriented to the right side indicating its tolerance. By matching the color of the first band with its associated number in the digit column of the color chart below, the first digit is identified and this represents the first digit of the resistive value. The second digit of the resistance is obtained by matching again the color of the second band with its associated number in the digit column of the color chart. The tolerance band is usually gold or silver but some may have none.

    Transistor 2N2222:

    Pin Diagram:

    2N2222 is an NPN BJT transistor. It is used for general purpose low-power amplification and

    switching applications. These are designed for high speed switching application at collector current

    up to 800mA.It provides useful current gain over a wide range of collector current.

    Other features include, low leakage currents and low saturation voltage. 2N2222A is another variant

    with improved characteristics. The emitter leg of 2N2222 is indicated by a protruding edge in the

    transistor case.

  • CAPACITORS:

    A capacitor is a passive two terminal component which stores electric charge. This component consists of two conductors which are separated by a dielectric medium. The potential difference when applied across the conductors polarizes the dipole ions to store the charge in the dielectric medium. The circuit symbol of a capacitor is shown below:

    Pin Diagram:

    As you turn on the power supply, the current begins to flow through the capacitor inducing the

    positive and negative potentials across its plates. The capacitor continues to charge until the

    capacitor voltage equalizes up to the supply voltage which is called as the charging phase of the

    capacitor. Once the capacitor is fully charged at the end of this phase, it gets open circuited for DC. It

    begins to discharge when the power of the capacitor is switched off. There are different types of

    capacitors. The symbol of capacitors from each group is shown below:

  • DESIGN SPECIFICATIONS:

    1. Steps taken while preparing circuit:

    (A) PCB DESIGNING:

    The ma in pu rpose o f p r in ted c i r cu i t i s i n the r ou t ing o f e lec t r i c cu r ren ts and s igna l t h r o u g h a t h i n c o p p e r l a y e r t h a t i s b o u n d e d f i r m l y t o a n i n s u l a t i n g b a s e m a t e r i a l sometimes called the substrate. This base is manufactured with an integrally bounded layer of thin copper foil, which has to be partly etched or removed to arrive at a pre-designed pattern to suit the circuit connections, or other applications as required. The term printed circuit board is derived from the original method where a printed pattern is used as the mask over wanted areas of copper. The PCB provides an ideal baseboard upon which to assemble and hold firmly most of the small components. From the constructors point of view, the main attraction of using PCB is its role as the mechanical support for small components. There is less need for complicated and time-consuming metal work of chassis contraception except perhaps in providing the final enclosure. Most straight forward circuit designs can be easily converted in to printed w i r ing laye r t he though t requ i red to car ry ou t the invers ion cab foo ted h igh l i gh t an possible error that would otherwise be missed in conventional point to point wiring .The finished project is usually neater and truly a work of art. Actual size PCB layout for the circuit shown is drawn on the copper board. The board is then immersed in FeCl3 solution for 12 hours. In this process only the exposed copper portion is etched out by the solution. Now the petrol washes out the paint and the copper layout on PCB is rubbed with asmooth sand paper slowly and lightly such that only the oxide layers over the Cu areremoved. Now the ho les a re d r i l l ed a t the respect i ve p laces acco rd ing to component layout as shown in figure. (B) P CB LAY OU T DESI G N :

    W hen des ign ing the layou t one shou ld obse rve the m in imum s ize (component body l e n g t h a n d w e i g h t ) . B e f o r e s t a r t i n g t o d e s i g n t h e l a y o u t w e n e e d a l l t h e r e q u i r e d components in hand so that an accurate assessment of space can be made. Other space considerations might also be included from case to case of mounted components over the printed circuit board or to access path of present components. It might be necessary to turn some components around to a different angular position so that terminals are closer to the connections of the components. The scale can be checked by positioning the components on the squared paper. If any connection crosses, then one can reroute to avoid such condition. All common or earth lines should ideally be connected to a common line routed around the perimeter of the layout. This will act as the ground plane. If possible try to route the outer supply line to the ground plane. If possible try to route the other supply lines around the opposite edge of the layout through the centre. The first set is tearing the circuit to eliminate the crossover without altering the circuit detail in any way.

  • Plan the layou t l ook ing a t the tops ide to th is boa rd . F i rs t th i s shou ld be t rans la ted inversely; later for the etching pattern large areas are recommended to maintain good copper adhesion. It is important to bear in mind always that copper track width must be according to the recommended minimum dimensions and allowance must be made for increased width where termination holes are needed. From this aspect, it can become little tricky to negotiate the route to connect small transistors. There are basically two ways of copper interconnection patterns underside the board. The first is the removal of only the amount of copper necessary to isolate the junctions of the components to one another. The second is to make the interconnection pattern looking more like conventional point wiring by routing uniform width of copper from component to component. (C) ETCHING PROCESS:

    Etching process requires the use of chemicals. Acid resistant dishes and running water supp ly . Fer r i c ch lo r ide is most l y used so lu t ion bu t o the r e tch ing mate r ia ls such as ammonium per sulphate can be used. Nitric acid can be used but in general it is not used due to poisonous fumes. The pattern prepared is glued to the copper surface of the board using a latex type of adhesive that can be cubed after use. The pattern is laid firmly on the copper using a very sharp knife to cut round the pattern carefully to remove the paper corresponding to the required copper pattern areas. Then apply the resistant solution, which can be a kind of ink solution for the purpose of maintaining smooth clean outlines as far as possible. While the board is drying, test all the components. Be fo re go ing to nex t s tage , check the who le pa t te rn and c ross check w i th the c i rcu i t diagram. Check for any free metal on the copper. The etching bath should be in a glass or enamel disc. If using crystal of ferric- chloride these should be thoroughly dissolved in water to the proportion suggested. There should be 0.5 lt. of water for 125 gm of crystal. To prevent particles of copper hindering further etching, agitate the solutions carefully by gently twisting or rocking the tray. The board should not be left in the bath a moment longer than is needed to remove just t h e r i g h t a m o u n t o f c o p p e r . I n s p i t e o f t h e r e b e i n g a r e s i s t i v e c o a t i n g t h e r e i s n o protection against etching away through exposed copper edges. This leads to over etching. Have running water ready so that etched board can be removed properly and rinsed. This will halt etching immediately. Drilling is one of those operations that call for great care. For most purposes a 0.5mmdrill is used. Drill all holes with this size first those that need to be larger can be easily drilled again with the appropriate larger size. (D) COMPONENT ASSEMBLY:

    From the greatest variety of electronic components available, which runs into thousands of different types it is often a perplexing task to know which is right for a given job. There cou ld be damage such as ha i r l ine c rack on PCB. I f the re a re , then they can be repaired by soldering a short link of bare copper wire over the affected part. The most popular method of holding all the items is to bring the wires far apart after they have been inserted in the appropriate holes. This will hold the component in position ready for soldering.

  • Some components will be considerably larger .So it is best to start mounting the smallest first and progressing through to the largest. Before starting, be certain that no further drilling is likely to be necessary because access may be impossible later. Next will probably be the resistor, small signal diodes or other similar size components. Some capacitors are also very small but it would be best to fit these afterwards. When fitting each group of components mark off each one on the circuit as it is fitted so that if we have to leave the job we know where to recommence. Although transistors and integrated circuits are small items there are good reasons for leaving the soldering of these until the last step. The main point is that these components are very sensitive to heat and if subjected to prolonged application of the soldering iron, they could be internally damaged. All the components before mounting are rubbed with sand paper so that oxide layer is removed from the tips. Now they are mounted according to the component layout. (E) SOLDERING :

    This is the operation of joining the components with PCB after this operation the circuit will be ready to use to avoid any damage or fault during this operation following care must be taken. A l o n g e r d u r a t i o n c o n t a c t b e t w e e n s o l d e r i n g i r o n b i t & c o m p o n e n t s

    l e a d c a n exceed the temperature rating of device & cause partial or total damage of the device. Hence before soldering we must carefully read the maximum soldering temperature & soldering time for device.

    The wat tage o f so lde r ing i ron shou ld be se lec ted as m in imum as pe rmiss ib le fo r that soldering place

    T o p r o t e c t t h e d e v i c e s b y l e a k a g e c u r r e n t o f i r o n i t s b i t s h o u l d b e e a r t h e d properly.

    W e shou ld se lec t t he so lde r ing w i re w i th p rope r ra t io o f Pb & Tn to p rov ide the suitable melting temperature.

    P rope r amoun t o f good qua l i t y f lux mus t be app l ied on the so lde r ing po in t to avoid dry soldering.

    2. Types of PCB: PCBs can be divided into three main categories: Single Sided. Double Sided. Multi Layered. SINGLE SIDED PCB:

    A single sided PCB contains copper tracks on one side of the board only. Holes are drilled at appropriate points on the track so that each component can be inserted from the non copper side of the board. Each pin is soldered to the copper track.

    DOUBLE SIDED PCB: Double sided PCBs have copper tracks on both sides of the board. The track layout is designed so as not to allow shorts from one side to another. If it is required to link points between the two sides, electrical connections are made by small interconnecting holes which are placed with copper during manufacture.

  • MULTI LAYER PCB: In multi layer PCBs, each side contains several layers of track patterns which are insulated from one another. They are laminated under heat and high pressure.

    PCB Manufacturing Process:

    It is an important process in the design of electronic equipment. The design of PCBs (Printed Circuit Boards) depends on circuit requirements like noise immunity, working frequency and voltage levels etc. High power PCBs requires a special design strategy.

    The fabrication process to the printed circuit board will determine to a large extent the price and reliability of the equipment. A common target aimed is the small series of highly reliable professional quality PCBs with low investment.

    The layout of PCB has to incorporate all the information of the board before one can go on the artwork preparation. This means that a concept that clearly defines all the details of the circuit and partly defines the final equipment is prerequisite before the actual layout can start. The detailed circuit diagram is very important for the layout designer but he must also be familiar with the design concept and with the philosophy behind the equipment.

    PRACTICAL APPLICATIONS:

    Common applications for digital thermometers include:

    Medicine: Digital thermometers are often used in clinical settings on patients. HVAC thermometers are rated for HVAC applications such as duct or flume monitoring. Laboratory use includes monitoring experiments and chemical reactions as well as

    maintaining an optimal laboratory environment. Meteorological thermometers are used to give air, atmosphere and water temperature

    readings.

    CONCLUSION:

    The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. It consists of two sections. One is that which senses the temperature i.e. LM 35. The other section converts the temperature value into a suitable number in Celsius scale which is done by the ADC0804.

    A digital thermometer can be easily made by interfacing a temperature sensor to the microcontroller AT89C51.The LM 35 IC generates a 10mV variation to its output voltage for every degree Celsius change in temperature. The Output of the temperature sensor is analog in nature so we need an analog to digital convertor for converting the analog input to its equivalent binary output.ADC 0804 is an analog to digital convertor IC used in the project. 0804 is a single channel convertor which converts the analog input up to a range of 5V to an equivalent 8-bit binary output.

    ___________________________