Sometimes we have a need to measure the temperature of a room, of an object or just maybe a terrarium;
Today you have a great number of temperature sensors, analog and digital ones. If you want to use an ADC (Analog to Digital Converter) then you can use a thermistor for this project, however I prefer digital sensors. In this project I used the Dallas Maxim DS1820 (click for the datasheet) digital temperature sensor with the 1wire technology from Dallas Maxim.
It is not manufactured anymore but it is equivalent to its successor DS18S20. You can order a sample from Maxim, of course free of charge. This time the source code was not a problem, I found the source for this project in CodeVision?s C example folder (there are a lot of examples also for GNU AVR GCC), I just modified it a bit, I removed some of the code that we won?t need because I used only one DS1820 sensor however you can attach up to 8 sensors on one wire, cool isn?t it?!?! I had not a 4.7k resistor to connect between DQ (the middle pin from the sensor which is used to communicate with it the microcontroller and to read the temperatures) and Vdd, instead I used a 6.8k resistor; it will work fine, don?t worry. DQ is connected to I/O line 6 of PORT A. The microcontroller I used was the ATMega16 and a crystal of 4 MHz frequency; it should work with any other microcontroller as well. I won?t explain how I connected the LCD because I did it in one of my previous projects. It is connected to the PORT C, just to display the results (the current temperature).
Article by Sebastian Schmieg at http://www.e-dsp.com
Visit Here for more.