DESIGN AND IMPLEMENTATION OF A DIGITAL THERMOMETER WITH CLOCK

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 oC to 125oC for the ambient temperature and -70 oC to 382.19oC 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


INTRODUCTION
Thermometer is an instrument used in measuring the temperature.The name thermometer is coined from the Greek words thermo, meaning "warm", and meter, meaning "to measure".So thermometers measure temperature by using materials that change in some way when they are heated or cooled (Saidu et al, 2014;Bellis, 2011).Measurement of temperature has been a usual process since the early 11 th century.Monitoring of temperature of a particular place or system is important so as to monitor the behavior of such a system (Med, 2002).
Temperature monitoring devices are of integrated technology and are found in the area of electronics, computers, material and information Engineering.They play an important role in the medical/patient simulation system (Péter & Balázs, 2009).With the help of the temperature monitoring device, a doctor can get a lot of information about the condition of health of the individual.Patients who pay no attention to their body temperature are easily susceptible to contracting diseases/infections as well as some kind of sickness.Thus, for a good guarantee of the patient's daily life, a monitor designed for measuring the body temperature at a specific time is needed.
Temperature measuring devices are also used in medical/fitness equipment, human body temperature monitoring, industrial applications (e.g.fractional distillation processes), and also in research laboratories, such as chemical and chemistry laboratories (Abayomi et al, 2013).Before this time, temperature has been measured using analogue meter.This means of measurement is subjected to error of parallax during the reading of the measurement.Due to the precision requirements of the applications of a thermometer, there is a need to measure the quantity digitally in order to eliminate parallax error.Besides, mercury-in-glass thermometers were used for temperature measurements only while separate instruments were required for checking the time.Also, mercury-in-glass thermometers have to be handled with extreme care due to their fragile nature (Abayomi et al, 2013).Moreover, in recent times, technology has moved from the phase of analogue to digital.
Hence, this work focuses on temperature measurement using digital thermometer.It presents the design and implementation of a digital thermometer with clock to monitor the temperature of a system while also checking the time/period at which the measurement is made.

DESIGN METHODOLOGY
This section presents an overview of the design calculations for the digital thermometer with clock.

2.1.
Voltage Regulator The voltage supplied by the battery used is 9 V, but the components in this design require a range of 3.3 V -5V so the 7805 voltage regulator was used to produce a 5 V output.Since some components require 3.3 V, a variable resistor was connected in series with the 5 V output to give a 3.3 V output.
For regulation to be maintained (Theraja & Theraja, 2005): V i(min) =+7.5 V where V i(min) is the minimum input voltage to the IC voltage regulator.
For 7805 voltage regulator, V (out) =5 V. Thus to maintain the regulated +5 V dc supply from the output of the IC regulator 7805, a capacitor of more than 100nF and preferably in the region of 1 to 10uF should always be connected across the input terminal and ground with the wiring as short as possible.If the value of the output capacitor is too large, it has a detrimental effect on the regulator's transient response.Between 1 and 10uF is usually a good choice (Filtering Capacitor, 2015).
A decoupling capacitor is a capacitor used to decouple one part of an electrical network (circuit) from another.Noise caused by other circuit elements is shunted through the capacitor, reducing the effect it has on the rest of the circuit.In this design, the value of capacitor used between the crystal oscillators is 22 pF (Decoupling Capacitor, 2015).

Liquid Crystal Display
The LCD displays used in this work are the Nokia 5110 LCD and ILI9340 LCD accorrding to the design circuit.The ILI9340 LCD works with only 3.3V as the voltage value when the digital pins are read as high but the voltage value given out as high is 5V, so in this design a CJMCU TXS0108E High Speed Full Duplex 8 Way Level Conversion Module was employed to step the digital pin voltage down to the required 3.3V (Integrated Circuits, 1999).

Processing Unit
The processing unit used in this work is the ATMEGA 328P microprocessor.It receives analog signals from sensors connected to it and converts these analog signals into digital signals which can be displayed by the output unit (Stand Alone Microcontroller Circuit, 2015).

Temperature Sensor (MLX90614)
Temperature sensors, when interfaced with a microcontroller, help to convert surrounding temperature to digital value so that the temperature can be read.Hence they are used in digital thermometers (Jose et al, 2014).The detector used in this design is the Melexis branded sensor, MLX90614, shown in figure 2. It is built from two chips, the infrared thermopile detector MLX81101 and the signal conditioning ASSP MLX90302, specially designed to process the output of IR sensor.It was used because it has an inherently stable response to DC radiation, not too sensitive to ambient temperature variations, and it responds to a broad infrared spectrum which doesn't require a source of bias voltage or current (Engineering Toolbox, 2015).
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.The field of view (FOV) of 35º offers an accuracy of ±0.2ºC; it covers any wavelength from 5.5 μm to 15 μm.However, this accuracy is only rated for a range of 2 feet.
. The signal conditioning ASSP MLX90302 combines a low noise programmable amplifier, a high resolution 17-bit ADC, and a powerful DSP unit.Therefore, the MLX90614 can be used in applications as a high accuracy and high resolution thermometer.The operation of the signal conditioning MLX90302 is controlled by an internal state machine which controls the measurements and calculations of the object and ambient temperatures.The onboard temperature cell is the corresponding ambient temperature Ta, and the MLX81101 thermopile cell is the corresponding object temperature To.Both temperature measurements have a resolution of 0.02ºC.Data is read by RAM cells using the SMBus 2-wire interface or the PWM digital output.For the purpose of design, power, and portability the first method is used.

