Sunday, July 6, 2008

Dual Channel Thermometer

Dual channel thermometer is simple PIC ADC based project. It’s a inexpensive thermometer with low cost components .Don’t used any high sensitive or high cost sensor for thermometer. I am using only simple silicon diode. Dual channel means this thermometers have two sensor for pinking temperature from two different place and it displayed on PC using C#.Net programming. To reduce cost I am used only parallel port for interfacing with PC. There is no any additional display devices such as LCD or seven segment display etc.

Circuit Diagram


Simply I draw circuit for this project. You can see that there is no any high cost devices, they are only commonly available components in local market. Two 1N4148 diode is used as temperature sensor. The anode of diodes connecting to VCC through a1K resistors, these resistors are sufficient to flow current through the diodes. Then connect anode of the diode to PIC ADC channels. I am using channel 2 and 3. If you want to measure temperature from two different place just place these diodes to two different places. The ADC output from the PIC put to PORTB. The PORTB connected to data port of the parallel port. To measure two different values from ADC input we are using a control port of the parallel port for switching between two different ADC input.

Software

I am using mikroC compiler for PIC programming. It is very easy to coding in mikroC. You can download demo version from their website.Here is PIC fimware for dual channel thermometer.


unsigned int temp;

void main() {

ADCON1 = 0x80; // Configure analog inputs and Vref

TRISA = 0xFF; // PORTA is input

TRISB = 0; // PORTB is output

TRISD =0xFF; //receive control port instructions

do {

if(PORTD.F2) //checking control port inputs

{

temp = ADC_Read(1)>>2; // Get results of AD conversion from channel 1

PORTB = temp; // Send lower 8 bits to PORTB

}

else

{

temp = ADC_Read(2)>>2; // Get results of AD conversion from channel 2

PORTB = temp; // Send lower 8 bits to PORTB

}

} while(1);

}

C#.Net programming

To reduce cost of display devices I used parallel port programming in c#. It is very easy to develop software for read data parallel port. But you need bi-directional parallel port and Inpout32.dll for reading parallel port.


No comments: