tEMPERATURE MONITORING Using AT89C51

1. INTRODUCTION

 

1.1 Context

 

This project explains about a simple low cost circuit which can be mainly used in large scale industries to detect the high temperature and take immediate measures. This circuit is used to sense the temperature at a place. It indicates the temperature on the 7 Segment Display with the help of microcontroller. This circuit makes use of SL100 which is a 3 pin centigrade temperature sensor IC. It directly senses the temperature and sends the data to the controller.

The complete project is built around the 8051 micro controller. PCB Wizard Schematic generation software is employed to prepare the schematic for development of project. Hardware is built according to schematic prepared by soldering each component on the general purpose PCB. Source code is developed using Keil micro vision software. μVision is an IDE (Integrated

Development Environment) that helps we write, compile, and debug embedded programs. The written source code is dumped into the microcontroller IC using a Programmer. To dump the code into microcontroller micro C Flash software is used.

 

1.2 Resolve

          The industries in which Temperature plays a major role, needs thousands of degree centigrade of temperature. In such industries, it is impossible for a normal human being to enter and check the temperature. So by using this Temperature Monitoring system we can solve the problem. Here we use transmitter and receiver. Transmitter will be kept where the temperature has to measure and the receiver is kept in a monitor room. If any changes occur in the temperature, the sensor placed in the transmitter section will sense it and pass it to the receiver section.

 

 

 

 

 

 

1.3 Scope of the project

  • This project is developed in order to help the Industrialist to know the correct temperature of a particular room or a big furnace without any difficulties and not even entering into the room.
  • Based on the responses and reports obtained as a result of the significant development in the working system in INDUSTRIES, this project can be further extended to meet the demands according to situation.
  • This can be further implemented, so that the temperature can be controlled, if it exceeds the limit by providing large fans etc. Thus becomes the user friendliness.
  • Additional modules can be added without affecting the remaining modules. This allows the flexibility and easy maintenance of the developed system.

This system consists of following features over manual system:

  • There is no time lag to operate the device.
  • Accuracy.

 

 

 

 

 

 

 

 

 

 

 

 

2. Block Diagram

2.1 Overview

 

 

 

 

 

  Microcontroller

 

Power supply

 

 

Temperature sensor

 

LM324

 

 

 

ADC 0809

 

 

555 timers

 

7 Segment display

 

Crystal oscillator

 

 

 

 

 

 

 

 

 

 

 

 

 

 

                                                                               

Block Diagram of Temperature Monitoring System

Description

This project uses AT89C51 microcontroller for programming and operation The block diagram of temperature monitoring system consists of temperature sensor, ADC, microcontroller and 7 Segment Display. SL100 is used as temperature sensor it senses the temperature. The output of Temperature sensor is in the form of analog signal. ADC0809 is used to convert this analog signal to digital. The output of ADC is given to the Microcontroller. The output of controller will be displayed on the 7 Segment Display. It also consists of the power supply, which is of single-phase 230V ac. This should be given to step down transformer to reduce the 230V ac voltage to lower value. i.e., to 12V ac this value depends on the transformer inner winding. The output of the transformer is given to the rectifier circuit. This rectifier converts ac voltage to dc voltage. But the voltage may consist of ripples or harmonics.

To avoid these ripples, the output of the rectifier is connected to filter. The filter thus removes the harmonics. This is the exact dc voltage of the given specification. But the controller operates at 5V dc. So the regulator is required to reduce the voltage. Regulator 7805 produces 5V dc.

Here the microcontroller gets activated when power supply is given to it. Then the temperature will sense the temperature and sends the output in form of analog to ADC 0809. As the microcontroller does not accept analog inputs so we are using A to D converter. There it converts into digital from analog signals. The resultant output will be displayed on the 7 Segment display.

 

 

 

 

 

 

 

 

 

 

 

 

 

3.  Survey of Literature

            Here this project consists of Microcontroller, sensor, A to D converter, 7 Segment Display and Op amp LM 324, 555 timers and crystal oscillator.

 

3.1 Microcontroller

Introduction

            A Micro controller consists of a powerful CPU tightly coupled with memory, various I/O interfaces such as serial port, parallel port timer or counter, interrupt controller, data acquisition interfaces-Analog to Digital converter, Digital to Analog converter, integrated on to a single silicon chip.

            If a system is developed with a microprocessor, the designer has to go for external memory such as RAM, ROM, EPROM and peripherals. But controller is provided all these facilities on a single chip. Development of a Micro controller reduces PCB size and cost of design.