Time Sensor (DS1307 RTC)
The DS1307 is a low-power clock/calendar with 56 bytes of battery-backed serial random access memory, SRAM (Engineering Toolbox, 2015).The clock/calendar provides seconds, minutes, hours, day, date, month, and year information.The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections for leap year.The DS1307 operates as a slave device on the I2C bus.Access is obtained by implementing a START condition and providing a device identification code followed by a register address.Subsequent registers can be accessed sequentially until a STOP condition is executed.When V CC falls below 1.25 x backup supply voltage, V BAT (i.e.1.25 x V BAT ), the device terminates an access in progress and resets the device address counter.Inputs to the device will not be recognized at this time to prevent erroneous data from being written to the device from an out-of tolerance system.When V CC falls below battery voltage V BAT , the device switches into a low-current battery-backup mode.Upon power-up, the device switches from battery to V CC when V CC is greater than V BAT +0.2V and recognizes inputs when V CC is greater than 1.25 x V BAT .The value of the backup supply voltage changes with time.
The DS1307 uses an external 32.768kHz crystal.The oscillator circuit does not require any external resistors or capacitors to operate.If using a crystal with the specified characteristics, the startup time is usually less than one second.The accuracy of the clock is dependent upon the accuracy of the crystal and the accuracy of the match between the capacitive load of the oscillator circuit and the capacitive load for which the crystal was trimmed.Additional error will be added by crystal frequency drift caused by temperature shifts.External circuit noise coupled into the oscillator circuit may result in the clock running fast.

Software Design
The MLX90614 has two SMBus compatible communication pins, Serial Data (SDA) and Serial Clock (SCL).However, the DS1307RTC chip used for telling time and the MLX90614 both make use of the SDA and the SCL pins which lead to the use of two ATMEGA328P microcontrollers.
SDA is a digital input and output pin which is used for both the external PWM module output of the measured object temperature and the digital input and output for the SMBus (System Management).On the other hand, the SCL is only a digital input which is used as the clock for SMBus compatible communications.
Moreover, this pin has an auxiliary function for building an external voltage regulator.
While the wiring is straight forward, the software interfacing the wiring between the MLX90614 and microcontroller is not.The standard wiring library doesn't work for the MLX90614 because it involves SMBus compatible 2-wire interface, hence the i2cmaster library was implemented.
In the coding part, the data was read from internal RAM where ambient temperature Ta is stored at 0x006 and object temperature To is stored at 0x007.With the resolution of 0.02ºC per LSB used, the following forms part of the code to calculate the temperature: Where Celsius is the object temperature in ºC, and Fahrenheit is the object temperature in ºF.

Flow Chart of the System
The design flow diagram in figure 3 shows the flow of algorithm programmed into the microcontroller.It illustrates the command given to the chip as input and the output given out.After the design was done, the circuit was simulated using Proteus version 7.This was achieved using an open source prototyping platform called Arduino.The ArduinoUNO Rev3 board used is equipped with Atmega 328P-P microcontroller chip which works with C programming language.The temperature and time source codes were written in C programming language, compiled and burned into the microcontroller.The simulation was carried out in the Proteus environment using voltage as input to the temperature sensor, while push buttons (tactile switches) were used to set the time.The output of the temperature sensor is

BENJAMIN O. AKINLOYE, AARON O. ONYAN AND DONALDSON E. OWEIBOR
processed by the microcontroller and displayed on the NOKIA 5110 LCD as temperature, while the time is displayed on the ILI9340 LCD.As the input voltage is varied, the corresponding temperature is displayed on the LCD.When the input voltages were 1 V, 2 V and 10 V, the temperature values displayed on the LCD were 0.99 o C, 2 o C and 11 o C respectively.This simulation shows that the digital thermometer will be able to sense and display temperature and time when the actual implementation is done.The Proteus simulation diagram is shown in figure 5.  Finally, the circuit was implemented on a Vero board.The Vero board was first inspected to ensure there were no wrong linkages between the dotted lines.Components were placed on the plain side of the board, with their leads protruding through the holes.The leads are then soldered to the copper tracks on the other side of the board to make the desired connections.After soldering each unit, continuity test was carried out to ensure that proper soldering was done.The soldered circuit was housed in a case as shown in figure 7.  1.From the curves in figure 8, it can be seen that the temperature readings from the constructed thermometer (using MLX90614 infrared sensor) matches closely with that of the commercial infrared thermometer (ST-8861 IR THERMOMETER), with small deviations between the two temperatures.From the results presented in table 1, the difference between the temperature readings of the two thermometers for the two individuals ranges from 0 to 1 °C.With some improvements in the constructed thermometer, the accuracy will improve.

CONCLUSION
The design and implementation of a digital thermometer with clock, which is the focus of this paper, was achieved.The digital thermometer was designed in such a way that it can monitor temperature without contact, while also checking the time at which the measurement is made.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.The design allows dynamic application of the digital thermometer in any field where temperature is being measured.

REFERENCES
Abayomi-Alli A., Etuk E. J., Ezomo, P. I., Izilein, F. A., Akingboye, A. Y and Erameh, K. B., 2013 Figure 1 (a) shows the diagram of the ILI9340 LCD which is used to display time, while figure 1 (b) depicts the pin description of the Nokia 5110 LCD which is used for displaying the temperature.

Figure 3 :Figure 4 :
Figure 3: Flow chart of the system

Figure 7 :
Figure 7: Constructed digital thermometer with clock

Figure 8 :
Figure 8: A graph of the measured temperatures using the constructed digital thermometer and the commercial infrared thermometer

Table 1 :
Comparison of temperature measurements of two persons using the constructed digital thermometer and the commercial infrared thermometer Date Time