Temperature Measurement & control Introduction: The purpose of this project is to measure the temperature, display it on LCD & also control the temperature through on or off any 220V device like AC or heater. This project is divided into two sections (a) Hardware and (b) Software. In hardware section I have made a microcontroller kit, which is interfaced with Analog to Digital converter (ADC), LCD, three switches keypad and relay through isolator circuit. In software section I have made a program code for measuring Temperature and displaying it on LCD and then comparing it with the preset value. The program code is written in high level language “embedded c” with the help of Keil compiler. Block Diagram of the Project: Various modules of the project are shown in the block diagram given below:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Temperature Measurement & control
Introduction:
The purpose of this project is to measure the temperature, display it on
LCD & also control the temperature through on or off any 220V device
like AC or heater.
This project is divided into two sections (a) Hardware and (b) Software.
In hardware section I have made a microcontroller kit, which is interfaced
with Analog to Digital converter (ADC), LCD, three switches keypad and
relay through isolator circuit. In software section I have made a program
code for measuring Temperature and displaying it on LCD and then
comparing it with the preset value. The program code is written in high
level language “embedded c” with the help of Keil compiler.
Block Diagram of the Project:
Various modules of the project are shown in the block diagram given
below:
MICROCONTROLLER UNIT
LCDPOWER
SUPPLY1TEMPERATURE
SENSOR
ADC
POWER SUPPLY2
ISOLATOR
AMPLIFIER
SOCKET
RELAY
SWITCH PANEL
Interfacing with switches (keypad):
Interfacing with keypad makes instrument menu driven user friendly.
This will help to the user to select the preset temperature and also to
move to the measurement stage.
Interfacing with LCD
LCD makes this instrument user friendly by displaying everything on the
display. It is an intelligent LCD module, as it has inbuilt controller which
convert the alphabet and digit into its ASCII code and then display it by
its own i.e. we do not required to specify which LCD combination must
glow for a particular alphabet or digit.
Interfacing with Analog to Digital Converter
The analog to digital converter takes the input from the sensor which is in
analog form. It takes 0V for 0 digital level and take 5V for 1 digital level.
555 Timer is used to provide clock to ADC.
Temperature Sensor:
For continuous temperature monitoring applications, time response is less
concern, sensors that remain in place for long periods can achieve a
relatively steady state because actual temperature changes slowly.
The sensor type most commonly used for medical applications is the
thermistor. A thermistor is a thermally sensitive resistor, whose resistance
alters markedly with changes of its ambient temperature. Thermistors are
composites of selected metal oxides characterized by large negative
temperature-coefficients and high sensitivity i.e. resistance decreases with
increasing temperature. In practice, a thermistor designed for use in a
body temperature probe might consist of a small bead of semiconductor
material sealed into the tip of a thin glass envelope for protection.
Platinum leads are fused into the bead and led out of the envelope. The
bead material could consist of a mixture of nickel, cobalt and manganese
oxides fused together in a furnace. A typical bead resistance might be
2000 ohms at 20 degrees Celsius which would fall to 1400 ohms at 40
degree Celsius, the variation of the thermistor resistance with temperature
is inherently non linear. Thermistor sensors now in use clinically are
typically specified as accurate to within 0.2oC to 37oC.
Thermistors are non-linear. In addition, the outputs of these sensors are
not linearly proportional to any temperature scale. Early monolithic
sensor such as LM 3911, LM134 and LM135 over come these difficulties
but their outputs are related to Kelvin temperature scale.
In this circuit LM35 precision centigrade temperature has been used as
temperature sensor.
Switching of 220V device:
ON/OFF switching of a 220V device is controlled by the Microcontroller.
Device is isolated from Microcontroller by optocoupler and is connected
through Relay. Switching of mains is done, by using relays. Temperature
is compared with the preset desired value. If temperature is greater than
the required value then the relay corresponding to the ‘AC’ is made ON
by the MCU and the relay corresponding to the ‘HEATER’ is made OFF
by the MCU. If the temperature is less than the desired temperature then
reverse is done by the MCU.
Features of the Project:
Powered by +5 volt, 12volt supply
Current consumption 0.45mA for Microcontroller circuit, 0.75mA for
switching circuit, 200mA for amplification circuit
User interface using LCD and switches
Maintenance of the temperature at the desired value through on/off an
AC or Heater
Various Components used in various Modules of the Project along
The LM35 series are precision integrated-circuit temperature sensors,
whose output voltage is linearly proportional to the Celsius (Centigrade)
temperature. The LM35 thus has an advantage over linear temperature
sensors calibrated in ° Kelvin, as the user is not required to subtract a
large constant voltage from its output to obtain convenient Centigrade
scaling. The LM35 does not require any external calibration or trimming
to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C
over a full −55 to +150°C temperature range. Low cost is assured by
trimming and calibration at the wafer level. The LM35’s low output
impedance, linear output, and precise inherent calibration make
interfacing to readout or control circuitry especially easy. It can be used
with single power supplies, or with plus and minus supplies. As it draws
only 60 μA from its supply, it has very low self-heating, less than 0.1°C
in still air. The LM35 is rated to operate over a −55° to +150°C
temperature range, while the LM35C is rated for a −40° to +110°C range
(−10° with improved accuracy). The LM35 series is available packaged
in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and
LM35D are also available in the plastic TO-92 transistor package. The
LM35D is also available in an 8-lead surface mount small outline
package and a plastic TO-220 package.
Features:
Calibrated directly in ° Celsius (Centigrade) Linear + 10.0 mV/°C scale factor 0.5°C accuracy guarantee able (at +25°C) Rated for full −55° to +150°C range Suitable for remote applications Low cost due to wafer-level trimming Operates from 4 to 30 volts Less than 60 μA current drain Low self-heating, 0.08°C in still air Nonlinearity only ±1⁄4°C typical Low impedance output, 0.1 W for 1 mA load
Typical Applications:
Basic Centigrade temperature sensor
(+2°C to +150°C)
Full-Range Centigrade Temperature Sensor
A/D converter
As the output signal from the transducer LM35 is in analog form and the
data can be fed to the controller in digital form only so an analog to
digital converter is to be used. The A/D conversion is a quantizing
process where by an analog signal is represented by equivalent binary
states. A/D converter can be classified into two groups based on
conversion technique.
One technique involves comparing a given analog signal with the
internally generated equivalent signal. This group includes Successive
approximation Register, counter and Flash type converters.
The second technique involves changing an analog signal into time or
frequency and comparing these parameters to known values. This group
includes Integrator and Voltage to Frequency Converters.
First type is used for data loggers and instrumentation, while the second
type is used in digital meters, panel meters and monitoring system.
Successive Approximation A/D converter ( ADC0808)
This is the most popular method of analog to digital conversion. It has an
excellent compromise between accuracy and speed. An unknown voltage
Vin is compared with a fraction of reference voltage, Vr For n-bit digital
output , comparison is made in times with different fractions of Vr and the
value of a particular bit is set to 1, if V in is greater than the set fraction of
Vr. It includes three major elements
The D/A converter.
The successive Approximation Register.
The comparator.
The ADC0808 data acquisition component is a monolithic CMOS device
with an 8 bit analog-to-digital converter, 8-channel multiplexer and
microprocessor compatible control logic. The 8-bit A/D converter uses
successive approximation as the conversion technique. The converter
features a high impedance chopper stabilized comparator, a voltage
divider with analog switch tree and a successive approximation register.
The 8–channel multiplexer can directly access any of 8-single-ended
analog signals. The device eliminates the need for external zero and full –
scale adjustments. Easy interfacing to microprocessors is provided by the
latched and decoded multiplexer address inputs and latched TTL TRI-
STATE outputs.
The design of the ADC0808 has been optimized by incorporating the
most desirable aspects of several A/D conversion Techniques. The
ADC0808, ADC0809 offers high speed. High accuracy, minimal
temperature dependence, excellent long-term accuracy and repeatability,
and consumes minimal power. These features make this device ideally
suited to applications from process and machine control to consumer and
automotive applications.
Key specifications
Easy interface to all microprocessors.
Operates with 5 V DC.
Adjusted voltage reference.
No zero or full scale adjust required.
8-channel multiplexer with address logic.
0V to 5V input range with single 4V power supply.
Outputs meet TTL voltage level specifications.
Resolution 8 Bits.
Total Unadjusted Error = ½ LSB.
Single supply 5 V DC.
Low Power 15m W, conversion time 100s.
Architecture of ADC0808
Clock input
The clock input to the ADC is provided by using a 555 TIMER. The
LM555 is a highly stable device for generating accurate time delays or
oscillation. Additional terminals are provided for triggering or resetting if
desired. For astable operation as an oscillator, the free running frequency
and duty cycle are accurately controlled with two external resistors and
one capacitor. The circuit may be triggered and reset on falling
waveforms, and the output circuit can source or ink up to 200mA or drive
TTL circuits.
Astable Operation
If the circuit is connected as shown in Figure (pins 2 and 6 connected) it
will trigger itself and free run as a multivibrator. The external capacitor
charges through RA+ RB and discharges through RB. Thus the duty cycle
may be precisely set by the ratio of these two resistors. In this mode of
operation, the capacitor charges and discharges between 1/3 VCC and 2/3
VCC. The time during which the capacitor charges from 1/3 Vcc to 2/3
Vcc is equal to the time the output is high and is given by:
tc= 0.69 (RA+RB)C ………1
Where RA and RB are in ohms and C is in farads. Similarly, the time
during which the capacitor discharges from 2/3 Vcc to 1/3 Vcc is equal to
the time the output is low is given by:
td= 0.69 (RB)C ………2
As in the triggered mode, the charge and discharge times, and therefore
the frequency are independent of the supply voltage.
Thus the total period is
T=tc+td= 0.69 (RA+2RB) C ………3
The frequency of oscillation:
………4
The duty cycle is the ratio of the time during which the output is high to
the total time period T.
Diagram of 555 timer in astable mode
555Timer:
The 8-pin 555 timer must be one of the most useful ICs ever made and it
is used in many projects. With just a few external components it can be
used to build many circuits, not all of them involve timing!
A popular version is the NE555 and this is suitable in most cases where a
'555 timer' is specified. The 556 is a dual version of the 555 housed in a
14-pin package, the two timers (A and B) share the same power supply
pins. The circuit diagrams on this page show a 555, but they could all be
adapted to use one half of a 556.
Low power versions of the 555 are made, such as the ICM7555, but these
should only be used when specified (to increase battery life) because their
maximum output current of about 20mA (with a 9V supply) is too low for
many standard 555 circuits. The ICM7555 has the same pin arrangement
as a standard 555.
The circuit symbol for a 555 (and 556) is a box with the pins arranged to
suit the circuit diagram: for example 555 pin 8 at the top for the +Vs
supply, 555 pin 3 output on the right. Usually just the pin numbers are
used and they are not labeled with their function.
The 555 and 556 can be used with a supply voltage (Vs) in the range 4.5
to 15V (18V absolute maximum).
Standard 555 and 556 ICs create a significant 'glitch' on the supply when
their output changes state. This is rarely a problem in simple circuits with
no other ICs, but in more complex circuits a smoothing capacitor (eg
100µF) should be connected across the +Vs and 0V supply near the 555
or 556.
The input and output pin functions are described briefly below and there
are fuller explanations covering the various circuits:
Astable - producing a square wave
Monostable - producing a single pulse when triggered
Bistable - a simple memory which can be set and reset
Buffer - an inverting buffer (Schmitt trigger)
Inputs of 555/556
Trigger input: when < 1/3 Vs ('active low') this makes the output high
(+Vs). It monitors the discharging of the timing capacitor in an astable
circuit. It has a high input impedance > 2M .
Threshold input: when > 2/3 Vs ('active high') this makes the output low
(0V)*. It monitors the charging of the timing capacitor in astable and
monostable circuits. It has a high input impedance > 10M .
* providing the trigger input is > 1/3 Vs, otherwise the trigger input will
override the threshold input and hold the output high (+Vs).
The time period can be split into two parts: T = Tm + Ts Mark time (output high): Tm = 0.7 × (R1 + R2) × C1 Space time (output low): Ts = 0.7 × R2 × C1
Many circuits require Tm and Ts to be almost equal; this is achieved if R2 is much larger than R1.
For a standard astable circuit Tm cannot be less than Ts, but this is not
too restricting because the output can both sink and source current. For
example an LED can be made to flash briefly with long gaps by
connecting it (with its resistor) between +Vs and the output. This way the
LED is on during Ts, so brief flashes are achieved with R1 larger than
R2, making Ts short and Tm long. If Tm must be less than Ts a diode can
be added to the circuit as
explained under duty cycle below.
Choosing R1, R2 and C1R1 and R2 should be in the range 1k to 1M . It is best to choose C1
first because capacitors are available in just a few values.
Choose C1 to suit the frequency range you require (use the table as
a guide).
Choose R2 to give the frequency (f) you require. Assume
that R1 is much smaller than R2 (so that Tm and Ts are