One of the major differences between a Microprocessor and a Micro controller is that a controller often deals with bits not bytes as in the real world application.

 Intel has introduced a family of Micro controllers called the MCS-51.

 

The Major Features:

  • Compatible with MCS-51 products
  • 4k Bytes of in-system Reprogrammable flash memory
  • Fully static operation: 0HZ to 24MHZ
  • Three level programmable clock
  • 128 * 8 –bit timer/counters
  • Six interrupt sources
  • Programmable serial channel
  • Low power idle power-down modes

 

 

 AT89C51 is 8-bit micro controller, which has 4 KB on chip flash memory, which is just sufficient for our application. The on-chip Flash ROM allows the program memory to be reprogrammed in system or by conventional non-volatile memory Programmer. Moreover ATMEL is the leader in flash technology in today’s market place and hence using AT 89C51 is the optimal solution.

 

3.2 AT89C51 MICROCONTROLLER ARCHITECTURE

The 89C51 architecture consists of these specific features:

  • Eight –bit CPU with registers A (the accumulator) and B
  • Sixteen-bit program counter (PC) and data pointer (DPTR)
  • Eight- bit stack pointer (PSW)
  • Eight-bit stack pointer (Sp)
  • Internal ROM or EPROM (8751) of 0(8031) to 4K (89C51)
  • Internal RAM of 128 bytes
  • Thirty –two input/output pins arranged as four 8-bit ports:p0-p3
  • Two 16-bit timer/counters: T0 and T1
  • Full duplex serial data receiver/transmitter: SBUF
  • Control registers: TCON, TMOD, SCON, PCON, IP, and IE
  • Two external and three internal interrupts sources.
  • Oscillator and clock circuits.

 

Why AT89C51?

          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, 8-bit micro controller satisfactorily serves the above application. Using an inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive market place.

            Coming to the question of why to use AT89S52 of all the 8-bit microcontroller available in the market the main answer would be because it has 8 Kb on chip flash memory which is just sufficient for our application. The on-chip Flash ROM allows the program memory to be reprogrammed in system or by conventional non-volatile memory Programmer. Moreover ATMEL is the leader in flash technology in today’s market place and hence using AT 89S52 is the optimal solution.

 

3.3 Types of memory:

The 89C51 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 89C51 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 4K 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 89C51 have a bank of 128 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 89C51 is reset, this memory is cleared. 128 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 128 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 7Fh. The user may make use of these variables with commands such as SETB and CLR.

            Flash memory is a nonvolatile memory using NOR technology, which allows the user to electrically program and erase information. Flash memory is used in digital cellular phones, digital cameras, LAN switches, PC Cards for notebook computers, digital set-up boxes, embedded controllers, and other devices.

3.4 Pin Diagram

 

Pin diagram of AT89C51

Pin Description:

VCC: Supply voltage.

GND: Ground.

Port 0: Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1’s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may 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.

Port 1: Port 1 is an 8-bit bi-directional 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. Port 1 also receives the low-order address bytes during Flash programming and verification.

Port 2: Port 2 is an 8-bit bi-directional 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 3: Port 3 is an 8-bit bi-directional 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 AT89C51 as listed below:

 

Port pins and their alternate functions

 

 

RST: Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG: Address Latch Enable 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/6the 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 micro controller is in external execution mode.

PSEN: Program Store Enable is the read strobe to external program memory. When the AT89C51 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/VPP: External 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, for parts that require 12-volt VPP.

XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2: Output from the inverting oscillator amplifier.

 

 

3.5 Oscillator Characteristics

                 XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier, which can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed.

 

3.6 Applications

                The AT89C51 application is an implementation of a moving display. This application was selected for its simplicity and ability to show graphically the results of in-circuit re programming. The text to be displayed is programmed into the controller as part of its firmware, and cannot be changed without reprogramming the device.0287D-B–9/97.

 The Microcontroller can be applicable in the following fields:

  1.  Instrumentation.

  2.  Handheld Devices.

  3.  Communication Systems.

  4.  Control Systems.

  5.  Peripheral Controllers.

  6.  Process Control Systems.

 

 

 

 

4. Sensor

            For sensing the temperature of the given device or an element for ex: Oil, Core, Motor body etc., a sensor has to be chosen based on the following requirements.

