Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with LM35 temp sensing

Status
Not open for further replies.

nitsakh

Member level 1
Member level 1
Joined
Nov 24, 2010
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,514
The following HiTech C code is written to display the temperature on LCD with PIC16F877A.However,0 value is displayed.
Atleast the voltage should get displayed.Please help with the problem in code.

Code:
#include <htc.h>
#include<math.h>
#include<stdio.h>
#include "lcd.h"
__CONFIG(0x2F4A);

void adc_read()
{
	ADCON0=0x00;
	ADCON1=0b10000000;
	
	ADON=1;
	GODONE=1;
	while(GODONE);
	ADON=0;
}

void main()
{
	TRISA=0xFF;	
        lcd_init();
	lcd_goto(0);
	lcd_puts("LM35 Test");
	lcd_goto(0x40);
	unsigned int val;
	char buff[4];
	while(1)
	{
         lcd_goto(0x40);	
         adc_read();
	__delay_ms(2000);
	val=ADRESL;
	sprintf(buff,"%d",val);
	lcd_puts(buff);
	__delay_ms(5000);
	}
}

Thank You.


Now some random garbage values like,99,28,192,424 etc are getting displayed.
 
Last edited:

Yes its stable.Its showing 278 mV.
Is there any problem with code ?
Are the ADCON0 and ADCON1 registers configured properly ? Whatis the ADC clock ?and how are their values decided ?
I have an external 8MHz crystal osc. The LM35 input is connected to AN0;
 
Last edited:
1.set the adc clock as low as it permitts you
2.place a 100 nf capactior between lm35 output pin and ground
when an adc wire gets longer than 20 30 cm,it acts as an powerful antenna and gets all microwaves in the air then make the adc value unstable
if you see an antenna output on oscilloscope you will realize what i say and the role of 100nf cap
 
1.set the adc clock as low as it permitts you
2.place a 100 nf capactior between lm35 output pin and ground
when an adc wire gets longer than 20 30 cm,it acts as an powerful antenna and gets all microwaves in the air then make the adc value unstable
if you see an antenna output on oscilloscope you will realize what i say and the role of 100nf cap


Myself Sumanta wants to see the output of LM35. When 5volt is given at its Vs pin with respect to ground, the device is getting heated up too much. Can anyone tell me the cause of this problem and how it can be solved. Waiting for all of your suggestions.


Sumanta

Indian Institute of Technology Kharagpur, India
 

in common datasheets the view side of the components is top view
but in lm35's datasheet the view side is bottom view so please check supply pins not to be connected incorrect
if you connect them correctly it won't get warm ever!!!
 

in common datasheets the view side of the components is top view
but in lm35's datasheet the view side is bottom view so please check supply pins not to be connected incorrect
if you connect them correctly it won't get warm ever!!!


Hi to all,

I am facing a problem regarding the burning of program from AVR STUDIO4 in ATMEGA32 Micrcontroller through EXTREME BURNER -AVR. But while burning the following messages

are coming -

> Autodetecting programmer

> Found USBasp on USB port

> Powering ON

> Powering failed

> Cannot communicate with target chip

> Retrying again

> Power on failed

> Cannot communicate with target chip

> Repeating the above three

> Powering off

> Power turned off

> ******Task failed*******

> *******Please retry again*******

> Thank you

I have done the connections in ISP programmer according as shown in figure in the Attachment. Please check if it can be solved.


Sumanta

Indian Institute Of Technology Kharagpur, India
 

Attachments

  • Extreme burner pic.png
    Extreme burner pic.png
    35.4 KB · Views: 203

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top