Description
This circuit is one of my first applications of a microcontroller. It is a small thermometer with a 2×16 characters display (see) that shows the current temperature and extreme values, i.e. minimum and maximum temperature. The PCB is designed to fit behind the display so that it is possible to build up a quite small device.
This circuit should not be understood as a ready and working device, but as a platform to experiment, because there are some minor issues. Because of the placement of the temperature sensor on the pcb its measurement values are off by one or two degrees when the voltage regulator gets warm. Additionally the circuit - particularly the display - needs too much current so that it cannot be operated with small batteries over more than a few days.
The Hardware
I have used an AT90S2313 microcontroller from Atmel. It is connected through a 2-wire-bus (compatible to the Philips I2C-Bus), a small eeprom to save the minimum and maximum values and to the temperature sensor, a DS1621 from Dallas Semiconductors (now Maxim).
Additionally there are connectors for programming the controller, for connecting more I2C-Devices, a push button, the supply voltage and to connect the circuit to the serial interface of a PC. The circuit can operate at 6V - 18V from a power supply or batteries, because a 5V voltage regulator is used. The display has a built-in background light, but I disabled it because it needs too much current that warms the temperature sensor. But it is possible to connect an external sensor to the bus to overcome this problem.
There are two jumpers in the circuit. One is connected to reset of the controller and should be open. It can be shortened to reset the controller if it hangs (this should not happen...). The other jumper should be opened to program the controller in-circuit. It disconnects the display, the temperature sensor and the eeprom from VCC. After programming it must be shortened to let the thermometer work.
The Software
There are two versions of the firmware of the microcontroller. One is written in Assembler for avra Assembler. It consists of multiple independent units (I2C-Bus, UART, Delays, Display, etc.) that can easily be adapted to be used in other projects.
For comparsion I have written a version in C for avr-gcc with the same functions (display of temperature, minimum und maximum). Although I tried to write compact code in assembler the C version needs only slightly more program memory. (978 Bytes for assembler vs. 1024 Bytes for the C version).
Due to the structure of C this version is better modularized so that each functional unit can easily be used in other projects. To simplify this, all functions are documented in Doxygen style.
Download
- Eagle-project (PCB layout), C source code and documentation (Version 07/01/2007 with improved resolution of temperature values): avrtherm-20070107.tar.gz
- Eagle-project (PCB layout) with assembler and C source code (Version 11/27/2004): avrtherm-20041127.zip
- API -Documentation of the C Sourcecode: avrtherm-doc-20041127.tar.gz