1. Sensitivity and accuracy.

           2. TemperatureRange

           3. Desired life of sensor

           4. Budget

             In the prototype module for the simulation purpose ‘SL100’ transistor is used as sensor because semiconductor temperature sensors are best suited for embedded applications as they tend to be electrically and mechanically more delicate than other temperature sensor types. The range of the sensor used in the project is -75 degree centigrade to +175 degree centigrade.

 

 

SL100

 

        In general silicon temperature sensors resistance is given by the equation

        R= Rr (1+a (T-Tr)+b (T-Tr) 2-c (T-Ti) d); where

        Rr–>Resistance at temperature Tr;

 a, b, c –>constants.

 Ti–>inflection point temperature resistance, such that c=0 for T<Ti. Also resistance is dependent to some extent on the excitation current.

  In the present module, as the resistance property of the transistor cannot be used directly for interfacing, this transistor is employed as a feedback element in the following configuration.

                 Let Rf be the resistance offered by the sensor under normal conditions (i.e   at S.T.P). The first stage is configured in Non-inverting amplifier mode, whose output voltage is given by

Vo1=Vi1 (1+Rf /R1)(Rb+Ry/ (Ra+Rb+P)) -(1)

P= Px+Py;

The second stage is designed as summing amplifier whose output is given by (Using superposition Principle)

 Vo=-V01 (Rf2/R1) + Vi2 (R4/R3+R4) (1+Rf2/R2)

Substituting the value of Vo1 from eq (1) in eq (2) we get

Vo=Vi [1+Rf/R1] [Rb+Py/Ra+Rb+P] [Rf2/R2] + Vi2 (R4/R3+R4) (1+Rf2/R2)

Vo=-Vi1 Rx (1+Rf/R1) + Vi2Ry      – (2)

As Temperature increases Rf decreases and so from above equation (2) it can be concluded that “Vo increases with Temperature”. After fabricating the circuit as per above configuration and with the resistor values as specified in list of components, it is experimentally observed that the output voltage is increasing by 10mv for each degree rise in temperature, after room temperature. The initial output voltage can be to desired value by varying preset ‘P’.

 The Transistor junction (Base& emitter or Base& collector) characteristics are depending upon the temperature. For a transistor, the maximum average power that it can dissipate is limited by the temperature that collector base junction can with stand. Therefore, maximum allowable junction temperature should not be exceeded. The average power dissipated in collector circuit is given by the average of the product of the collector current and collector baser voltage. At any other temperature the de-rating curves are supplied by the manufacturer to calculate maximum allowable power (Pj). Where TC is case temperature, Tj is temperature and Qj is the thermal 4resistance.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5. LM324

5.1 Pin diagram

The LM324 integrated circuit is a quad operational amplifier (Op-Amp). The device has four individual Op-Amp circuits housed in a single package.

                                                  

 

LM324 Pin Diagram

 

 

 

5.2 Pin Descriptions

V+                                =         Supply voltage.

GND                            =         Gnd (0V) connection for supply voltage.

Input(s)                       =          Input to Op-Amp.

Output                         =          Output of Op-Amp.

5.3 Characteristics

  • Operating voltage                  =       3.0V to 32V
  • Max supply current                =       1.2mA @ 5V operating voltage.

                                                                     3.0mA @ 30V operating voltage.

  • High level output voltage       =       3.5V @ 5V operating voltage.

                                                                     28V @ 30V operating voltage.

  • Max output current                 =       40mA @ 30V operating voltage.
  • Operating Temperature           =       0°C to 70°C

 

 

 

 

 

 

 

5.4 Non Inverting Amplifier

 

 

This is a very simple non inverting amplifier circuit. The output (Vout) of the amplifier is given by:

Vout = Vin x Gain of the amplifier

The Gain of the amplifier is given by:

Gain = 1 + (R2 / R1)

A graph of Vin vs Vout is shown above right.

Note: The output of the amplifier can not exceed the supply voltage. This is shown by the flattening of the graph near V+ above.

Typical values for R1 would be 10Kohm and for R2 would be 1Mohm. This would result in a gain of 101.

 

 

 

5.5 Comparator with Hysteresis

 

 

       A comparator circuit is used to compare a signal to a defined reference voltage. In the above circuit, when Vin is lower than Vref the output will below (GND). When Vin in is greater than Vref the output will switch to a high state (V+). This is shown by the graph above right.

