Ceska verze

Dual AVR Thermometer (internal + external / laboratory) with MIN / MAX

    Introduction:
This dual digital thermometer allows you to simultaneously measure and display the indoor and outdoor temperature. When used as a laboratory thermometer, it displays the temperature of the tested object and the ambient temperature. First channel measures in the range -40.0 ... +150.0 °C and the second one in range of -9.9 ... +99.9 °C. For both channels the minimum and maximum value is stored. It can be recalled or reset by the buttons.
    Construction:
The circuit is controlled by a microprocessor IO4 - Atmel AVR ATmega8A, ATmega8 or ATmega8L. Integrated circuits IO1 and IO2 (MCP9700A) serve as a temperature sensors. They provide the output voltage linearly dependent on temperature, with a coefficient of 10mV / °C + 500 mV. Thanks to the 500mV constants added, they allow the measurement of negative temperatures without the negative output voltage. Probes are made of circuits IO1 and IO2. IO1 forms the outer measurement sensor. it is built into a probe on a three-wire cable. If necessary, it is encapsulated in a waterproof container. It is designed to measure the outdoor temperature or temperature of the examined object. IO2 forms the inner probe designed to measure the ambient temperature (indoor temperature). To display the temperature two LED displays are used. Channel 1 uses a four-digit display and channel 2 three-digit display. The displays are controlled in multiplex. Cathodes are connected to port D, anodes through the current amplifying transistors T1 ... T7 to port B except PB7. Frequency of multiplexing is about 100Hz. Resistors R1 to R8 determine current into displays and thus their brightness. As DISP1 you can use for example red CA56-12SRWA. DISP2 can be yellow T-5631BUY-11 or red BA56-12SRWA. Thermometer uses two inputs of single-ended 10-bit AD converter in ATmega8(A)(L). Resolution of the AD converter is increased using resampling to 11 bits and thus achieve measurement resolution of 0.1 °C. During each refresh, 64 samples are created, they are summed and the result is divided by the 32. This generates 11-bit result. For oversampling to get 1 more bit, 4 samples would have been enough, but the large number of samples allows better stability and eliminate random errors. Because the internal voltage reference of AVR is not very accurate and can not be adjusted, the external adjustable reference witg IO3 - TL431 is used. Output voltage of 2.495 V enters the divider R11, P1, R12. Using P1 the input voltage of AREF pin of IO4 is set to 2.048 V, which ensures the of 0.1 °C / 10mV ratio. IO4 uses the internal callibrated RC oscillators running at 1MHz as the clock source. Crystal is not needed - frequency is not critical for thermometer. The thermometer is powered from a 5V +/- 10% supply. The current consumption is about 40-50 mA (most of it is the consumption of the LED display). Stabilized voltage 5V can be created by a simple circuit with a 7805 (use suitable fuse at the input). You can also use a 5V wall adapter (should be stabilized, as non-stabilized adapters have excessive deviation).
    Calibration:
Calibration is performed connecting precision digital voltmeter to C3 and setting voltage to 2.048 V using P1. Alternatively, you can callibrate the thermometer according to known temperature, such by immersion of thermometer in waterproof probe into ice crushed and setind to 0.0 °C, or according to a precise thermometer.
    Measurement:
DISP1 display shows the temperature of probe 1 (IO1), DISP2 the temperature of internal sensor (IO2). If the temperature is out of range or thermometer has malfunctioned (Unexpected input voltage ADC0 and ADC1), the symbol "_ _._" appears. Data refresh rate is about 0.8 Hz.
    Minimum / maximum function:
Thermometer monitors and stores maximum and minimum temperature for both channels. This can be displayed by pressing TL1 and TL2 buttnons - MIN and MAX. Moment after the button ir released, the thermometer displays the current temperature value again. Memory of the minimum and maximum can be reset by pressing both buttons simultaneously. Note: Monitoring minimum and maximum begins after a delay of 15 seconds after switching on the instrument, in order to avoid storing a meaningless values immediately after switching on, when circuit is not settled yet.

The AVR thermometer program for free download:
source code in assembler (ASM)
compiled HEX file (898 Bytes))
How to write the program into the AVR is described here.

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


Dual AVR Thermometer schematic (internal + external / laboratory) with MIN / MAX


Configuration bits setting


Testing the dual thermometer in breadboard.


Building it on a PCB.


Testing the thermometer PCB board


Finished dual thermometer built into a box.


Video - testing the dual AVR thermometer



Added: 28. 9. 2012
home