Anda di halaman 1dari 13

Interfacing

Temperature Sensors
to 8051
Presenters: Aqsa Aziz
Sakina Hassan

Outline
Introduction
What are Sensors
Temperature Sensors
Interfacing Temperature Sensors
Simple record and display
Controlling switches
Example
Conclusion

Introduction

microcontroller is simply a computing machine


that performs comparisons, arithmetic operations
and stores and moves data.
It is simply a chip that deals with data in simple
digital form.
Interface simply means a program or a device
with which the user can communicate with a
computer.
Hence both input and output devices must be
interfaced with 8051, which must be programmed
to perform those operations on the incoming data.

What are Sensors?


Sensor or a Transducer (specifically an
electronic one) is a device that detects and
converts some physical parameter into an
electrical signal that can easily be changed
into digital form. This signal can then be
sent into a microcontroller or any other
computing device for storage, display or the
performance of any operation.

Fig 1: Block diagram of how data is sent to the microcontroller.

The term Signal Conditioning is used to


describe what ever changes the electrical
signal form the sensor may need to go through
before it can be converted into digital form.
This includes amplification and the conversion
of values of current and resistance (depending
on the type of sensor) into a voltage value as
this is what the microcontroller is designed to
deal with.

Temperature Sensors
RTDs, Thermistors, Thermocouples.
RTDs
and
Thermistors
change
their
resistances in response to a change in
temperature.
For thermocouples voltage is generated, in
a junction between two metals, which is
proportional to the temperature.
sensors mentioned above do not show a
linear change in response to temperature.

Interfacing Temperature
Sensors
1.
.

Simple record and display:


The temperature sensor is connected to one
I/O pin of the microcontroller and another I/O
pin is connected to an LCD display.
Input from the sensor is stored in
microcontroller registers.
Event timing is utilized with every preset
change in voltage (10mv for an LM34 sensor)
to correspond to an event which results in the
increment or decrement of the timer.

The timer is loaded with an initial value


which depends on the required range.
Every time the temperature changes the
event timer increments.
The microcontroller may be programmed to
store and display the value of the timer at
selected intervals on the LCD or to only
display the value in response to an interrupt
signal.

Controlling switches:
1. The temperature sensor is connected to one
I/O pin while another I/O pin is connected to a
switch that may control a heating or cooling
unit or an alarm in the form of a buzzed or an
LED.
2. The
microcontroller is programmed to
increment or decrement a register for every
preset change in voltage.
3. The temperature register is compared at
regular intervals (timed by the system clock)
with stored values in other registers.
4. If the two values match than a signal is sent to
the switch to turn it on or off.

Example:
Suppose we wish for an electronic heater to
turn on once the room temperature drops
below
a
certain
value
(minimum
temperature) and to turn off once the room
temperature rises above a certain value
(maximum temperature). The sensor is
LM34 and the microcontroller is 8051.

The ADC, LCD and relay 1/switch are connected to


I/O pins of either port 0 or 1.
The timing is done using a crystal oscillator.
The switch turns the heater on when it receives a
high signal and turns the heater off at the next high
signal.
The incoming signal from the ADC changes at the
rate of 10mV for every 1oC change in temperature.
The minimum and maximum temperatures are preprogrammed in registers to be retrieved for
comparison by the microcontroller program.
The initial value of the voltage is stored in a
specified register bank.
The initial value is compared with the stored
minimum value; if it is smaller than the minimum, a
signal is sent to the relay that turns the heater on.

At regular timer intervals:


The incoming voltage from the ADC is read and
stored in a specified register bank.
The new value is compared to the maximum
value.
If it is equal to or greater than the stored
maximum value a signal is sent to the heater
that turns it off.

After this if the incoming voltage falls below


the stored minimum value the heater is
sent a signal to turn it on.

Conclusion
Though this presentation discusses only
temperature sensors, others such as those
that can measure light, pH or chemical
concentration may be interfaced in a similar
manner with microcontrollers to perform a
multitude of tasks. Multiple sensors may be
connected along with a keypad or switches
for a more varied operation.

Anda mungkin juga menyukai