Hysteresis is used to ensure a clean transition when the Vin is crosses the reference voltage. Without it the output could bounce on, off, on, off, etc between the two possible output levels. Hysteresis is the amount by which theVin signal, once it has caused the output to switch, would have to change inthe opposite direction (high or low) to result in Vout switching back.

The resistors R1 and R2 provide the hysteresis function. The amount of hysteresis is given by:

dV = V+ x (R1/R2)

Typical values for R1 would be 10Kohm and for R2 would be 1Mohm. This would result in a dV of 0.01V.

 

 

 

 

 

 6. 555 Timers

The 555 timer IC is an amazingly simple yet versatile device. It has been around now for many years and has been reworked into a number of different technologies. The two primary versions today are the original bipolar design and the more recent CMOS equivalent. These differences primarily affect the amount of power they require and their maximum frequency of operation; they are pin-compatible and functionally interchangeable.

This page contains only a description of the 555 timer IC itself. Functional circuits and a few of the very wide range of its possible applications will be covered in additional pages in this category.

6.1 Internal structure

 

                                                                 555 timers

The figure to the right shows the functional block diagram of the 555 timer IC. The IC is available in either an 8-pin round TO3-style can or an 8-pin mini-DIP package. In either case, the pin connections are as follows:

  • Ground.
  • Trigger input.
  • Output.
  • Reset input.
  • Control voltage.
  • Threshold input.
  • Discharge.
  • +Vcc +5V to +15V in normal use.

6.2 Operation

The operation of the 555 timer revolves around the three resistors that form a voltage divider across the power supply, and the two comparators connected to this voltage divider. The IC is quiescent so long as the trigger input (pin 2) remains at +VCC and the threshold input (pin 6) is at ground. Assume the reset input (pin 4) is also at +VCC and therefore inactive, and that the control voltage input (pin 5) is unconnected. Under these conditions, the output (pin 3) is at ground and the discharge transistor (pin 7) is turned on, thus grounding whatever is connected to this pin.

The three resistors in the voltage divider all have the same value (5K in the bipolar version of this IC), so the comparator reference voltages are 1/3 and 2/3 of the supply voltage, whatever that may be. The control voltage input at pin 5 can directly affect this relationship, although most of the time this pin is unused.

The internal flip-flop changes state when the trigger input at pin 2 is pulled down below +VCC/3. When this occurs, the output (pin 3) changes state to +VCC and the discharge transistor (pin 7) is turned off. The trigger input can now return to +VCC; it will not affect the state of the IC.

However, if the threshold input (pin 6) is now raised above (2/3)+VCC, the output will return to ground and the discharge transistor will be turned on again. When the threshold input returns to ground, the IC will remain in this state, which was the original state when we started this analysis.

The easiest way to allow the threshold voltage (pin 6) to gradually rise to (2/3)+VCC is to connect it to a capacitor being allowed to charge through a resistor. In this way we can adjust the R and C values for almost any time interval we might want.

The 555 can operate in either monostable or astable mode, depending on the connections to and the arrangement of the external components. Thus, it can either produce a single pulse when triggered, or it can produce a continuous pulse train as long as it remains powered.

 

Internal diagram of 555 timer (a)

In monostable mode, the timing interval, t, is set by a single resistor and capacitor, as shown to the right. Both the threshold input and the discharge transistor (pins 6 & 7) are connected directly to the capacitor, while the trigger input is held at +VCC through a resistor. In the absence of any input, the output at pin 3 remains low and the discharge transistor prevents capacitor C from charging.

When an input pulse arrives, it is capacitive coupled to pin 2, the trigger input. The pulse can be either polarity; its falling edge will trigger the 555. At this point, the output rises to +VCC and the discharge transistor turn off. Capacitor C charges through R towards +VCC. During this interval, additional pulses received at pin 2 will have no effect on circuit operation.

The standard equation for a charging capacitor applies here: e = E(1 –  (-t/RC)). Here, “e” is the capacitor voltage at some instant in time, “E” is the supply voltage, VCC, and ” ” is the base for natural logarithms, approximately 2.718. The value “t” denotes the time that has passed, in seconds, since the capacitor started charging.

We already know that the capacitor will charge until its voltage reaches (2/3)+VCC, whatever that voltage may be. This doesn’t give us absolute values for “e” or “E,” but it does give us the ratio e/E = 2/3. We can use this to compute the time, t, required to charge capacitor C to the voltage that will activate the threshold comparator:

