Temperature sensors come in various shapes and sizes, they also come in different colors and number of pins but above all these differences one difference must not be taken for granted- how to read the temperature data from it. Maybe the simplest form of a temperature sensor is the thermistor, it has two wires, and the resistances between these two wires vary depending on the temperature. This type of sensor requires an ADC to convert the analog signal into digital. However modern temperature sensors now come with their built in ADC and their outputs can be accessed serially. There are three commonly used serial protocols SPI, I2C and 1 Wire, these vary on the number of wires and on the way data is accessed.
In this project the DS1820 is used to demonstrate how to read temperature data from a temperature sensor which communicates using the 1-Wire protocol. The DS1820 is a three pinned temperature sensor, it actually looks more like a transistor – but it’s not! PIC16F628A was used to read the temperature data from the sensor, after data is read it will then be displayed in a 16×2 LCD. The 1-Wire library of MicroC was used to code the firmware for this project.