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.

interfacing LM35 to 89c51 microcontroller.

Status
Not open for further replies.

raghuchouta

Newbie level 6
Joined
Feb 15, 2007
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
lm 35

hi,

This is raghunath. I am developing an electronic board for an automatic cleaning system which contains level sensors, teperaturesensors and few limit switches.

In my application i have to sense temperature in a chamber when steam is allowed to pass. The temperature sensor i have choosen is LM35. I want to know how it can be interfaced to 89c51 microcontroller.

Please give me an idea.

with regards,
raghunath.
 

lm35 microcontroller

Hi raghuchouta, you can see the book from Mazidi (The 8051 microcontroller and Embedded Systems), chapter 12.

best regards.

control
 

89c51 microcontroller

The LM35 has an analog voltage output corresponding to the temperature, so you need to have an ADC for converting it to digital. You probably need an amplifier first.

Check your 8051 controller if it has integrated ADC. Use an Opamp to amplify the sensor output to the required range, or select a fitting reference voltage for the ADC.

If it doesn't has an integrated ADC, check if you could use another sensor with digital output like I2C, or build an external ADC. For your application, a dual-slope converter is probably the easiest and best thing.
 
lm35 interfacing with 8051

Why not use LM75 instead of LM35. LM75 is a digital sensor with I2C interface which eliminates the need of any ADC.
 

interfacing lm35

well u need to use LM35 that is to be interfaced along with ADC which u can use to be ADC 0804. the ADC then gives the digital output which is given into the microcontroller.
 
interfacing lm35 with 8051

Here are the data specs of lm35.
 

lm35 interfacing

I thank all of u for the help rendered.
 

lm35 8051

Hi
You can use 89c51AC2 or 89C51AC3
They are with buit in 10 bit ADC converter


OR

Use LM75 with digital bus (noise imune ), then you can use any 8051 chip.

Very nice software for 8051 and AVR family is BASCOM 8051 and Bascom AVR



cheers
 
lm35 with 8051

Dear frnds,

I forgot to mention the temperature range in my last post. The temperature should be maximum i am looking is 100 deg. will LM75 or LM35 work? Or any other IC?

with regards,
raghuanth
 

lm35 adc

Hi Raghunath.

The temperature range of LM35 is -55 to +150 ^C. So that should not be a problem.
**broken link removed**

Just like CMOS, mgajo and tmbinc had suggested, LM75 would be a better option in an industrial environment. I2C code can easily be bit-banged, so even the most basic controller should be able to read the temperature.

0804/0808 can be used but is going to be a bit more time consuming, needs space in your board and of course more controller pins are required.

How many (temperature)sensors will you be using and will the .5 ^C resolution be enough for the application? what are your mounting options for the temperature sensor?

-K
 

lm35 with microcontroller

Hi,

If you want want to use LM35 to conect to an 89C51 MCU you must use an ADC.
My sugestion if you don't want a resolution higher than 0.5 ºC you can use the PCF8591 (PHILLIPS) that is very cheep and as a I2C interface, if you sue a 2.5V or 1.2 refernce like LM385/2.5 or LM385/1.2 the convertion will be:

The output of LM35DZ is 10mV per ºC

VAGND=0, VREF=2.5 => VLSB=9.8mV ~10mV => 1 ºC per bit
VAGND=1, VREF=1.2 => VLSB=4.68mV ~5mV => 0.5 ºC per bit

Hope that helps
 

adc0804 interfacing with lm35

hi

you can use LM 35 with ADC like ADC 0831 as it is very simple and easy to use. LM 35 is an analogue output 10mv/c. with requires an ADC to convert this into digital output so that the controller can understand. ADC 0831 outputs one byte 0-256 different levels. and outputs to a controller. Please see ADC 0831 data sheet.
regards
 

lm35 com 8051

HI

LM75 gives digital output for corresponding temperature.

There is any effect on digital output voltages due to temperature variations.

Because he is using sensor in side the chamber.

Regards
nari
 

lm35 with adc