2/3 = 1 – (-t/RC)

-1/3 = – (-t/RC)

1/3 = (-t/RC)

ln(1/3) = -t/RC

-1.0986123 = -t/RC

t = 1.0986123RC

t = 1.1RC

The value of 1.1RC isn’t exactly precise, of course, but the round off error amounts to about 0.126%, which is much closer than component tolerances in practical circuits, and is very easy to use. The values of R and C must be given in Ohms and Farads, respectively, and the time will be in seconds. We can scale the values as needed and appropriate for our application, provided we keep proper track of our powers of 10. For example, if we specify R in mega ohms and C in microfarads, t will still be in seconds. But if we specify R in kilo ohms and C in microfarads, t will be in milliseconds. It’s not difficult to keep track of this, but we must be sure to do it accurately in order to correctly calculate the component values we need for any given time interval.

The timing interval is completed when the capacitor voltage reaches the (2/3)+VCC upper threshold as monitored at pin 6. When this threshold voltage is reached, the output at pin 3 goes low again, the discharge capacitor (pin 7) is turned on, and the capacitor rapidly discharges back to ground once more. The circuit is now ready to be triggered once again.

 

Internal diagram of 555 timer (b)

If we rearrange the circuit slightly so that both the trigger and threshold inputs are controlled by the capacitor voltage, we can cause the 555 to trigger itself repeatedly. In this case, we need two resistors in the capacitor charging path so that one of them can also be in the capacitor discharge path. This gives us the circuit shown to the left.

In this mode, the initial pulse when power is first applied is a bit longer than the others, having a duration of 1.1(Ra + Rb)C. However, from then on, the capacitor alternately charges and discharges between the two comparator threshold voltages. When charging, C starts at (1/3)VCC and charges towards VCC. However, it is interrupted exactly halfway there, at (2/3)VCC. Therefore, the charging time, t1, is -ln(1/2)(Ra + Rb)C = 0.693(Ra +  Rb)C.

When the capacitor voltage reaches (2/3)VCC, the discharge transistor is enabled (pin 7), and this point in the circuit becomes grounded. Capacitor C now discharges through Rb alone. Starting at (2/3)VCC, it discharges towards ground, but again is interrupted halfway there, at (1/3)VCC. The discharge time, t2, then, is -ln(1/2)(Rb)C = 0.693(Rb)C.

The total period of the pulse train is t1 + t2, or 0.693(Ra + 2Rb)C. The output frequency of this circuit is the inverse of the period, or 1.44/(Ra + 2Rb)C.

Note that the duty cycle of the 555 timer circuit in astable mode cannot reach 50%. On time must always be longer than off time, because Ra must have a resistance value greater than zero to prevent the discharge transistor from directly shorting VCC to ground. Such an action would immediately destroy the 555 IC.

One interesting and very useful feature of the 555 timer in either mode is that the timing interval for either charge or discharge is independent of the supply voltage, VCC. This is because the same VCC is used both as the charging voltage and as the basis of the reference voltages for the two comparators inside the 555. Thus, the timing equations above depend only on the values for R and C in either operating mode.

In addition, since all three of the internal resistors used to make up the reference voltage divider are manufactured next to each other on the same chip at the same time, they are as nearly identical as can be. Therefore, changes in temperature will also have very little effect on the timing intervals, provided the external components are temperature stable. A typical commercial 555 timer will show a drift of 50 parts per million per Centigrade degree of temperature change (50 ppm/°C) and 0.01%/Volt change in VCC. This is negligible in most practical applications.

 

 

6.3 Applications

1)  A monostable multivibrator produces a stable, logic low level output as long as no trigger is       applied to the multivibrator. Now, if a trigger voltage is applied to the pin 2(Trigger) then the output voltage from pin 3 rises for a certain duration of time, which depends on the external RC circuit. IC 555 when operating in monostable mode, can be used for the purpose of pulse width modulation.

 

2)   An astable multivibrator is generally used for the purpose of generating pulses. In an astable multivibrator circuit, both the high and low levels of output produced by the multivibrator are unstable. The output thus keeps vibrating between both the levels and hence a pulse wave is generated. The IC 555 can be configured very easily to work as an astable multivibrator. 

3)   The IC 555 is used widely in different types of alarm circuits. which can be used for light detection.

 

 

 

 

 

 

 

 

7. ADC 0809

An analog to digital converter (ADC) converts a continuous analog input signal, into an n-bit binary number, which is easily acceptable to a micro-controller.

As the input increases from zero to full scale, the output code stair steps. The width of an ideal step represents the size of the least significant bit (LSB) of the converter and corresponds to an input voltage of VES/2n for an n-bit converter. Obviously for an input voltage range of one LSB, the output code is constant. For a given output code, the input voltage can be any where within a one LSB quantization interval.

            An actual converter has integral linearity and differential linearity errors. Differential linearity error is the difference between the actual code-step width and one LSB. Integral linearity error is a measure of the deviation of the code transition points from the fitted line.

            The errors of the converter are determined by the fitting of a line through the code transition points, using least square fit, the terminal point method, are the zero base technique to provide the reference line.

            A good converter will have less than 0.5 LSB linearity error and no missing code over its full temperature range. In the basic conversion scheme of ADC, the unknown input voltage Vx is connected to one input of an analog signal comparator, and a time dependent reference voltage Vr is connected to the input of the comparator.

            In this project work ADC 0809(8-bit A/D converter) is used to convert an analog voltage of an instrumentation amplifier output into an output binary word that can be used by a micro-controller.

 

 

 

 

 

 

7.1 Pin Diagram

 

 

 

ADC 0809 pin diagram

7.2 Features

  • Easy interfaces to all Microprocessors.
  • Operates ratio metrically or with 5Vdc or analog span adjusted voltage reference.
  • No zero or full scales adjust required.
  • 8-Channel multiplexer with address logic.
  • 0V to 5V input range with single 5V power supply.
  • Outputs meet TTL voltage level specification.
  • Standard hermetic or molded 28pin DIP package.
  • ADC 0809 equivalent to MM74C949-1.

 

7.3 Key Specification

  • Resolution                                           8bits
  • Total Unadjusted error                        +or- ½ LSB & +or- 1LSB
  • Single Supply                                      5 Vdc
  • Low Power                                         15mW
  • Conversion Time                                 100micro sec              

                        

 

 

ADC 0809

 

 

 

 

 

 

 

 

 

8. Segment Display

                    A seven-segment display (abbreviation: “7-segment display”, less commonly known as a seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot-matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information.

8.1 Concept and Visual Structure

 

The individual segments of a seven-segment display.

A seven segment display, as its name indicates, is composed of seven elements. Individually on or off, they can be combined to produce simplified representations of the Arabic numerals. Often the seven segments are arranged in an oblique (slanted) arrangement, which aids readability.

Each of the numbers 0, 6, 7 and 9 may be represented by two or more different glyphs on seven-segment displays.

 

 

LED-based 7-segment display showing the16hex digits.

The seven segments are arranged as a rectangle of two vertical segments on each side with one horizontal segment on the top, middle, and bottom. Additionally, the seventh segment bisects the rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for full alphanumerics); however, these have mostly been replaced by dot-matrix displays.

The segments of a 7-segment display are referred to by the letters A to G, as shown to the right, where the optional DP decimal point (an “eighth segment”) is used for the display of non-integer numbers.

The animation to the left cycles through the common glyphs of the ten decimal numerals and the six hexadecimal “letter digits” (A–F). It is an image sequence of a “LED” display, which is described technology-wise in the following section. Notice the variation between uppercase and lowercase letters for A–F; this is done to obtain a unique, unambiguous shape for each letter.

Seven segments are, effectively, the fewest required to represent each of the ten Hindu-Arabic numerals with a distinct and recognizable glyph. Bloggers have experimented with six-segment and even five-segment displays with such novel shapes as curves, angular blocks and serifs for segments; however, these often require complicated and/or non-uniform shapes and sometimes create unrecognizable glyphs.

 

8.2 Implementation

Seven-segment displays may use a liquid crystal display (LCD), arrays of light-emitting diodes(LEDs), or other light-generating or controlling techniques such as cold cathode gas discharge, vacuum fluorescent, incandescent filaments, and others. For gasoline price totems and other large signs, vane displays made up of electromagnetically flipped light-reflecting segments (or “vanes”) are still commonly used. An alternative to the 7-segment display in the 1950s through the 1970s was the cold-cathode, neon-lamp-like nixie tube. Starting in 1970, RCA sold a display device known as the Numitron that used incandescent filaments arranged into a seven-segment display. 

In a simple LED package, typically all of the cathodes (negative terminals) or all of the anodes(positive terminals) of the segment LEDs are connected together and brought out to a common pin; this is referred to as a “common cathode” or “common anode” device. Hence a 7 segment plus decimal point package will only require nine pins.

Integrated displays also exist, with single or multiple digits. Some of these integrated displays incorporate their own internal decoder, though most do not – each individual LED is brought out to a connecting pin as described. Multiple-digit LED displays as used in pocket calculators and similar devices used multiplexed displays to reduce the number of IC pins required to control the display. For example, all the anodes of the A segments of each digit position would be connected together and to a driver pin, while the cathodes of all segments for each digit would be connected. To operate any particular segment of any digit, the controlling integrated circuit would turn on the cathode driver for the selected digit, and the anode drivers for the desired segments; then after a short blanking interval the next digit would be selected and new segments lit, in a sequential fashion. In this manner an eight digit display with seven segments and a decimal point would require only 8 cathode drivers and 8 anode drivers, instead of sixty-four drivers and IC pins. Often in pocket calculators the digit drive lines would be used to scan the keyboard as well, providing further savings; however, pressing multiple keys at once would produce odd results on the multiplexed display.

Seven segment displays can be found in patents as early as 1908 (in U.S. Patent 974,943, F W Wood invented an 8-segment display, which displayed the number 4 using a diagonal bar), but did not achieve widespread use until the advent of LEDs in the 1970s. They are sometimes even used in unsophisticated displays like cardboard “For sale” signs, where the user either applies color to pre-printed segments, or (spray)paints color through a seven-segment digit template, to compose figures such as product prices or telephone numbers.

For many applications, dot-matrix LCDs have largely superseded LED displays, though even in LCDs 7-segment displays are very common. Unlike LEDs, the shapes of elements in an LCD panel are arbitrary since they are formed on the display by a kind of printing process. In contrast, the shapes of LED segments tend to be simple rectangles, reflecting the fact that they have to be physically moulded to shape, which makes it difficult to form more complex shapes than the segments of 7-segment displays. However, the high common recognition factor of 7-segment displays, and the comparatively high visual contrast obtained by such displays relative to dot-matrix digits, makes seven-segment multiple-digit LCD screens very common on basic calculators.

8.3 Numbers to 7 Segment Code

A single byte can encode the full state of a 7-segment-display. The most popular bit encodings are gfedcba and abcdefg – both usually assume 0 is off and 1 is on. This table gives the hexadecimal encodings for displaying the digits 0 to 9:

Digit

gfedcba

abcdefg

a

b

c

d

e

f

g

0

0x3F

0x7E

on

on

on

on

on

on

off

1

0x06

0x30

off

on

on

off

off

off

off

2

0x5B

0x6D

on

on

off

on

on

off

on

3

0x4F

0x79

on

on

on

on

off

off

on

4

0x66

0x33

off

on

on

off

off

on

on

5

0x6D

0x5B

on

off

on

on

off

on

on

6

0x7D

0x5F

on

off

on

on

on

on

on

7

0x07

0x70

on

on

on

off

off

off

off

8

0x7F

0x7F

on

on

on

on

on

on

on

 

9. Schematic Diagram

 

 

                                                               Circuit diagram

 

 

9.1 Working

The circuit which has shown in the above consists of the following components.

  1. Sl100
  2. LM 324
  3. ADC 0809
  4. 555 TIMER
  5. MICROCONTROLLER AT89C51
  6. 7 SEGMENT DISPLAY

The SL100 is the precision integrated – circuit temperature sensor whose output is linearly proportional to the Celsius (centigrade) temperature. It outputs 10 mV for each degree of centigrade temperature. The output of the SL100 is in the form of analog which is from 0V to 5V, which is applied to the A/D Converter. The conversion process in ADC 0809 is successive approximation method. The ADC has 8-bit resolution with a maximum of 256 steps and the SL100 produces 10mV for every degree of temperature change, we can condition Vin of the ADC 0809 to produce a Vout  of 2560 mV(2.56 V) for full-scale output. Therefore, in order to produce the full-scale Vout  of 2.56 V for the ADC 0809, we need to set Vref/2 = 1.28. This makes Vout  of the ADC 0804 correspond directly to the temperature as monitored by the SL100. The digital pulses from the ADC 0809 are from DB0 to DB7 applied to port0 of the Microcontroller AT89c51. And the 3 pins of the port3 are used to control the 7 SEGMENT DISPLAY. The port3.2 is applied to the RS Pin, port3.1 is applied to the R/W Pin, and port3. 0 is applied to the E pin of the display. And the output pulses from the port2 of the AT89C51 are connected to the data pins D0 to D7 of the Display. The contrast of the LCD is changed by the 3 pin of the LCD. The pin 1 of the LCD is connected to the Vss and pin 2 of the LCD is connected to the Vcc.

            The output of the micro controller is used to drive LCD display. This LCD display is used to read the value of temperature and it continuously displays the temperature value.

 

 

 

