This project shows the temperature on a three digit 7-segment display, it measures the temperature from -9.5 0C to 99 0C in 0.5 C steps. The last digit shows the 0.5 degrees. Because of the LED display the temperature is also readable in the dark.
The DS1621 is used to measure the temperature. The DS1621 has a 2 wire serial interface, which is a bidirectional bus with a speed up to 400Kbs. Up to eight devices of the same type can be controlled by the bus. In this case only one device is connected to the AT2313 microcontroller. The 2 wire bus is also called I2C. I2C is an abbreviation for IC Inter Circuit. The DS1621 has also a build in programmable thermostat, which is not used in this circuit.
The AT2313 is used the control the two wire serial interfacing with the DS1621 and to translate the information for showing on the three digit 7-sement display. The reading of the temperature from the DS1621 happens every 3 seconds. A ceramic resonator is used for clocking the microcontroller.
The three 7-segment displays are of the common cathode type, at each cathode the display is connected to a transistor for amplifying the current. The transistors are of the NPN type and are controlled by the AT2313 microcontroller. Each segment of the display is connected to a 200 Ohm resistor to limit the current of the AT2313 port. The multiplexing of the three displays is handled in the software. Each display is lights up consecutively for 5ms seconds. The LED digits have a height of 14,2mm (0.56").
The circuit needs a 3 to 5V DC power supply and draws about 100mA current. It can also be supplied with two 1.5 volt batteries, but then the brightness of the LED's will be less. Two D-type batteries will last for about one month.
The program is written in the BASCOM-AVR programming language. The program uses about 1Kb of the 2Kb flash memory that the AT2313 has. BASCOM is a programming language for AVR-microcontrollers based on BASIC, a demo version can be downloaded for free and can be used for up to 4Kb of programming code. BASCOM has special commands for driving chips with the two wire interface. The BASCOM program compiles the program code into the hex-file that can then be loaded into the microcontroller to make the circuit work. BASCOM has also a build-in programmer to get the hex-file into the microcontroller.
No comments:
Post a Comment