Anda di halaman 1dari 18

Temperature Sensor Circuit

Report by: Steve Bedford


Laboratory Partner: Jaime Lightfoot

EGR 214-905
April 13th, 2012

Abstract
In this paper, the design and implementation of a temperature sensor with
indicator lights for increasing temperature levels was designed and implemented. The
circuit will trigger a single LED at 80 F, 85 F, 90 F, and 95 F based on the output of a
temperature sensor. This paper covers the initial design process of the circuit,
computer simulations in order to verify functionality, and laboratory measurements of
the finished circuit. An effective circuit was designed and the circuit was successfully
implemented.

1.0 Introduction
It is often useful to have a sensor to monitor temperatures in a circuit element.
The circuit described in this paper indicates four distinct temperature levels (80 F, 85
F, 90 F, and 95 F) via the use of LEDs. A temperature sensor that output a specific
voltage per temperature was used in conjunction with a quad op amp in a voltage
comparator configuration in order to act as a switch for each LED. The circuit was
powered by a 9 V battery, and a zener diode was employed to prevent unwanted
voltage drops in important elements as the 9 V battery drained during use.
This paper is organized as follows. Section 2.0 discusses general design and
theoretical analysis of the temperature sensor circuit. Computer simulations were
performed, and results are presented in Section 3.0. Construction of the circuit and
laboratory measurements are presented in Section 4.0. Results of the built circuit are
compared to the analytical and simulated results in Section 5.0. Section 6.0 will present
the conclusions drawn from this paper.

2.0 Analysis and Design of Temperature Sensor Circuit


2.1 General Design
Figure 2.1.1 depicts a block diagram design of the temperature sensor circuit to
be built. Each subsequent subsection will detail a specific portion of the design process
and implementation.

Figure 2.1.1: Block Diagram of Temperature Sensor Circuit


2.2 Temperature Sensor
The LM34 temperature sensor was selected for use in the circuit due to its easy
of use and implementation. Specifics of the inner components of the sensor are beyond
the scope of this paper, thus Figure 2.2.1 shows a block diagram of the three terminal
sensor. Voltage from the battery, VS, is supplied directly to the sensor, which outputs 10
mV per degree Fahrenheit. Thus, assuming a room temperature of 72 F, the sensor
output was 720 mV via Vtemp. This voltage was clearly not enough to power an LED,
thus, an operational amplifier was introduced into the circuit.

Figure 2.2.1: Temperature Sensor Block Diagram.


2.3 Voltage Comparator
When an operational amplifier is used without a feedback resistor, as depicted in
Figure 2.3.1, it can be thought of as a voltage comparator, which acts as a voltage
controlled switch. When VIN+ is greater than VIN , then the VOUT saturates to VCC+.
Likewise, when VIN+ is less than VIN , then VOUT saturates to VCC . Table 2.3.1 contains
a summary of this behavior.
Table 2.3.1: Voltage Comparator Behavior
Condition
Result
V
OUT = VCC+
VIN+ > VIN
VIN+ < VIN VOUT = VCC

Figure 2.3.1: Voltage Comparator


The behavior of the voltage comparator was applied to the temperature sensor
circuit in order to generate enough additional voltage to power an LED at the correct

temperature sensor output. An LM324 quad op amp was chosen for use in the circuit.
This op amp had common VCC+ and VCC terminals, but four sets of inputs and outputs.
A resistive network was designed in order to generate the VIN node voltages found in
Table 2.3.2.
Table 2.3.2: VIN Node Voltages
Node

V1in
V2in
V3in
V4in

Voltage (mV)
800
850
900
950

Output from the temperature sensor VTEMP was fed directly into each of the VIN+
inputs on the quad op amp. VCC+ and VCC were set to 9 V and ground, respectively.
Figure 2.3.2 depicts the values for the 80 F voltage comparator.

Figure 2.3.2: Voltage Comparator for 80 F


Thus, when the temperature sensor surpassed 80 F, VTEMP would surpass

