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.

displaying temperature on LCD

Status
Not open for further replies.

mikesmixes

Newbie level 4
Joined
May 17, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
53
lm35 picbasic

Hey, i am using a LM35, PIC16f877 and a 2x16 lcd screen
All i want to do is show the temperature on the lcd screen.
Anybody got some code or ideas.
Thanks
 

experimenting with lm35

I don´t know if you are using assembler or C , but any C compiler already has a library for LCD, so fisrt problem solved. For the LM35 you have many ways to implement it, the easier is to set the REF for ADC at PIC at a suitable level for linearity with LM35 output, i believe is 10mV/ºC or better yet use an ampop to rise the maximum temperatura you want to read at a 5V level and use direct ADC from PIC. An idea for code the code is very simple: take four ou five reading from the sensor, average them and then display it on the LCD, use a low refresh rate, the temperature change very slow, usually. I guess that 10 readings/second is enought. Hope it helps you, but never the less search code and ideas in forums for PIC (use google or this forum as a starting point).
 
best temp for lcd

hey, im using pic basic. i dont understand how to make a Vref for the A/D.
What exactly does that Vref do?
 

temperature adc conversion to lcd

you can see example in book : Experimenting with the PicbasicPro compiler
here : **broken link removed**
 
Last edited by a moderator:

displaying temp on lcd

Hi,

Even though it's for LM 34 I think your problem is solved:

**broken link removed**

Bye!
 
Last edited by a moderator:

lm35 en picbasic

The Vref tension is the reference voltage for the ADC conversion. Usually, and PIC works like this, Vref is the voltage equivalent to 0x3FF, full conversion. So if you want to convert an exernal tension lower then 5V, lets says max 3V, you supply 3V to Vref pin and you'll get from 0x000 (0V) to 0x3FF(3V), otherwise, using 5V ref the max bin value, from the same 3V, will be Vin*1024/Vref.
 

lcd reading temperature

I have measured temperature with LM35 in one of my project.

Here is the code with Pic basic ,

ADCON1 = %10000010' You have to set the register first

Define ADC_BITS 10 ' ADC result is 10 bit
Define ADC_CLOCK 1 ' ADC clock source( foscillator/8 )
DEFINE ADC_SAMPLEUS 50 ' ADC sampling time us

DEG CON 223 ' you can write an celcius mark on lcd


AD_Res VAR WORD '
C VAR BYTE '

TEMPERATURE READİNG :

ADCIN 0, AD_Rez ' Read channel 0 to AD_Rez (0-1023)
AD_Rez = (AD_Rez */ 500)>>2 ' equates to: AD_Rez * 500)/1024

DİSPLAY TEMPERATURE ON LCD:

LCDOUT $FE,$C0,"TEMP:",DEC2 AD_REZ,DEG,"C"
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top