July 12th, 2008
LM35 Based Thermometer Display Temperature on LCD
The LM35 of National Semiconductors that is used in this project is a precision centigrade temperature sensor, which has an analog output voltage. It has a range of -55ºC to +150ºC and a accuracy of ±0.5ºC . The output voltage is 10mV/ºC . The output voltage is converted by the AD convertor of the ATMega8. The temperature is displayed on an LCD module. In this example the thermometer has a range of 0ºC to 40ºC and a resolution of 0.5ºC. If you want to have a readout in Fahrenheit you can use the LM34.
LM35 Based Thermometer Display Temperature on LCD: [Link]



March 7th, 2009 at 7:02 pm
hello . me name is alireza me need progeram lcd for damasanj im very need send to e mail good bye
January 28th, 2010 at 8:44 pm
// ***********************************************************
// Project:
// Author:
// Module description:
// ***********************************************************
#include // Most basic include files
#include // Add the necessary ones
#include // here
#include
#define F_CPU 1000000
// Define here the global static variables
//
int My_global;
const char enable = 0×08;
void lcd_init(void);
void write_inst(char val);
void write_data(char val);
void write_text( unsigned char* aray );
// Prototype for Keys_comb, with one input argument
// Interrupt handler example for INT0
//
SIGNAL(SIG_INTERRUPT0) {
}
// It is recommended to use this coding style to
// follow better the mixed C-assembly code in the
// Program Memory window
//
void my_function(void) { // Put the open brace ‘{‘ here
// Inline assembly example
}
// ***********************************************************
// Main program
//
int main(void) {
//Configuring DDRB for Output, to view the key pressed
// my_function(); //Calling my_function
DDRC = 0xFF;
DDRD = 0x0C;
DDRB = 0×01;
DDRA = 0xFF;
PORTC = 0×00;
lcd_init();
write_text(“WELCOME……!”);
while(1) { // Infinite loop; define here the
}
}
void lcd_init(void)
{
_delay_ms(15);
write_inst(0×30);
write_inst(0×30);
write_inst(0×30);
write_inst(0×36); //Set interface length
write_inst(0×08); //Enable Display/Cursor off for now
write_inst(0×01); //Clear Display
write_inst(0×06); //set curser move
write_inst(0x0F); //Enable Display
}
void write_inst(char val)
{
PORTB = 0×00;
PORTC = 0×01;
PORTA = val;
PORTC = 0×00;
_delay_ms(15);
}
void write_data(char val)
{
PORTB = 0×01;
PORTC = 0×01;
PORTA = val;
PORTC = 0×00;
_delay_ms(1);
}
void write_text( unsigned char* aray )
{
unsigned char i=0;
while(aray[i] != ”)
{
write_data(aray[i]);
i++;
if(i==19)
{
write_inst(0xc0); //new linge
}
}
}
June 6th, 2010 at 9:41 am
i need embedded C programing for lcd thermometer using lm 35.
plz help me….
June 12th, 2010 at 9:01 am
http://www.avrprojects.net/index.php?option=com_attachments&task=download&id=10
July 2nd, 2011 at 7:29 am
I wnted details about how to display room temperature on a 16*2 lcd using lm35…pls help asap
October 24th, 2011 at 1:47 pm
thanks
November 27th, 2011 at 8:04 pm
hi friends i am making project and in it i want to display LM35 temperature on 2×16 LCD. but im facing problem that LM35 gives data in Hexadecimal but dont know how to send it on LCD, the code is given below plz help me… thanxx
#include
#include
void delayu(unsigned int d)
{
_delay_us(d);
}
void delaym(unsigned int d)
{
_delay_ms(d);
}
void lcd_comd(unsigned char comd)
{
PORTD = (PORTD&0x0F)|(comd & 0xF0);
PORTD &= ~(1<<0);
PORTD &= ~(1<<1);
PORTD |= (1<<2);
delayu(1);
PORTD &= ~(1<<2);
delayu(20);
PORTD=(PORTD&0x0F)|(comd<<4);
PORTD |= (1<<2);
delayu(1);
PORTD &=~(1<<2);
}
void lcd_data(unsigned char data)
{
PORTD=(PORTD&0x0F)|(data & 0xF0);
PORTD|= (1<<0);
PORTD &= ~(1<<1);
PORTD |= (1<<2);
delayu(1);
PORTD &= ~(1<<2);
delayu(20);
PORTD=(PORTD & 0x0F)|(data<<4);
PORTD |= (1<<2);
delayu(1);
PORTD &= ~(1<<2);
}
void lcd_init()
{
PORTD=0xFF;
PORTD &= ~(1<<2);
delaym(2);
lcd_comd(0×33);
delayu(100);
lcd_comd(0×32);
delayu(100);
lcd_comd(0×28);
delayu(100);
// lcd_comd(0x0f);
// delayu(100);
lcd_comd(0x0c);
delayu(100);
lcd_comd(0×01);
delayu(2000);
lcd_comd(0×06);
delayu(100);
// lcd_comd(0x1c);
// delayu(100);
// lcd_comd(0×05);
// delayu(100);
}
void lcd_xy(unsigned char x,unsigned char y)
{
unsigned char pos[]={0×80,0xC0};
lcd_comd(pos[y-1]+ x-1);
delayu(100);
}
void print(char *str)
{
unsigned char i=0;
while(str[i]!=0)
{
lcd_data(str[i]);
i++;
delaym(200);
}
}
adc()
{
DDRA = 0; // make Port A an input
ADCSRA = 0×87; // make ADC enable and select ck/128
ADMUX = 0xE0; // 2.56V Vref and ADCO
DDRC = DDRC | 0b00000111;
unsigned char temp;
ADCSRA |= (1<<ADSC) ; //start conversion
while( (ADCSRA&(1<0×18) & (temp0x1E) & (temp0x23)
{
PORTC = PORTC | 0b00000011;
}
else if(temp<0×15)
{
PORTC = PORTC | 0b00000100;
}
else
{PORTC = PORTC & 0b11111000;
}
unsigned char ADCH1,ADCH2;
ADCH1=ADCH&0x0F;
ADCH1=ADCH1|0×30;
ADCH2=ADCH&0xF0;
ADCH2=ADCH2<<4;
ADCH2=ADCH2|0×30;
lcd_data(ADCH2);
lcd_data(ADCH1);
}
int main(void)
{
DDRD=0xFF;
lcd_init();
while(1)
{
lcd_xy(1,1);
print("TEMP : ");
adc();
}
return(0);
}