Increase your Embedded skills with our new online classes (from Just Rs750/-) for details click here

For all your embedded quires visit our new forum.embed4u.com

Home > Projects > Thermocouple Interface with pic16f877a microcontroller with ad595:

Thermocouple Interface with pic16f877a microcontroller with ad595:

June 7th, 2011

Thermocouple Interface with pic16f877a microcontroller with ad595:

Project  description:

In this project to use pic16f877a microcontroller and k type thermocouple, amplifier ic is ad595 for analog devices. To measure the temperature to display in the 2*16 lcd display, the corresponding values will be display in the lcd. In this project we use ccs compiler the micorocontroller circuit is not show in the circuit only ad595 interface circuit only add.Any failure in the thermocuple ad595 will be sense and indicate alarm or led indication.. In this project is working good.The following circuit and code is tested one.Lcd connection in this project is Port E0 is R/S and E1 is lcd Enable(E) pin  and R/W is ground.The Lcd data pin will be connected Port D of 16f877a. The ad595 output pin connected to channel(0) of pic16f877a.

source code:

#include<16f877a.h>

#fuses HS,NOWDT,NOPROTECT,NOLVP

#use delay(clock=20000000)

#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)

void cmd(char r)

{

output_e (0x00);

output_d (r);

output_e (0x02);

delay_us (10);

output_e (0x00);

delay_ms (10);

}

void init_lcd()

{

unsigned char x[] ={ 0x38,0x0c,0x01,0x80,0x06};

unsigned char i;

for( i = 0 ; i &lt; 5 ; i++ )

{

cmd(x[i]);

}

}

void display(unsigned int s)

{

output_e (0x01);

output_d (s);

output_e (0x03);

delay_ms (20);

output_e (0x01);

delay_ms (20);

}

void main()

{

unsigned int gas_sen=0,read_switch=0;

setup_port_a( ALL_ANALOG );

setup_adc( ADC_CLOCK_INTERNAL );

init_lcd ();

while(1)

{

set_adc_channel( 0 );

delay_ms(100);

s=tc;

cmd(0x80);

display("   <a href="http://www.embed4u.com/" target="_blank">TEMP SENSE </a> ");//display in LCD

cmd(0xc3);// LCD display for 2nd line 1st location

delay_ms(100);   //call for delay routine

{

display(((s%10000)/1000)+48);

display(((s%1000)/100)+48);

display(((s%100)/10)+48);

display((s%10)+48);

}

display(" Deg C");//display in LCD

delay_ms(500);//Delay routine call for some delay

cmd(0xce);//LCD 2nd line 8th position

delay_ms(100);

delay_ms(100);//Delay routine call for some delay

}

}

}

Related posts:

  1. Pic16F877A Mobile Keypad C Program
  2. RTC ds1307 Interface c Code for pic16F877A
  3. PIC 16F877A LCD C PROGRAM
  4. DS1820 C PROGRAM WITH 8051
  5. LOAD CELL BASED PRODUCT CHEKING SYSTEM
Comments are closed.