TELEMETRY TEMPERATURE MONITOR (Project)
TELEMETRY TEMPERATURE MONITOR (Project)
3.1 INTRODUCTION
In this project, a design methodology targeting accuracy and temperature-aware
system is employed. In order to demonstrate its effectiveness, we used a transducer
an analog converter coupled to an embedded system to effect the desired change.
Here, we also used RF transmitter and receiver module to achieve a wireless
communication from a remote area.
First of all, the principle of operation of transducer were studied. It is found out
that its output is normally an analog signal which needs to be converted in digital
signal for onward interface to a microcontroller. Here, the ADC was handy to settle
the conversion problem. It converts the analog signal to digital signal.
This digital output is then fed into a microcontroller to process and give a required
result depending on the program burned into it. For us to see the effect of the
process of the controller, a digital read out was used to display the reading of the
temperature at each point in time. Here, again, the seven-segment display was
useful. In the following subject, apart from analog to digital conversion, the
emphasis is on the individual working of the device so employed and its relevance
to the design.
TEMPERATURE ANALOG-TO-DIGITAL RF
SENSOR CONVERTER MICROCONTROLLER TRANSMITTER
MICROCONTROLLER RF
DISPLAY UNIT
RECEIVER
3.2 MATERIALS
Some of the materials used in this work are listed below:
Integrated circuit sensor (LM35)
RF module (kyl500s)
Analog-to-digital converter (ADC0804)
Microcontroller (Atmel 89c52)
Resistors
Capacitors
Transistors
Seven segment display
Gnd
input output
I: About KYL-500S
KYL-500S, the micro power wireless transceiver data module is used as the
wireless
data transceiver in short-ranges, with the small size, weight and power
consumption
and good stability and reliability. Narrowband low power UHF wireless data
transmitters and receivers with channel spacing as low as 25 KHz.
II: Features:
I. Features of KYL-500S
1. Low power transmission with 10mW.
2. With 433MHz as factory default carrier frequency, but 400-470MHz, 868MHz,
915MHz is available if needed.
3. High anti- interference and Low BER (Bit error Rate)
Based on the Gaussian Frequency Shift Keying (GFSK) modulation, the
high-efficiency forward error correction channel encoding technology is used to
enhance data’s resistance to both transient interference and random interference
and
the actual bit error rate of 10-5 ~ 10-6 can be achieved when channel bit error rate
is
10-2.
4. Long Transmission Distance
Within the visible range, when the height of antenna is higher than 2m and The Bit
Error Rate (BER) is 10-3, the reliable transmission distances respectively is 1000m
@1200bps, and is 600m@9600bps.
5. Transparent data transmission
Transparent data interface used in transceivers is for meeting many standard or
nonstandard user protocols. Any false data generated in air can be filtrated
automatically (What has been received is exactly what has been transmitted).
6. Multi-channels
KYL-500S transceivers offer 8 channels, if needed, 16 or 32 channels are available
to satisfy various configuration of communication under user’s demand at the same
time.
7. 2 ports with three connection methods
KYL-500S transceivers provide 2 ports with three connections, ports: a UART
interface of TTL level, a non-standard RS-232 port and a non-standard RS-485
port.
8. Big data buffer area
With optional interface baud rate: 1200/4800/9600/19200bps and 8N1/8E1/8O1
data format (set by user), the transceiver can transmit unlimited data frames with
flexible user program.
Note: the RF data rate is only settled down before delivery, please inform our sales
when placing your orders.
1. Power supply
The factory default setting is +5V(3.3-3.6V will inform when placing the order).By
using better ripple factor, KYL-500S transceivers can also share power supply with
other equipment. If possible, a voltage-stabilizing chip with 5V voltage is more
recommended as the only power supply than Switch power supply. But if only
switch power supply available, the jam by switch pulse to the transceivers should
be avoided. In addition, the reliable grounding must be used if there is other device
in the system equipment. In case of failing to connect with the ground, it can form
its own grounding but must be absolutely separated from the municipal electric
supply.
2. Connection Definition with terminal
KYL-500S transceivers supply one 9-pin connector (JP1), their definitions and
connection methods with terminals are shown in Table 1.
FIXED RESISTORS
Fixed resistors supply a resistance measured in ohms to a circuit. The higher the
ohms, the more resistance. The first bar sets the initial number (in this case, 1), the
second is an assistant (add on a 5). The third bar is a multiplier (that means 15
times 100 = 1500 or 15k ohms). The final bar is the tolerance bar (meaning this
resistor can vary + or - 10%).
DIODE
Diodes are made of either germanium or silicon. They carry two ratings: peak
inverse voltage and current. These ratings are the maximum amount of each that a
diode can handle. For instance, a 5 amp diode can only handle 5 amps before
failure. They, like capacitors, have a marking (a cathode band) denoting the
negative terminal. Light-emitting diodes (LED) emit infrared light, have a PIV
rating of 100 to 150 volts, a maximum current rating of 40 milliamps, are powered
in low-powered DC circuits of 12 volts or less, and are used with a resistor to limit
the current.
TRANSISTORS
Transistors are divided into two categories: signal, where they amplify a signal in
things such as radios, telephones, etc., and power, where they switch a signal on or
off in things such as motor drivers and power supplies. Size is usually a way to tell
the two apart. Transistor are identified by a unique code, like 2N2222 or
MPS6519, designating what kind of application they are for. To find this out, refer
to a data book to locate the different characteristics and ratings. A signal transistor
is small and can come in either a plastic or metal case. A power transistor is larger
and always has a metal case to dissipate heat.
fig 3.3 Bipolar Transistors
POWER SUPPLIES
There are many types of power supply. Most are designed to convert high voltage
AC mains electricity to a suitable low voltage supply for electronics circuits and
other devices. A power supply can by broken down into a series of blocks, each of
which performs a particular function.
For example a 5V regulated supply:
Regulated Voltag
230V AC
Transformer Rectifier Smoothing Regulator
Transformer only
Transformer + Rectifier
Transformer + Rectifier + Smoothing
Transformer + Rectifier + Smoothing + Regulator
Transformer only
(a) (b)
fig 3.5 (a) a transformer (b) output voltage wave form of the transformer
The low voltage AC output is suitable for lamps, heaters and special AC motors. It
is not suitable for electronic circuits unless they include a rectifier and a smoothing
capacitor.
Transformer + Rectifier
(a) (b)
Fig 3.6 (a) Transformer + Rectifier circuit (b) output wave form of (a)
The varying DC output is suitable for lamps, heaters and standard motors. It is not
suitable for electronic circuits unless they include a smoothing capacitor.
(a) (b)
Fig 3.7 (a) Full wave bridge rectification + filtering capacitor (b) waveform of (a)
The smooth DC output has a small ripple. It is suitable for most electronic circuits.
(a) (b)
Fig 3.8 (a) power supply circuit (b) output voltage or waveform of (a)
The regulated DC output is very smooth with no ripple. It is suitable for all
electronic circuits.[4]
3.3 TEMPERATURE SENSING
It has an output voltage that is proportional to the Celsius temperature. The scale
factor is .01V/oC . The LM35 does not require any external calibration or trimming
and maintains an accuracy of +/-0.4 oC at room temperature and +/- 0.8 oC over a
range of 0 oC to +100 oC. Another important characteristic of the LM35DZ is that it
draws only 60 micro amps from its supply and possesses a low self-heating
capability. The sensor self-heating causes less than 0.1 oC temperature rise in still
air. The LM35 comes in many different packages, including the following.
Vc = 4 to 30v
5v or 12v are typical values used.
Ra = Vc /10-6
Actually, it can range from 80 KΩ to 600 KΩ, but most just use 80 KΩ.
CHARACTERISTICS OF LM35
The ability to convert analog signals to digital and vice-versa is very important in
signal processing. The objective of an A/D converter is to determine the output
digital word corresponding to an analog input signal.
The Datasheet for ADC0804LCN shows the pin out and a typical application
schematic. The A/D converter operates on the successive approximation principle.
Analog switches are closed sequentially by successive-approximation logic until
the analog differential input voltage [Vin(+) - Vin(-)] matches a voltage derived from a
tapped resistor string across the reference voltage.[5]
Since this is an 8-bit A/D converter, a voltage from 0-5V. O will be represented as
0000 0000 (0 in decimal) and 5V is represented as 1111 1111 (256 in decimal). To
convert a value X volts to decimal, use the following formula:
X * 5.0 /256
Figure 3.10 diagram of analog-to-digital converter interface to a microcontroller
3.5 THE SYSTEM INTERFACE
Analog signals are very common inputs to embedded systems .Most transducers
and sensors such as temperature, pressure, velocity, humidity are analog. Therefore
we need to convert these analog signals in to digital so that 8051 can read it.
generator.
To use the internal clock generator of the ADC804, the CLK IN and CLK R pins
are connected to a capacitor and a resistor. In that case, the
• Default 0-5V. Can be changed by setting different value for Vref/2 pin.
Vin=Vin(+) – Vin (-)
• Range = 0 to 2x Vref/2.
for Vin = 2x Vref/2. we get 256 as a digital output on D0-D7. (Refer Table)
for e.g. for step size 10mv ,digital output on D0-D7 changes by one count for
every 10mv change of the input analog voltage
5/256 =
Open (2.5) 0 to 5
19.53
5.12/256
2.56 0 to 5.12
=20
2.56/256 =
1.28 0 to 2.56
10
0.5 0 to 1 1/256=3.90
DATA OUTPUT
Dout = Vin / Step Size
for input voltage of 2.56 volts (Vref=1.28 volts) and step size of 10mv Dout
=2560/10 =256 or FF that is full scale output.
This family of A/D converters was designed for easy microprocessor interfacing.
These converters can be memory mapped with appropriate memory address
decoding for CS (read) input. The active-Low write pulse from the processor is
then connected to the WR input of the A/D converter, while the processor active-
Low read pulse is fed to the converter RD input to read the converted data. If the
clock signal is derived from the microprocessor system clock, the
designer/programmer should be sure that there is no attempt to read the converter
until 74 converter clock pulses after the start pulse goes high. Alternatively, the
INTR pin may be used to interrupt the processor to cause reading of the converted
data. Of course, the converter can be connected and addressed as a peripheral (in
I/O space) [7]
Algorithm
Make CS=0 and send a low-to-high to pin WR to start the conversion.
Keep monitoring INTR
If INTR =0, the conversion is finished and we can go to the next step.
If INTR=1, keep polling until it goes low.
After INTR=0, we make CS=0 and send a high-to-low pulse to RD to get the
data out of the ADC804 chip.
The 89c52 microcontroller has the following pin out function as shown in the
figure 3.7 below. This is useful when connecting or interfacing with ADC.
ALE/PROG: Address Latch Enable output pulse for latching the low byte of the
address during accesses to external memory. ALE is emitted at a constant rate of
1/6 of the oscillator frequency, for external timing or clocking purposes, even
when there are no accesses to external memory. (However, one ALE pulse is
skipped during each access to external Data Memory.) This pin is also the program
pulse input (PROG) during EPROM programming.
PSEN: Program Store Enable is the read strobe to external Program Memory.
When the device is executing out of external Program Memory, PSEN is activated
twice each machine cycle (except that two PSEN activations are skipped during
accesses to external Data Memory). PSEN is not activated when the device is
executing out of internal Program Memory.
EA/VPP: When EA is held high the CPU executes out of internal Program
Memory (unless the Program Counter exceeds 0FFFH in the 80C51). Holding EA
low forces the CPU to execute out of external memory regardless of the Program
Counter value. In the 80C31, EA must be externally wired low. In the EPROM
devices, this pin also receives the programming supply voltage (VPP) during
EPROM programming[6][9].
Port 0: Port 0 is an 8-bit open drain bidirectional port. As an open drain output
port, it can sink eight LS TTL loads. Port 0 pins that have 1s written to them float,
and in that state will function as high impedance inputs. Port 0 is also the
multiplexed low-order address and data bus during accesses to external memory. In
this application it uses strong internal pull-ups when emitting 1s. Port 0 emits code
bytes during program verification. In this application, external pull-ups are
required.
Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port 1 pins
that have 1s written to them are pulled high by the internal pull-ups, and in that
state can be used as inputs. As inputs, port 1 pins that are externally being pulled
low will source current because of the internal pull-ups.
Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. Port 2 emits
the high-order address byte during accesses to external memory that use 16-bit
addresses. In this application, it uses the strong internal pull-ups when emitting 1s.
Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. It also serves
the functions of various special features of the 80C51 Family as follows:
Port Pin Alternate Function
P3.0 RxD (serial input port)
P3.1 TxD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
VCC: Supply voltage
VSS: Circuit ground potential
Basically there are two types of 7-Seg display's: Common Cathode where all the
segments share the same Cathode. Common Anode where all Segments share the
same Anode. Here we will be only discussing the Common Anode type. In
common Anode in order to turn ON a segment the corresponding pin must be set to
0. And to turn it OFF it is set to 1. [8]
(a)
(b)
Fig 3.14 (a) 7-segment display pin out (b)interfacing 7-segment to a
microcontroller
Table 3.4 seven segment truth table
We can now interface a single 7-Seg to the microcontroller but for interfacing
multiple 7-seg's we use Scanning Principle where One 7-seg is displayed after
another but this process is very fast hence the flickering cannot be seen by human
eye. Figure 3.10 shows the circuit for interfacing two 7 segment displays.
When interfacing more than one 7-seg display the segment's (A-G) of all displays
are connected together whereas their ANODE (Cathode in case of CC displays)
are switched ON one after another. Consider we have to display '31' on the above
7-seg display so we TURN ON the first transistor by setting its corresponding pin
to 1 & then give the 7-seg equivalent code for '3' which is 4fh.[10]
Then we TURN OFF the first transistor & TURN ON the second & output its
corresponding 7-seg equivalent code of '1' i.e. 06h.Then we again go back to
display '3' this is a never ending loop.
CHAPTER FOUR
CONSTRUCTION AND OPERATION
4.1 CONSTRUCTION
The output of the last stage (the analog voltage) is fed to the ADC via the output of
LM35. After the conversion to digital signal, the out put is now fed to
microcontroller to process the converted data and then send the result to the display
unit ( 7-segement display system) which reflect exactly the temperature of the
surrounding.
Here, the 89c52 microcontroller is used to implement the temperature meter. This
chip needs to be programmed in order to adequately process the ambient
temperature sensed by the transducer (LM35). A program code was developed to
carry out this function using Assembly Language Programming. The program
entails reading the digital output from the ADC and converting it to 7-segement
display read out. It should ensure that the digital output of the ADC (analog-to-
digital converter) is properly represented using a &-segment display.
Seven-Segments cells are used to display the temperature. The main idea for this
display system, is to connect all the 7-segment cells together in parallel (all the cells
show the same digit), but only power the first cell, then switch the first cell off, and
power the second one, then do the same thing with the last one and repeat this cycle
at a very fast rate. If you provide the appropriate DATA to the cells at the
appropriate time, the number will be displayed without any noticeable flickering.
The decimal point is fixed (from the software) at the middle cell, so there is always
one number after the point.
All the cells are common anode type, the cathodes of each cell are connected with
the cathodes of the other cells, then directly connected to the Port of the
microcontroller.
4.2 TESTING
Like every electronic circuit, this project comprises the power supply unit, input
unit, processing unit and output unit. The following is the result of the individual
testing of the module:
1. POWER SUPPLY UNIT: this unit comprises the transformer, bridge
rectifier, filtering capacitor and a voltage regulator. All electronic gadgets
use a DC voltage source. In this work, TTL (Transistor-Transistor Logic)
was used, hence the need to use 5Volt source. The regulator 7805 stabilizes
the DC voltage to +5V. At the end of the construction, the test was ok. This
unit is very vital in any electronic circuit in that it supplies the required
energy to each module.
2. INPUT UNIT: The key component in this unit is the transducer, LM35
which is a temperature sensor. When subjected under certain temperature it
gives an output that is in consonance with the operational and working
principle.
3. PROCESSING UNIT : ADC0804 converts the analog output of the LM35
to digital signal. The output corresponded to the analog voltage supplied
from the transducer at a certain temperature. The reference voltage was fixed
such that ADC output reflects the ambient temperature on the transducer,
LM35. The ‘super processing ‘ module, the microcontroller gives the work
its automation feature.. it is the brain box of the project. It processes the
digital information from the ADC and display the result on a seven-segment
display. This actually requires some programming to drive the hardware. So,
without the software there won’t be any operation.
4. OUTPUT UNIT: It consists of the display and the output from the
controller, to the RF module. The display was multiplexed to accommodate
the four digit of the seven-segment needed for this project. This is as a result
of limited output pins required to be connected to each segment. During the
test, the module worked well.
This project was working well after all the necessary adjustment and consideration.
All the theories enumerated the previous chapter were implemented practical wise
to validate their various principles and operation. Generally, electronic circuit
comprises individual module interconnected to each other to achieve a certain task.
Therefore, it would be better if the project is tested and verified module by module.
Error in any module will definitely affect the required operation of the overall
circuit. This causes the circuit to malfunction.
REFERENCES
[1]. Nunnally, C.E., "Teaching Microcontrollers," Proc. of the 26 th Frontiers in Education Annual
Conference, Vol. 1, Nov. 1996, pp. 434-436.
[2]. http://www.8052.com/tutser.phtml
[3]. The 8051 microcontroller and Embedded systems using assembly and C Muhammad Ali
Mazidi, Janice Gillespie Mazidi http://www.avocetsystems.com/.
[4]. Keil Software, dScope Debugger, http://www.keil.com/.
[5]. Virtual Micro Design, Universal microprocessor Program Simulator (UMPS),
http://www.vmdesign.com/.
[6]. Alfredo del Río and Juan José Rodríguez Andina, UVI51: a simulation tool for
teaching/learning the 8051 Microcontroller, 30th ASEE/IEEE Frontiers in Education
Conference, Kansas City, 2000.
[7]. J. Axelson, “Serial Port Complete: Programming and Circuits for RS-232 and RS-485 Links
and Networks”, Lakeview Research, Madison, WI, 1998.
[8]. Circuit Cellar INK, the Computer Applications Journal, Issue 107, June 1999.
[9].www.pjrc.com/tech/8051/autobaud.html.
[10]. multiprocessor communication
www.8051projects.net/forum-t6680.html
[11]. Scott Mckenzie, “The 8051 Microcontroller”, Third edition, pp 218.
[12]. www.google.com/ ADC interfacing reference page.
[13].www.8052.com/Tutorial: Introduction to LM35 Interfacing
[14] www.rf-data.com