0.80 V, and the voltage comparator would switch from outputting 0 V to outputting 9 V
(minus some internal resistance), which would then turn that respective indicator LED
on. Similar configurations were used for 85 F, 90 F, and 95 F, with VIN values found
in Table 2.3.2.
2.4 Zener Diode
In order to prevent unwanted voltage drops at the VIN nodes as the battery that
powered the circuit drained, a zener diode was placed in parallel with the resistive
network, as seen in Figure 2.4.1. The forward voltage (Vz) of the zener diode was
equal to 5.1 V. In order to limit the current through the diode, resistor R1 was placed in
the circuit prior to the diode. Kirchhoffs Voltage Law provides Equation 1 in order to
determine V1.
V1+Vz = 9 V

(1)

Solving Equation 1 gives V1 = 3.9 V.

Figure 2.4.1: Zener Diode

2.5 Resistive Network for Vin


A resistive network was setup in order to feed the correct voltages into the
various VIN terminals, as found in Table 2.3.2. A potentiometer, as shown in Figure
2.5.1, was used in order to allow the node voltages to be dialed in with some precision.
Resistor values were determined by starting at R5 and working backward based on
desired voltage drops in conjunction with a relatively low current through the resistors in
series. The voltage drop across R5 was known to be 0.80 V, therefore, a resistor value
of 900 was selected, as it would provide a reasonable branch current of 0.889 mA.
Error! Reference source not found. contains the resistor values required to obtain the
correct node voltages based on the 0.889 mA current. As the resistors were effectively
in series, the same current pass through each resistor, and Ohms Law was used to
determine each value based on the 0.889 mA current and the voltage drops required to
produce the correct node voltages, as found in Table 2.3.2.
Table 2.5.1: Resistor Values
Resistor
R2
R3
R4
R5
Rpot

Value ()
56
56
56
900
4668

Figure 2.5.1: Resistive Network


2.6 Indicator LEDs
Figure 2.6.1 depicts the portion of the circuit designed for each indicator LED.
Four separate LEDs were used in order to signal when the temperature sensor reached
each specific temperature level. A 220 resistor was used to limit the amount of
current delivered by each op amp.

Figure 2.6.1: Indicator LED


2.7 Heating Resistor
A 0.25 W resistor was placed in the circuit between the battery and ground with
the intent of overheating the resistor in order to drive the LM34 temperature sensor.
Equation 2 shows the relationship between power, voltage, and resistance.
P=

V2
R

(2)
where V is the voltage across the resistor R.

A 100 resistor was selected to ensure that the resistor would heat to at least
95 F by dissipating 0.81 W.
2.8 Summary of Design
Figure 2.8.1 depicts the final design of the temperature sensor circuit. A
summary of the calculated voltages drops for the temperature sensor circuit is
presented in Table 2.8.1.
Table 2.8.2 contains calculated node voltages required at stated nodes in order
for each LED to turn on at its designated temperature. Table 2.8.4 contains a summary
of nominal resistor values selected for the circuit.

Figure 2.8.1: Final Design of Temperature Sensor Circuit


Table 2.8.1: Calculated Voltage Drops (V)
Vs
9

Vz
5.1

V1
3.9

Vpot
4.15

Table 2.8.2: Calculated Node Voltages (V)


V1in
0.80

V2in
0.85

V3in
0.90

V4in
0.95

10

Table 2.8.4: Nominal Resistor Values ()


Resistor
R1
Rpot
R2
R3
R4
R5
R6
R7
R8
R9
Rhot

Value ()
100
4668
56
56
56
900
220
220
220
220
100

3.0 Simulation
3.1 LTSpice Simulation
A computer simulation using LTSpice was run in order to verify the analytical
results presented in Section 2 of this paper. Figure 3.1.1 depicts the circuit that was
simulated. Five different configurations were simulated by changing the value of the
voltage source V2, which stood in for the temperature sensor in the simulations.
Results for each simulation can be found in the following tables.