Here is the logic and hardware i used to read temperature from LM35 to parallel port. You use the same logic. Hardware remains same
**broken link removed**

Bibin John
www.bibinjohn.tk
 

lm35 interface

Hi every body,i am a new user from Egypt
i know that this topic is old
but i do the same project and i need ur help about how to write the program of this project using microcontroller
i try to download the files from **broken link removed** but i fail (sorry for my English not good)

thank you
 

temperature sensor lm 35,mazidi code

chek this web site may help u
**broken link removed**
 

lm35 mounting

Dear friend, connect the output of the LM35 to any ADC(0804,0806 etc.,). Interface the ADC with the microcontroller. U need to connect RD,WR,INTR,CS of ADC0804 to any port of mc. Give necessary control signals to get the digital o/p.
 

LM35 is a 3-pin device with a VCC, GND and OUT (output pin). The voltage at the OUT pin is always the temperatue equivalent.

For example if the temperature is 32 degree, the voltage at the OUT pin will be 0.32 volts. All you have to do is to convert this anlog value to its digital equivalent using an ADC, so that the controller can read it.



Now the ADC;

ADC (Analog to Digital Converter) can convert the voltage at its analog input pin to corresponging digital at its digital pins.

For example an ADC0804 has an AIN (analog input pin). If you apply a 2 volts at this pin then the eight digital out pins (D0 to D7) will represent the binary equivalent of 2*(256/5); provided that you've connected the REF (ADC reference pin) to 5 volt.



As there are 8 digital output pins, you can directly connect the ADC to any of the 8-pin digital port of the controller and read the entire port. If you store it to a charater type data, it will represent the value;

(TEMPERATURE/100)(256/5).



Just to give you an idea, suggest you to cross check the expressions with the actual datasheet.
 

hi
this lm 35 interfacing with atmega8 in avr program
see and tell any misteck
the output is differnt form
tell me any correction of this program
Code:
#include<avr/io.h>
#include<util/delay.h>

#include "uart.h"

void ADC_Init();
float read_adc();

unsigned char ADC_calculating();
unsigned char a;
unsigned char b;

void main()
{

	char temp;

	_delay_ms(50);

	UART_Init(25);
	UART_TransmitString("To Display the Temperature in Centigrade \r\n");

	ADC_Init();
	
	while(1)
	{		
		//convert calue to tempature

		temp = ADC_calculating();

		a = temp % 10;
		b = temp / 10;
	
		_delay_ms(100);
				
		UART_TransmitByte(a+48);
		UART_TransmitByte(b+48);
		UART_TransmitString("\r\n");				

		_delay_ms(100);
	}
}

void ADC_Init()
{
	ADMUX  = (1<<REFS0);
	ADCSRA = 0x85;
}

float read_adc()
{
    //select the ADC channel  
	ADMUX |= _BV(0);
	
	//START THE ADC CONVERATION

	ADCSRA |= (1<<ADSC);

	//WAIT FOR CONVERATION TO COMPLETE

	while(!(ADCSRA) & (1<< ADIF));

	//CLEAR ADIF BY WRITING ONE TO IT

	ADCSRA |= (1<< ADIF);

	return(ADC);
}

unsigned char ADC_calculating()
{
	float ADC_VALUE = 0;
	float value=0; 

	ADC_VALUE = read_adc();

	value = ((ADC_VALUE)* 0.48876);
	
	return(value);
}

- - - Updated - - -

the output of the proggram is
PHP:
To	Display	the	Temperature	in	Centigrade
00
8:
0<
4<
+$
0$
'%
*%
/%
'&
'&
(&
+&
,&
/&
)'
+'
*'
-'
0'
0'
0'
)(
*(
)(
+(
-(
-(
,(
.(
/(
.(
/(
()
')
0(
()
))
()
()
+)
+)
))
+)
,)
+)
+)
.)
.)
,)
-)
/)
.)
-)
/)
0)
.)
.)
0)
.)
-)
/)
/)
.)
.)
/)
/)
.)
/)
0)
/)
/)
0)
/)
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top