Вы находитесь на странице: 1из 9

Home

Projects
Forum
CytronTechnologiesOfficialWebsite

Navigation
openall|closeall
GettingStarted
rero
BuyingGuides
ProductGuides
Projects
Seminars&Events
News
UsefulTools/ExternalReferences

LiveSearch

SignIn
User

Password

Rememberme Send
BecomeaMember
RecoverPassword
RecentComments
malefetsaneonProject17interfacewith44keypadand216LCD
oberonWirelessCommunicationbetweenArduinoandComputerwithRFBee.
DanielleonIdentifyTerminalPinsofARelayWithoutReferencetoDatasheet
bryanonProject17interfacewith44keypadand216LCD
neoonControlandMonitorviaSMS
HomeProductGuidesPICDevelopmentToolSK40C(PICStartUpKit)Project5AnalogSensor:TemperatureusingLM35
Tags:DisplayLCD,LM35,Temperaturesensor

Project5AnalogSensor:TemperatureusingLM35
Publishedby:tonynwk88onAugust9,2011.

5
Share

Share

Share

Share

PROJECT5
ANALOGSENSOR:TEMPERATUREUSINGLM35
BacktoProject4 GotoProject6

Nowadays,therearemanytypeoftemperaturesensoriscomewithdifferentoutputformandalsothetemperaturerangesuchasthermocouple,thermistor,
infrared,RTD.Inhere,wepickLM35asourtemperaturesensorduetoithavealinearoutputandalsosuitablefornormaluselikeweathertemperature
measuring.

COMPONENTNEEDED

16x2LCDDisplay

LM35TEMPRETURESENSOR

BREADBOARD

JUMPERWIRES

CONNECTION

TheconnectionfortheLM35areveryeasy.JustconnectoneendtoVDD(REDwire)(4Vto20V)andtheotherendtoGND(BLACKwire)whilethe
middlepin(YELLOWwire)isconnectedtoRA0.ByreferringtothePIC16F887,therearetotal14analogpinsthatwecanchoose.InhereweuseRA0
asoutADCinputpin.

ADDITIONALINFORMATION

TheLM35seriesareprecisionintegratedcircuittemperaturesensors,whoseoutputvoltageislinearlyproportionaltotheCelsius(Centigrade)
temperature.TheLM35doesnotrequireanyexternalcalibrationortrimmingtoprovidetypicalaccuraciesof14Catroomtemperatureand34Cover
afull55to+150Ctemperaturerange.Lowcostisassuredbytrimmingandcalibrationatthewaferlevel.TheLM35slowoutputimpedance,linear
output,andpreciseinherentcalibrationmakeinterfacingtoreadoutorcontrolcircuitryespeciallyeasy.Itcanbeusedwithsinglepowersupplies,orwith
plusandminussupplies.Asitdrawsonly60Afromitssupply,ithasverylowselfheating,lessthan0.1Cinstillair.TheLM35isratedtooperateover
a55to+150Ctemperaturerange.
Features

~CalibrateddirectlyinCelsius(Centigrade)
~Linear+10.0mV/Cscalefactor
~0.5Caccuracyguaranteeable(at+25C)
~Ratedforfull55to+150Crange
~Suitableforremoteapplications
~Lowcostduetowaferleveltrimming
~Operatesfrom4to30volts
~Lessthan60Acurrentdrain
~Lowselfheating,0.08Cinstillair
~Nonlinearityonly14Ctypical
~Lowimpedanceoutput,0.1Wfor1mAload.

CODEOVERVIEW

celsuis=adc_value/2
LM35havealreadydesignedtogiveanexactvalueoftemperatureinCelsius.Byreferringtothegraph,theADCoutputareonlyneedtodivideby2to
gettheresultinCelsius.
kelvin=((celsius*100)+27315)/100
Kelvinformulaare(Celsius+273.15).Butformicrocontroller,itwillnotreadtheresultaftertheDOT.E.g.:ifresultiskelvin=300.15,the
mcrocontrollerwillonlyread300onlyandwillignore.15.InordertogettheresultaftertheDOT,wetimestheresultin100sothatwecangettheresult
aftertheDOT.
fehrenheit=((celsius*18)/10)+32
Fahrenheitformulaare([celsuis*1.8]+32).Inthecoding,theformulahavebeentimeswill10timestogettheexactresult.
reaumur=(celsuis*8)/10
Reaumurformulaare(celsius*0.8).Sameastheprevioustechnic,inordertoletmicrocontrollertogetthemoreaccurateresult,wetimesitwith10toget
theresultaftertheDOT.
BacktoProject4 GotoProject6

ATTACHMENT
1.P5UserManual.pdf

2.Project_5_code.zip

Youmayalsolike:

RelatedPosts:

PROJECT6
TEMPERATURE
SENSORTOLCD
DISPLAY

SK28ATemperature
SensorwithFixed
Voltage

PROJECT9LM35
CONTROLDC
MOTORSPEED

6ResponsestoProject5AnalogSensor:TemperatureusingLM35
1.

roysays:
October19,2012at7:22pm
canyoubrieflyexplainwhyadcvaluemustdividebytwotogetcelcius

2.

couldyoukindlysendmecompletewiringdiagramofproject5says:
November9,2012at8:21pm
Thankyouinadvance

3.

nitesays:
December10,2012at12:00am
thecodingisfailed..
thisiswhatitshowandpleaseadvised

PROJECT12
SERIAL
COMMUNICATION
CONTROLDC
MOTOR

BuildE:\MPLab\1stLM35fordevice16F877A
UsingdriverC:\ProgramFiles(x86)\HITECHSoftware\PICC\PRO\9.60\bin\picc.exe
Executing:C:\ProgramFiles(x86)\HITECHSoftware\PICC\PRO\9.60\bin\picc.exepass1E:\MPLab\LM35\Project_5\Project_5.cq
chip=16F877APruntime=defaultopt=defaultD__DEBUG=1gasmlisterrformat=Error[%n]%f%l.%c%smsgformat=Advisory[%n]
%swarnformat=Warning[%n]%f%l.%c%s
Error[192]E:\MPLab\LM35\Project_5\Project_5.c43.1undefinedidentifierANSELH
**********Buildfailed!**********
4.

obersays:
December11,2012at4:10pm
ThesamplecodeisforPIC16F887,youareusingPIC16F877A Anyway,pleasedocometoourtechnicalforumtodiscuss.

5.

shamsays:
February19,2013at4:42pm
couldusendmeschematicdiagramiwanttotrymyownself..

6.

hyngsays:
February20,2013at4:35pm
HiSham,
Thereisnoschematicdiagramasthisisasimpleproject.
Pleaserefertothebreadboardviewdiagraminthisarticle.
Thanks.

LeaveaReply
Name(required)
Mail(willnotbepublished)(required)
Website

SubmitComment

HelpusimprovethewikiSendYourComments
2012TutorialbyCytron|PoweredByWordpress

Вам также может понравиться