10. Power Supply

10.1 CIRCUIT DIAGRAM AND INTRODUCTION

 

 

 POWER SUPPLY CIRCUIT

 

Power supply unit consists of following units

i) Step down transformer

ii) Rectifier unit

iii) Input filter

iv) Regulator unit

v) Output filter

 

10.2 STEPDOWN transformer

           The Step down Transformer is used to step down the main supply voltage from 230V AC to lower value. This 230 AC voltage cannot be used directly, thus it is stepped down. The Transformer consists of primary and secondary coils. To reduce or step down the voltage, the transformer is designed to contain less number of turns in its secondary core. The output from the secondary coil is also AC waveform. Thus the conversion from AC to DC is essential. This conversion is achieved by using the Rectifier Circuit/Unit.

 

 

 

 

10.3 Rectifier Unit

          The Rectifier circuit is used to convert the AC voltage into its corresponding DC voltage. There are Half-Wave, Full-Wave and bridge Rectifiers available for this specific function. The most important and simple device used in Rectifier circuit is the diode. The simple function of the diode is to conduct when forward biased and not to conduct in reverse bias.

The Forward Bias is achieved by connecting the diode’s positive with positive of the battery and negative with battery’s negative. The efficient circuit used is the Full wave Bridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from the obtained DC voltage are removed using other circuits available. The circuit used for removing the ripples is called Filter circuit.

 

10.4 Input FilteR           

 Capacitors are used as filter. The ripples from the DC voltage are removed and pure DC voltage is obtained. And also these capacitors are used to reduce the harmonics of the input voltage. The primary action performed by capacitor is charging and discharging. It charges in positive half cycle of the AC voltage and it will discharge in negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed before the regulator. Thus the output is free from ripples.

 

10.5 Regulator uniT

 

7805 Regulator

Regulator regulates the output voltage to be always constant. The output voltage is maintained irrespective of the fluctuations in the input AC voltage. As and then the AC voltage changes, the DC voltage also changes. Thus to avoid this Regulators are used. Also when the internal resistance of the power supply is greater than 30 ohms, the output gets affected. Thus this can be successfully reduced here. The regulators are mainly classified for low voltage and for high voltage. Further they can also be classified as:     

             i) Positive regulator

                   1—> input pin

                   2—> ground pin          

                   3—> output pin

                 It regulates the positive voltage.            

              ii) Negative regulator

                   1—> ground pin

                   2—> input pin

                   3—> output pin

                  It regulates the negative voltage. 

 

10.6 Output Filter

             The Filter circuit is often fixed after the Regulator circuit. Capacitor is most often used as filter. The principle of the capacitor is to charge and discharge. It charges during the positive half cycle of the AC voltage and discharges during the negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed after the Regulator circuit to filter any of the possibly found ripples in the output received finally. Here we used 0.1µF capacitor. The output at this stage is 5V and is given to the Microcontroller.

 

 

 

 

 

 

 

 

 

 

 

11. Conclusion

 

In the temperature monitoring system we have used four blocks those are temperature sensor,ADC0809, AT89C51 microcontroller, 7 Segment Display. In this system the first block temperature sensor senses the temperature in the atmosphere in analogue form and then sends this analogue signal to ADC to convert into digital signal. This digital signal is fed to microcontroller through data lines.

By using the microcontroller process the data and send it to 7 Segment Display in the form of ASCII code. Finally 7 Segment Display displays the external temperature in the atmosphere.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

12. References

Books

1)      8051 Micro Controller – Ayala

2)      Digital Communications – Simon Haykin

3)      Introduction To 8051 Micro Controllers – Mazidi

4)      Linear And Digital Integrated Circuits – Ramakanth Gyakwad

 

Web Sites

www.texasinstruments.com

http://www.national.com

www.nationalsemiconductors.com

www.electronics123.com

www.electronictutorials.com

 

 

 

 

 

 

 

 

 

 

 

Leave a comment