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.

How to interpret reading from LM335Z?

Status
Not open for further replies.

aghazi

Junior Member level 2
Joined
Jan 23, 2006
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,551
lm335z

Hi,

I have one LM335Z attached to analog pin RA2 of 16F877A. Using ADCIN, i am getting the value and then displaying it on LCD using DEC. Value I am getting is 149. At this particular moment, the output voltage reading from LM335 is 2.982v. My question is how to interpret the value (149) i am getting from A/D channel? How can i convert it to °C reading? By the way room temperature at this moment is 25°C.

Thanks in advance,

Regards,
AG
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
lm335z circuit

For optimum performance, with use of op-amp, you can align LM335 output range so that it fit to 0-5 volt.

for example you need to measure 0-125 deg centigrad.
make op-amp so that convert 2.73 to 0 volt and 3.98 (2.73+125*10mV/deg) to 5 volts.

Then use this formulla:
temperatue = 125 * (ADC read value)/ (ADC max value)
 

aghazi

Junior Member level 2
Joined
Jan 23, 2006
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,551
pic lm335z

hmmm. I am new to all this stuff but i do have a 741 opamp. Can you guide me how to attach/use it with lm335? Any schematic?

Thanks
AG
 

philba

Full Member level 2
Joined
Jan 26, 2006
Messages
132
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,298
Activity points
3,102
using lm335z

it might be easier to take the read value and shift right by 2 bits (div 4).

another way to do this is to make Vref- be 2.73

Added after 4 minutes:

it might be easier to take the read value and shift right by 2 bits (div 4).

another way to do this is to make Vref- be 2.73 and Vref+ be 3.73 and let the uC do the scaling. if super accuracy is not an issue you can use 2 dividers to get those voltages. I'd use 1% resistors.

If you wanted a wider range, you can make the range -50C to 150C (2.23 to 4.23), divide by 2 and then subtract 50.
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,470
lm335z

Quote from : https://tripoint.org/kevtris/Projects/peltier/

The blue pot adjusts the reference voltage for the PIC's ADC. It must be 2.560V or else the ADC will not have the proper step size. A word about that- the PIC has 1024 steps on its ADC, and the ref is 2.56V so each step of the ADC is 2.56/1024 or 2.5mV. The LM335 temp sensors change 10mV per degree Celcius. These devices read out in kelvin, which at room temp is around 2.8V or so... too high for the PIC's ADC at 2.56V ref. I used the 12.K resistors to divide the output of the LM335's by 2 so that each degree is 5mV... exactly 2x what the PIC's ADC step size is. This means that for each step on the ADC, the temp has to change exactly .5 degrees C. So this means my ADC will now read out directly in degrees C. :) I don't have to do a messy conversion in software.

And the schematics :

https://tripoint.org/kevtris/Projects/peltier/images/Drink_Cooler_Schematic.gif

Take care of ADCON1 register (address 9Fh) settings of PCFG3-PCFG0 A/D port configuration control bits of PIC16F877A.
The anode of LM336 must be tied to pin RA3 (VREF+)
The common point of the two equal resistors 12k7 is tied to whatever analog input of PIC you choose.

The 12k7 value it's not important. It's a must to find two 1% matching resistors.

I believe that worth spending some money for LM336.
Just because:
- you don't have to do a messy conversion in software
- you don't have to use dividers for 2.73v and 3,73v by using 1% resistors of different values
- a minimum temperature drift because you'll not use +5v power supply as reference for VREF+ or to get 2.73v and 3.73v

However if you like to play with op-amp in Circuit Cellar issue 25 of february/march 1992 Mark Nurczyk shares from his experience.
You can find the article in bellow attachement:
 

soulraven

Newbie level 6
Joined
Feb 13, 2009
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Campulung Muscel, Romania
Activity points
1,349
lm335z howto

i have find the solution for negative temperature with Lm335

temp_ulei = (adc_ulei * 0.48828) - 273.15;

this is the formula....
 

IGIF16

Junior Member level 2
Joined
Dec 19, 2010
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Frince
Activity points
1,442
thankssss mr.silvio

---------- Post added at 23:48 ---------- Previous post was at 23:47 ----------

thanks mr. soulraven
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top