Digital Thermometer PDF
Digital Thermometer PDF
Digital Thermometer PDF
Abstract: In the field of healthcare, temperature monitoring has assumed a very vital role both in the
management of patient’s condition and general hospital storage facilities. Current advancements in the
technology of temperature measurement have led to a huge variety of sensors and measuring instruments now
being available for making accurate measurements. Most of the types available locally are the analogue type. In
this work, a digital thermometer has been designed and constructed based on ATMega16 microcontroller using
LM35 as the temperature sensing device. The design is in four modules; power supply, temperature sensor,
LCD device and ATmega16 modules. While the ATmega16 forms the main control element, the temperature
sensor senses the temperature to be measured and converts it to a corresponding analogue voltage. The
measured temperature is displayed on a 16 by 2 Character LCD incorporated in the system. The system was
tested and the results showed a mean deviation of from the readings when compared to a standard
digital thermometer (ST-9269 MULTI-STEM THERMOMETER) reading. The thermometer is most suitable at
higher temperatures.
Keywords: Design, microcontroller, thermometer, LCD, Temperature.
I. Introduction
The name thermometer is coined from the Greek words thermo meaning "warm" and meter, "to
measure" (Wikipedia, 2011). Thermometers measure temperature, by using materials that change in some way
when they are heated or cooled (Bellis, 2011).
The invention and creation of the first working thermometer has been credited variously to Abu Ali
Ibn Sina, Cornelius Drebbel, Robert Fludd, Galileo Galilei andSantorioSantorio (Helden, 1995;Sigurssen, 2003;
Wikipedia, 2011). Modern thermometers are calibrated in standard temperature units such as Fahrenheit or
Celsius and Kelvin. A thermometer has two important elements: the temperature sensor in which some physical
change occurs with temperature, plus some means of converting this physical change into a numerical value
(Wikipedia, 2011). The temperature precision or resolution of a thermometer is simply to what fraction of a
degree it is possible to make a reading.
In this paper a digital thermometer was designed and constructed using AVR microcontroller device.
The block diagram for the thermometer is as shown in fig 1.The design is in four modules; power supply,
temperature sensor, LCD device and ATmega16 modules. While the ATmega16 forms the main control
element, the temperature sensor senses the temperature to be measured and converts it to a corresponding
analogue voltage. The digital value of the measured temperature is then displayed on an LCD device. The power
supply section provides the required voltages for the other three sections.
LM35 temperature
sensor circuit AVR microcontroller LCD circuit
Power supply
unit
II. Design
Power Supply
The power supply requirements for the three sections of the project are all 5V (LM35 Data sheet, 2006;
ATmega16 Data sheet, 2007; LCD data sheet, 2000). An LM7805 voltage regulator was used to provide steady
5V supply for the three sections. For the voltage regulator to regulate properly provision must be made for drop
out voltage. For this reason the input voltage to the regulator is specified (LM7805 Data sheet, 2011).
7V ≤ Vin ≥ 20V
A 9V battery was used as the input voltage to the regulator.
The supply connections to the various sections is shown in Figure 2
1
10 32
C1 LM35 Sensor LCD
ATmega16 100nF
2 5 15 16
11 31
GND
GND GND
GND
POWER 5V
SUPPLY
GND
LCD circuit
The LCD employed is a 16 x 2 type capable of displaying 32 characters in alphanumeric form. It has a
wide range of LCD driver power from -3 to 1V with high speed MPU bus interface of 2MHZ when the supply
voltage is Vcc = 5V. It can also be configured as 4 bit or 8 – bit interface enabled to transmit or receive data in
either 4 bits or 8 bits. It consumes very small power with automatic reset circuit that initializes the
controller/driver after power on. Internally there is an oscillator that has external resistors (LCD Data book).
The LCD was configured to drive its dot-matrix under the control of 4- bit output of the microcontroller.
A regulated supply of 5V was used to supply the chip which is within the recommended supply voltage of the
chip. A 100Ω resistor was included as a current limiting resistor. The pin 16 of the chip is the V cc while pin 1 is
the ground and was connected to the 0 line of the supply. Since only four bits are used to receive data from the
micro, the upper nibble of the byte line was used while the lower nibble (Do to D3) was connected to the ground
as recommended in the data sheet. To achieve this, pins 7, 8, 9 and 10 (upper nibble) were grounded while pins
11 to pin 14 (lower nibble) were connected to receive the 4-bit data from the main micro. A variable resistor is
provided to adjust the brilliance of the LCD. The value as recommended in the datasheet is from 10k to 30k. For
this project, a 10k variable resistor was used to vary the brightness of the LCD. Pin 5 of the LCD is used as the
enable pin to activate the device and set it for operation. Pin 4 is the reset pin that is used to clear the registers of
the LCD. The data transfer from the microcontroller is completed after the 4 bit data has been transferred twice.
The order of transfer is that the four lower order bits (D 4 to D7) are transferred before the four higher order bits
(Do to D3).
The circuit configuration of the LCD circuit is as shown.
16 X 2 Character LCD
2 3 1 4 5 6 7 8 9 10 11 12 13 14 15 16
5V DC R2
100R
GND GND 5V DC
GND
10k
50% RS EN D4 D5 D6 D7
GND
To ATMega16
Figure 4: The LCD circuit
ATmega16 AVR
MICROCONTROLLER
12
OSCILLATOR
CIRCUIT 13 D7
29
28 D6
TO LCD
27 D5
26 D4
25 EN
24 RS
Figure 7: ATmega 16 circuit
The temperature condition at any instant as sensed by the LM35 is displayed on a Liquid Crystal Display
(LCD). To do this the ATmega16 is programmed to copy the output of the ADC and convert the result to
ASCII then transferred to the LCD to be displayed. The flow chart below shows the software algorithm of the
AVR microcontroller.
start
Convert to digital
Convert to ASCII
Send to LCD
Stop
The LM35 circuit was constructed with the capacitor connected very close to the IC. The wires were covered
up with a tape which will ensure that the leads and wires are all at the same temperature at the surface, and that
the LM35 die’s temperature will not be affected by the air temperature to ensure accuracy. The wire was twisted
together to reduce the length hence making it more convenient and beautiful. The constructed temperature
sensor is shownas in plate 1
The constructed LCD circuit is shown in plate 3. The components were placed at the back of the board for
casing purpose.
THERMOMETER TESTING
To test the accuracy of the constructed thermometer a digital thermometer type (ST-9269 MULTI-
STEM THERMOMETER) was obtained and used to conduct an experiment to compare the temperature
measurements of the two. The jug as shown in plate 4 was half filled with hot water and the two sensors were
inserted through a hole and above the water to measure the temperature of the enclosure at random intervals.
IV. Results
The result of the experiment to compare the accuracy of the constructed thermometer is tabulated in table 1
Table 4: Temperature of the two thermometers
System temp (oC) Digital temp (oC) difference
33 33.2 0.2
38 37.9 0.1
40 39.7 0.3
42 42.5 0.5
46 46.3 0.3
48 47.9 0.1
50 50.0 0.0
52 52.3 0.3
56 55.9 0.1
57 57.1 0.1
V. Discussion
As could be seen from the table the difference ranges from 0.0 to 0.5. The results obtained as tabulated
show that there are small deviations between the two temperatures. The possible reason for the slight difference
in the measured temperatures is that the resolution of the ADC is 1 0C. This means that temperatures are rounded
up to the nearest whole number during ADC conversion process. The measured temperature is therefore likely
to have error of 0 to ± 0.5 0C from the actual value. The percentage error is significant at low temperature and
negligible at higher values.
VI. Conclusion
In this manuscript, a digital thermometer has been designed using an AVR microcontroller as the heart of
the system. To sense the temperature to be measured and LM35 sensor was employed. The measured
temperature is then converted to digital format by an ADC located internally in the AVR microcontroller and
displayed on an LCD.
It is suggested that this thermometer may be improved upon by using a more sensitive sensor to make it
suitable for measurements at lower temperatures. A memory device may also be incorporated to store the
measured results.
References
[1] ATmmega16 Data Book. (2001, November 4). Atmega16. Retrieved May 5, 2011, from ATmel corporation: http;//www.atmel.com
[2] Bellis, M. (2011). The history of thermometer. Retrieved November 4, 2011, from The New York Times Company:
About.com.Inventors
[3] Halden, A. V. (1995). The Thermometer. Retrieved January 15, 2011, from The Galileo Project.
[4] LM35 Data Book. (2000, 11). LM35 Presition Centigrade Temperature Sensors. Retrieved May 5th, 2010, from National
Semiconductor corporation: http;//www.national.com
[5] LM7805Databook. (2001). KA78XX/KA78XXA 3-Terminal1A positive voltage regulator. Retrieved SEPTEMBER 6, 2009, from
Fairchild Semicondoctor Corporation: http;//www.fairchildsemi.com
[6] Sigurssen, A. (2003, October 5). History of the thermometer. Retrieved Nuvember 28, 2011, from Newsfinder: Newsfinder.org
[7] Wikkipedia. (2011, September 18). Thermometer. Retrieved December 7, 2011, from Wikkipedia the free encyclopedia.