11

Figure 3.1.1: LTSpice Simulation Circuit


Table 3.1.1 contains results for the simulation of a temperature sensor reading of
75 F. Vin values for each of the terminals were well within an acceptable range of
desired values. The Vout value from each of the comparators was effectively 0 V, and
therefore none of the LEDs were triggered, as is expected for an ambient temperature
of 75 F.

12

Table 3.1.1: Simulation of 75 F


Comparator
80 F
85 F
90 F
95 F

Vin
798 mV
847 mV
897 mV
947 mV

Vtemp
750 mV
750 mV
750 mV
750 mV

Vout
16.4 V
12.4 V
11.4 V
11.2 V

Table 3.1.2 depicts the results from the simulation of an 80 F temperature


sensor reading. It is clear that Vtemp was greater than Vin for the 80 F comparator,
therefore, Vout for that comparator became 6.28 V, thus powering the 80 F LED. Vin
was greater than Vtemp for the other comparators, therefore the other LEDs remained
off, as was expected.
Table 3.1.2: Simulation of 80 F
Comparator
80 F
85 F
90 F
95 F

Vin
798 mV
847 mV
897 mV
947 mV

Vtemp
800 mV
800 mV
800 mV
800 mV

Vout
6.28 V
16.4 V
12.4 V
11.4 V

Table 3.1.3, Table 3.1.4, and Table 3.1.5 contain results for subsequent
temperature levels. It is clear from the values found in each table that the voltage
comparator was designed effectively, and that proper voltages were supplied at the
correct times in order to power each LED at the desired temperature level.
Table 3.1.3: Simulation of 85 F
Comparator
80 F
85 F
90 F
95 F

Vin
798 mV
847 mV
897 mV
947 mV

Vtemp
850 mV
850 mV
850 mV
850 mV

Vout
6.28 V
6.28 V
16.5 V
12.4 V

13

Table 3.1.4: Simulation of 90 F


Comparator
80 F
85 F
90 F
95 F

Vin
798 mV
847 mV
897 mV
947 mV

Vtemp
900 mV
900 mV
900 mV
900 mV

Vout
6.28 V
6.28 V
6.28 V
16.6 V

Table 3.1.5: Simulation of 95 F


Comparator
80 F
85 F
90 F
95 F

Vin
798 mV
847 mV
897 mV
947 mV

Vtemp
950 mV
950 mV
950 mV
950 mV

Vout
6.28 V
6.28 V
6.28 V
6.28 V

4.0 Build and Measure


4.1 Temperature Sensor Circuit
The circuit depicted in Figure 4.1.1 was built in the laboratory in order to verify
circuit functionality. Vs was set to 9 V in order to simulate a standard 9 V battery and
various measurements were taken. Vs then was stepped down to 8 V, 7 V, and 6 V in
1 V increments in order to test the functionality of the zener diode by simulating voltage
drop from battery drain.

14

Figure 4.1.1: Temperature Sensor Circuit


Table 4.1.1 contains measured values of voltage drops across stated elements
for each Vs setting. It is clear from depicted values that while Vs dropped from 9 V to
6 V, Vz and Vpot stayed relatively constant, which was the desired result.
Table 4.1.1: Measured Voltage Drops For Varied Source
Vs (V)
9.045
8.016
7.067
6.068

V1 (V)
4.0025
3.0054
2.1020
1.1852

Vz (V)
5.0367
5.0026
4.9625
4.8813

Vpot (V)
4.0911
4.0646
4.0306
3.9645

15

Table 4.1.2 contains measured node voltage values for nodes V1in through V4in
as Vs was varied from 9 V to 6 V in 1 V increments. Node voltages stayed relatively
constant when compared to the reduction in Vs.
Table 4.1.2: Measured Node Voltages
Vs (V)
9.045
8.016
7.067
6.068

V1in (V)
0.8027
0.7958
0.7882
0.7745

