Академический Документы
Профессиональный Документы
Культура Документы
(/tag/typeid/categorycraft/channelknittingandcrocheting/) Yarn(/tag/typeid/categorycraft/channelknittingandcrocheting/)
Usingatemperaturesensortocontrolthespeedofamotorusing
arduino byHesham_Gaber(/member/Hesham_Gaber/)intools(/tag/typeid/categoryworkshop/channeltools/)
Download h(/id/Usingatemperaturesensortocontrolthespeedof/?ALLSTEPS) 2Steps .
Step2:Timeforcoding
AboutThisInstructable
Usingthearduinosoftwareandwritethiscodedown.
floattemp 8 31.860 views Posted:
May23,
inttempPin=A0//arduinopinusedfortemperaturesensor 123 favorites 2015
License:
inttempMin=25//thetemperaturetostartthebuzzer
inttempMax=70
Hesham_Gaber
intfan=6//thepinwherefanisconnected (/member/Hesham_Gaber/)
intfanSpeed=0 Follow 10
voidsetup(){ (/member/Hesham_Gaber/)
pinMode(fan,OUTPUT) MorebyHesham_Gaber:
pinMode(tempPin,INPUT)
Serial.begin(9600) (/id/Usinga
}
voidloop(){
temperaturesensortocontrolthespeed
temp=analogRead(tempPin) of/)
temp=(temp*5.0*100.0)/1024.0//calculatethetemperatureinCelsius
Addinstructableto:
Serial.println(temp)
; Group
delay(1000)//delayinbetweenreadsforstability
if(temp<tempMin){//iftempislowerthanminimumtemp
fanSpeed=0//fanisnotspinning
digitalWrite(fan,LOW)
}
if((temp>=tempMin)&&(temp<=tempMax))//iftemperatureishigherthanthe
minimumrange
{
fanSpeed=map(temp,tempMin,tempMax,32,255)//theactualspeedoffan
analogWrite(fan,fanSpeed)//spinthefanatthefanSpeedspeed
}
}
Nowafterverifyinganduploadingthecodetothearduino,youcanopenthe
serialmonitorupattherightofthearduinosoftwaretoshowthetemperatureof
thesurrounding.
youwillnoticedthatihaveaddedthe"Serial.begin(9600)"functionthatshows
thetemperatureintheserialmonitor.
Toincreasethetemperatureyoucanheatitbytransferringheatfromyourbody
bytouchingit.
youcaneditthetempMinandtempMaxthevaluesyouwantdependingonyour
applicationspecification.
lm35.txt(/ORIG/FZN/AF1I/IA0WFW6D/FZNAF1IIA0WFW6D.txt)
Previous(/id/Usingatemperaturesensortocontrolthespeedof/) Next
ViewAllSteps(/id/Usingatemperaturesensortocontrolthespeedof/?ALLSTEPS)
Download
Wehaveabenicecommentpolicy.
Pleasebepositiveandconstructive. wIMadeit! AddImages PostComment
motorisnotcontrollingitsspeed??howcanicontrolitpleasegivemethe
solutionforthatimmediately
Flag
myfanisrotatingthoughihavereducedthemintempbutmotorisnot
stopping.itisspinning
Flag
whatexactlydoesthediodethatgoesacrossthefanterminalsdo?Isthata
safetymeasureincasethefanspinsbackwardsbyitselftopreventfryingthe
npntransistororsomething,orisitjustthereforshow?
Flag
DanielP406(/member/DanielP406) . MetroidChild.(/member/MetroidChild.)
5monthsago Reply
Youmight'vehadthisquestionanswered,butfor
otherswhoarecuriousthefanisaninductiveload,andthediode
thereforeservesasa'flybackdiode'.
Technically,thefan'smotordevelopsamagneticfieldinordertospin.
Whenthefansuddenlylosespower(whenyouturnitoffattheswitch),it
triesto'feeditself'usingthemotor'scollapsingmagneticfieldasits
source,insteadoftheoriginalsourcewhichisnowmissing.
Dependingonthemagnitudeofthisfield,theinductorcreatesanegaitve
potentialwhereitwasoncepositive,andtheinductiveloadtriesto
essentially'force'thevoltageacrossthepowerswitch,creatinganarc.
Thisisdangerousforthecircuit.
Adiodeisthereforeplacedacrossthemotorsuchthattheintended
sourcewon'tbypassthefanwhenoperating,andtheinductorwill'power
itselfdown'PROPERLY(untilitdies)whenthefanisturnedoff.
Hopethishelps:)
Flag
canyougivethespecificationofthemotorused?
Flag
BOMDIA,timoTrabalhoPretendoeFcil.defazer
Flag
X Hesham_Gaber(/member/Hesham_Gaber)(author) . wilsondm
8
(/member/wilsondm) 2yearsago Reply
thankyou,
itissimplyapartofabigproject,youmightuseitinsomething
Flag
Flag
X Hesham_Gaber(/member/Hesham_Gaber)(author) . tomatoskins
8
(/member/tomatoskins) 2yearsago Reply
itcouldbeinvolvedinalargeprojectlikeasmerthome!
Flag
FEATURED CHANNELS
TermsofService(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
PrivacyStatement(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
LegalNotices&Trademarks(http://usa.autodesk.com/legalnoticestrademarks/) | MobileSite(http://www.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2016Autodesk,Inc.