Ceska verze

Digital thermometer with MIN / MAX

    Introduction:
This digital thermometer with LED display allows you to measure and display temperature in the range of -40.0 ... +150.0 °C. The minimum and maximum measured temperature is recorded and it can be recalled or reset using the buttons.
    Construction:
The circuit is controlled by the IO1 microcontroller - Atmel AVR ATmega8A or ATmega8L. The integrated circuit IO2 type MCP9700A serves as a temperature sensor. It provides you output voltage linearly dependent on temperature, with a coefficient of 10mV/°C + 500mV. Thanks to the addition of the 500mV constant, it enables the measurement of negative temperatures without a negative output voltage. The IO2 circuit forms a temperature probe connected by a three-wire cable. If necessary, it's in a waterproof housing. A four-digit LED display with a common anode is used to display the temperature. The display is controlled in a multiplex. The cathodes of the display are connected to the PD port, anodes through resistors to pins PB0 to PB3. The multiplex frequency is about 100Hz. Resistors R1 to R4 determine the current of the display and thus its brightness. I assembled the display using a pair of two-digit LD-D036UPG-C with a very high brightness, which require a small current to achieve sufficient brightness. It is multiplexed "the other way" - in 8 steps of 4 identical segments (first all four segments A, then all four segments B, etc.). Thanks to this, 4 resistors are enough for the display, 8 are not needed. The thermometer uses the input of a single ended 10-bit AD converter of ATmega8A (ATmega8L). The resolution of the AD converter is increased to 11 bits using oversampling method and thus the measurement resolution is 0.1°C. Each time the value ​​is refreshed, 64 samples are created, these are added and the result is divided by 32. This gives a 11-bit result. For oversampling by 1 bit, 4 samples would be enough, but more samples will bring better stability and elimination of random errors. Since the AVR's internal voltage reference is not very accurate and cannot be adjusted, an external voltage reference IO3 is used - AP2138N-2.5, whose 2.5V output voltage enters the R5, P1, R6 divider. Using potentiometer P1, the input voltage of the AREF pin of IO1 is set to 2.048V, which ensures a slope of 0.1°C / 1mV. IO1 uses a built-in RC oscillator running at 1MHz frequency as a clock source. A crystal is not needed - the frequency is not critical for a thermometer. The thermometer is powered from a power supply of about 3.3 - 5.5 V when using a white, blue or pure green LED display. Red, orange, yellow and yellow-green displays have a lower voltage drop, so the circuit can work with them down to about 2.7V. The current consumption is roughly 4 - 20mA (most of it is the consumption of the LED display, it depends on the value of R1...R4 and the supply voltage).
    Calibration:
The calibration is done by connecting a precision digital voltmeter to C3 and setting the voltage to 2.048 V using P1. Alternatively, you can callibrate the thermometer according to a known temperature, such by immersion of a waterproof probe into crushed ice and seting to 0.0 °C, or according to a precise thermometer.
    Measurement:
The display DISP1 shows the temperature. The refresh rate is about 1.56 Hz (refreshed every 0.64s).
    Minimum / maximum function:
This thermometer monitors and stores the maximum and minimum temperature. This can be displayed by pressing TL1 and TL2 buttons - MIN and MAX. A moment after the button is released, the thermometer displays the actual temperature value again. The memory of the minimum and maximum can be reset by pressing both buttons simultaneously. Note: Monitoring minimum and maximum begins after a delay of about 6-7 seconds after switching on the thermometer, in order to avoid storing corrupted values immediately after switching on, when the circuit hasn't settled yet.
    Other versions:
I've also created a version with ATmega88(P)(A) with display brightness adjustment and power-off using buttons: Battery thermometer with MIN/MAX and adjustable brightness.

The AVR thermometer program for free download:
source code in assembler (ASM)
compiled HEX file (628 Bytes)
Low fuse = E1, High fuse = D9

How to write the program into the AVR is described here.

I can send you the programmed microcontroller. For more info click here.


The schematic of my DIY thermometer with minimum and maximum memory, LED display and Atmel AVR ATmega8A or 8L.


Testing my homemade max/min digital thermometer in a breadboard.


One more breadboard test. There's no photo of the finished one, because I conveted it to a Battery thermometer with MIN/MAX and adjustable brightness
.



Added: 13. VIII. 2022
home