V2in (V)
0.8516
0.8449
0.8370
0.8224

V3in (V)
0.9015
0.8941
0.8857
0.8703

V4in (V)
0.9508
0.9428
0.9341
0.9179

Table 4.1.3 contains measured currents with 9 V source in order to ensure


current draw was not too great in the resistive network of the circuit. The currents were
decided to be sufficiently low.
Table 4.1.3: Measured Currents With 9 V Source
Current
Iz
I2
I1

Value (mA)
38.73
0.887
39.48

5.0 Comparison of Results


5.1 Analytical, Simulation, and Measured Results
Table 5.1.1 contains a comparison of required node voltage values for the VIN
inputs of each comparator to the values obtained by simulating the circuit in LTSpice. It
is clear that the percent error values were adequately small.
Table 5.1.1: Comparison of Calculated and Simulated Values
Node
V1in
V2in
V3in
V4in

Calculated (mV)
800
850
900
950

Simulated (mV)
798
847
897
947

Percent Error
0.000625%
0.000830%
0.000741%
0.000665%

16

The values in Table 5.1.2 depict voltage drops across the state elements. The
relatively low percent error values show that the required voltage drops for the LEDs to
be triggered at the correct temperatures were able to be achieved in the laboratory.
Table 5.1.2: Calculated and Measured Voltages
Vs
Vz
V1
Vpot

Calculated (V)
9.00
5.10
3.90
4.15

Measured (V)
9.045
5.0367
4.0025
4.0911

Percent Error
0.06%
0.24%
0.67%
0.34%

The values found in Table 5.1.3 were the voltages being supplied to the Vin
terminals of the quad op amp. The suitably low percent error values in Table 5.1.3 show
that when using a 9 V source, the circuit proved to be accurate when compared to the
intended design.
Table 5.1.3: Node Voltages With 9 V Source
V1in
V2in
V3in
V4in

Calculated
0.80
0.85
0.90
0.95

Measured
0.8027
0.8516
0.9015
0.9508

Percent Error
0.42%
0.22%
0.19%
0.09%

Table 5.1.4 and Error! Reference source not found.Table 5.1.6 depict the
results from the laboratory simulation of battery drain. In order to simulate a reasonable
voltage drop due to battery drain, Vs was reduced by 12.06% to 8.016 V, and each VIN
node voltage dropped by roughly 0.8%. In a slightly more extreme case, Vs was
reduced by 39.40% to 6.069 V, yet the node voltages at the respective VIN terminals
dropped by roughly 3.5% each. It is clear from the relatively low percent difference
values at the various VIN nodes that the zener diode was effective.
17

Table 5.1.4: Voltage Source Drop From 9 V To 8 V


Vs
V1in
V2in
V3in
V4in

Voltage (V)
9.045
0.8027
0.8516
0.9015
0.9508

Voltage (V)
8.016
0.7958
0.8449
0.8941
0.9428

Percent Difference
12.06%
0.86%
0.79%
0.82%
0.84%

Table 5.1.6: Voltage Source Drop From 9 V to 6 V


Vs
V1in
V2in
V3in
V4in

Voltage (V)
9.045
0.8027
0.8516
0.9015
0.9508

Voltage (V)
6.068
0.7745
0.8224
0.8703
0.9179

Percent Difference
39.40%
3.58%
3.49%
3.52%
3.52%

6.0 Conclusion
The circuit presented in this paper has been demonstrated to be an effective
design for the implementation of a temperature sensor circuit via the use of a voltage
comparator configuration. Analytical results agreed closely with simulated results, and
laboratory measurements confirmed that the design function as desired. When using a
9 V source, it was demonstrated that all 4 LEDs were triggered at the desired
temperatures. While a constant Vs value would be preferable for some applications, the
relatively low node voltage drops when varying Vs show that the implementation of the
zener diode was effect for applications requiring the portability afforded by battery power
and when great amounts of accuracy in temperature measurements are not important.

18

Anda mungkin juga menyukai