Design and Implementation of A Digital Thermometer With Clock
Design and Implementation of A Digital Thermometer With Clock
net/publication/319889725
CITATIONS READS
5 147
3 authors, including:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Aaron Onyan on 07 March 2022.
ABSTRACT
In this paper, the design of a digital thermometer with clock is presented. The design was achieved
using ATMEGA 328P PU Microcontroller Unit, MLX90614 Infrared Sensor for achieving contactless
measurement (wireless) and the DS1307 Real Time Clock (RTC) for accurate time keeping during the
measurement of this parameter.The MLX90614 is factory calibrated in wide temperature ranges from -
40 ºC to 125ºC for the ambient temperature and -70 ºC to 382.19ºC for object temperature, while the
DS1307 is a low-power clock/calendar with 56 bytes of battery-backed serial random access memory
(SRAM). Power is supplied using a regulated 9 V DC battery. The microcontrollers and RTC chip are
powered by 5 V DC. The temperature sensor and liquid crystal display (LCD) require 3.3 V DC for
operation and are supplied by passing the 5 V DC through a variable resistor. The sensors output
values are both fed into the microcontroller. While monitoring temperature and telling time, the
microcontroller sends the measurements in form of digital signal to the LCDs for display.This design
was compared with a standard infrared thermometer by taking the body temperature measurements of
two individuals at different times of the day. It was observed from the results that the difference between
the temperature readings of the two thermometers ranges from 0 to 1 °C
KEYWORDS: Infrared sensor, digital thermometer, microcontroller, real time clock, temperature.
(a) (b)
Figure 1: LCD Display: (a) ILI9340 LCD (b) Nokia 5110 LCD Pin Description
DESIGN AND IMPLEMENTATION OF A DIGITAL THERMOMETER WITH CLOCK 3
The ILI9340 LCD works with only 3.3V as the the temperature can be read. Hence they are
voltage value when the digital pins are read as used in digital thermometers (Jose et al, 2014).
high but the voltage value given out as high is The detector used in this design is the Melexis
5V, so in this design a CJMCU TXS0108E High branded sensor, MLX90614, shown in figure 2. It
Speed Full Duplex 8 Way Level Conversion is built from two chips, the infrared thermopile
Module was employed to step the digital pin detector MLX81101 and the signal conditioning
voltage down to the required 3.3V (Integrated ASSP MLX90302, specially designed to process
Circuits, 1999). the output of IR sensor. It was used because it
has an inherently stable response to DC
2.3. Processing Unit radiation, not too sensitive to ambient
The processing unit used in this work is the temperature variations, and it responds to a
ATMEGA 328P microprocessor. It receives broad infrared spectrum which doesn’t require a
analog signals from sensors connected to it and source of bias voltage or current (Engineering
converts these analog signals into digital signals Toolbox, 2015).
which can be displayed by the output unit (Stand The MLX90614 is factory calibrated in
Alone Microcontroller Circuit, 2015). wide temperature ranges from -40ºC to 125ºC for
the ambient temperature and -70ºC to 382.19ºC
2.4. Temperature Sensor (MLX90614) for object temperature. The field of view (FOV) of
Temperature sensors, when interfaced 35º offers an accuracy of ±0.2ºC; it covers any
with a microcontroller, help to convert wavelength from 5.5 μm to 15 μm. However, this
surrounding temperature to digital value so that accuracy is only rated for a range of 2 feet.
.
Figure 2: MLX90614 Temperature Sensor
The signal conditioning ASSP MLX90302 2.5. Time Sensor (DS1307 RTC)
combines a low noise programmable amplifier, a The DS1307 is a low-power
high resolution 17-bit ADC, and a powerful DSP clock/calendar with 56 bytes of battery-backed
unit. Therefore, the MLX90614 can be used in serial random access memory, SRAM
applications as a high accuracy and high (Engineering Toolbox, 2015). The clock/calendar
resolution thermometer. The operation of the provides seconds, minutes, hours, day, date,
signal conditioning MLX90302 is controlled by an month, and year information. The date at the end
internal state machine which controls the of the month is automatically adjusted for months
measurements and calculations of the object and with fewer than 31 days, including corrections for
ambient temperatures. The onboard temperature leap year. The DS1307 operates as a slave
cell is the corresponding ambient temperature device on the I2C bus. Access is obtained by
Ta, and the MLX81101 thermopile cell is the implementing a START condition and providing a
corresponding object temperature To. Both device identification code followed by a register
temperature measurements have a resolution of address. Subsequent registers can be accessed
0.02ºC. Data is read by RAM cells using the sequentially until a STOP condition is executed.
SMBus 2-wire interface or the PWM digital When VCC falls below 1.25 x backup supply
output. For the purpose of design, power, and voltage, VBAT (i.e. 1.25 x VBAT), the device
portability the first method is used. terminates an access in progress and resets the
4 BENJAMIN O. AKINLOYE, AARON O. ONYAN AND DONALDSON E. OWEIBOR
device address counter. Inputs to the device will Moreover, this pin has an auxiliary function for
not be recognized at this time to prevent building an external voltage regulator.
erroneous data from being written to the device While the wiring is straight forward, the
from an out-of tolerance system. When VCC falls software interfacing the wiring between the
below battery voltage VBAT, the device switches MLX90614 and microcontroller is not. The
into a low-current battery-backup mode. Upon standard wiring library doesn’t work for the
power-up, the device switches from battery to MLX90614 because it involves SMBus
VCC when VCC is greater than VBAT +0.2V and compatible 2-wire interface, hence the i2cmaster
recognizes inputs when VCC is greater than 1.25 library was implemented.
x VBAT. The value of the backup supply voltage In the coding part, the data was read
changes with time. from internal RAM where ambient temperature
The DS1307 uses an external 32.768kHz Ta is stored at 0x006 and object temperature To
crystal. The oscillator circuit does not require any is stored at 0x007. With the resolution of 0.02ºC
external resistors or capacitors to operate. If per LSB used, the following forms part of the
using a crystal with the specified characteristics, code to calculate the temperature:
the startup time is usually less than one
second.The accuracy of the clock is dependent tempData = (double)(((data_high & 0x007F) <<
upon the accuracy of the crystal and the 8) + data_low)
accuracy of the match between the capacitive
load of the oscillator circuit and the capacitive Where tempData is data at RAM address 0x007
load for which the crystal was trimmed. Additional of the object temperature To
error will be added by crystal frequency drift
caused by temperature shifts. External circuit tempData = (tempData x tempFactor)-0.01
noise coupled into the oscillator circuit may result
in the clock running fast. Where tempFactor is resolution of MLX90614,
0.02 ºC
2.6. Software Design
The MLX90614 has two SMBus Celsius = tempData - 273.15
compatible communication pins, Serial Data
(SDA) and Serial Clock (SCL). However, the Fahrenheit = (Celsius x 1.8) + 32
DS1307RTC chip used for telling time and the
MLX90614 both make use of the SDA and the Where Celsius is the object temperature in ºC,
SCL pins which lead to the use of two and Fahrenheit is the object temperature in ºF.
ATMEGA328P microcontrollers.
SDA is a digital input and output pin
which is used for both the external PWM module 2.7. Flow Chart of the System
output of the measured object temperature and The design flow diagram in figure 3 shows the
the digital input and output for the SMBus flow of algorithm programmed into the
(System Management). On the other hand, the microcontroller. It illustrates the command given
SCL is only a digital input which is used as the to the chip as input and the output given out.
clock for SMBus compatible communications.
DESIGN AND IMPLEMENTATION OF A DIGITAL THERMOMETER WITH CLOCK 5
START
MICROCONTROLLER
PIN
2.8. Mode of operation of a body while the RTC is used to tell time. The
Power is supplied into the system by a 9V DC sensors output values are both fed into the
battery which is then passed through a voltage microcontroller. While monitoring temperature
regulator to give a 5V DC output. The 5V DC is and telling time, the microcontroller sends the
used to power the microcontrollers and RTC measurements in form of digital signal to the LCD
(Real Time Clock) chip. The temperature sensor for display.The LCD displays the temperature
and LCD display use 3.3V DC for operation and parameters measured and tells time continuously
this voltage was supplied by passing 5V DC until a fault occurs.The circuit diagram of the
through a variable resistor. The MLX90614 is a digital thermometer with clock is shown in figure
temperature sensor used to tell the temperature 4.
6 BENJAMIN O. AKINLOYE, AARON O. ONYAN AND DONALDSON E. OWEIBOR
Thereafter, the circuit was implemented on a breadboard. Figure 6 shows the breadboard
implementation.
Table 1: Comparison of temperature measurements of two persons using the constructed digital
thermometer and the commercial infrared thermometer
Date Constructed thermometer temperature Commercial thermometer
Time temperature
Person A Person B Person A Person B
16/12/2015 35°C/95.1°F 34.9°C/94.8°F 35.5°C/95.5°F 34.9°C/94.8°F
06:00AM
16/12/2015 35.9°C/96.6°F 35.5°C/95.9°F 36.9°C/97.1°F 36.1°C/96.9°F
12:00PM
16/12/2015 34.4°C/93.9°F 34.9°C/94.8°F 35.1°C/95.1°F 35.4°C/95.6°F
06:00PM
17/12/2015 34.9°C/95.5°F 34.6°C/94.2°F 35.1°C/95.1°F 35°C/95.1°F
06:00AM
17/12/2015 36°C/96.8°F 36.2°C/97.1°F 36.3°C/97.4°F 36.5°C/97.7°F
12:00PM
17/12/2015 35.5°C/95.5°F 35.8°C /95.7°F 36°C/96.8°F 36.2°C/97.1°F
06:00PM
DESIGN AND IMPLEMENTATION OF A DIGITAL THERMOMETER WITH CLOCK 9
A graph of the measured temperatures for Person A is presented in figure 8.
37.5
37
34.5
34
0 20 40 60
Time
Figure 8: A graph of the measured temperatures using the constructed digital thermometer and the
commercial infrared thermometer