You are on page 1of 4
(ttps//playground.arduino.cc) SIGN IN (HTTPS://AUTH.ARDUINO.CC/LOGIN?CLIENT_ID=PLAYGROUN Manuals and Curriculum (httpsi//playground arduino.cc/Main/ManualsAndCurriculum) Arduino StackExchange (htspi//arduino stackexchange.com) Board Setup and Configuration (htepsi//playground arduino.cc/ Main/ArduinoCoreHardware) Development Tools (hteps://playground arduino.cc/Main/DevelopmentTools) Arduino on other Chips (https://playground arduino.cc/Main/ArduinoOnOtherAtmelChips) Interfacing With Harcware (https://playground arduino.cc/ Main/InterfacingWith Hardware) = Output (https://playground.arduino.cc/Main/InterfacingWithHardware#Output) = Input (https://playground arduino.cc/Main/InterfacingWithHardwaredinputTOC) = User Interface (https://playground arduino.cc/Main/InterfacingWithHardwaredul) = Storage (https://playground arduino.cc/Main/InterfacingWithHardwaresStorage) = Communication (https://playground.arduino.cc/Main/InterfacingWithHardware#Communication) = Power supplies (https://playground arduino.cc/Main/IntwithkW- PwSup) = General (hetps://playground arduino.cc/Main/InterfacingWithHardware#General) Interfacing with Software (https://playground arduino.cc/ Main/InterfacingWithSoftware) User Code Library (https://playground arduino.cc/Main/GeneralCodetibrary) = Snippets and Sketches (https://playground arduino.cc/Main/Sketchlist) = Ubraries (https://playground arduino.ce/Main/ Librarylist) = Tutorials (https://playground.arduino.cc/Main/Tutoriallist) Suggestions & Bugs (https://github.com/arduino/arduino/issues) Electronics Technique (https://playground arduino.cc/Main/ElectrolnfoResources) Sources for Electronic Parts (https://playground arduino.cc/Main/Resources) Related Hardware and initiatives (https://playground arduino.cc/ Main/SimilarBoards) Arduino People/Groups & Sites (htep://playground arduino.cc/Main/People) Exhibition (htep://playground arduino.cc/Projects/ArduinoUsers) Project Ideas (http://playground arduino cc/Projects/Iceas) Languages (i: lalavasoundarduinesccdin/Languages) Participate (hteps://playground arduino.ce/Main/Participate) = Formatting guidelines (htps://playgroundarduino.ce/ Sate) Merdepabehdontrsrile® UTH-ARDUINO-CC/LOGINTCLIENT_1 = Allrecent changes (https://playground arduino cc/Site/AllRecentChanges) = Pri (hetpsi//playground ardvino.cc/PmWiki/PrWik) = WikiSand30x training (https://playground arduino.cc/Main/WikiSandbox) = Basic Editing (https://playground arduino.cc/PrWiki/BasicEditing) = Documentation index (hetp://wmw pwiki org/wiki/PmWiki/Documentationtndex) LAYGROUN The LM35 is a common TO-92 temperature sensor. It is often used with the equation temp = (5.0 * analogRead(tempPin) * 100.0) / 1024; {Get Code] (https://playground arduino.cc/Main/LM3SHigherResolution?action=sourceblock&inum=1) However, this does not yield high resolution. This can easily be avoided, however. The LM35 only produces voltages from O to s1V. The ADC uses SV as the highest possible value. This is wasting 80% of the possible range. if you change aRef to 11V, you will get almost the highest resolution possible. The original equation came from taking the reading, finding what percentage of the range (1024) itis, multiplying that by the range itself(aRef, or S000 mV), and dividing by ten (10 mv per degree Celcius, according to the datasheet: http://www.ti.com/lit/ds/symlink/im3S.pdf (http://www.ti.com/lit/ds/symlink/Im35.pdf) However, if you use 11V as aRef, the equation changes entirely. If you divide 11V over 1024, each step up in the analog reading is equal to approximately 0.001074V = 1.0742 mV. If 10mV is equal to 1 degree Celcius, 10 / 1.0742 = ~9.31. So, for every change of 9.31 in the analog reading, there is one degree of temperature change. To change aRef to 11V, you use the command "analogReference(INTERNAL);” Here's an example sketch using 1.1as aRef: float tempC; int reading; int tempPin = void setup() { analogReference(INTERNAL); Serial begin(9600); t YAGER suns arduino.cc) reading = analogRead(tempPin); tempC = reading / 9.31; Serialprintin(tempC); sig IN (HTTPS://AUTH.ARDUINO.CC/LOGIN?CLIENT_ID=PLAYGROUN delay(1000); } [Get Code] (https://playground arduino.cc/Main/LM3SHigherResolution?action=sourceblocké&num=2) With this sketch, approximately a tenth of a degree resolution is possible. Of course, such small numbers are going to be somewhat inaccurate because aRef will not be exactly 1.1V. Also, the LM35 is only guaranteed to be within 0.5 degrees of the actual temperature. However, it does yield higher resolution, if only for appearances’ sake. Aside note: with aRef at 1.1V, the temperature range of the LM35 is limited to 0 to IO degrees Celcius. (ttps//playground.arduino.cc) NEWSLETTER ENTER YOUR EMAIL TS1GAGHNUGH TT PS://AUTH.ARDUINO.CC/LOGIN?CLIE Terms Of Service (//www.arduino.cc/en/Main/TermsOfService) Privacy Policy (//www.arduino.cc/en/Main/PrivacyPolicy) Contact Us (//www.arduino.cc/en/Main/ContactUs) About Us (//www.arduino.cc/en/Main/AboutUs) Distributors (//store.arduino.cc/distributors) Careers (//www.arduino.cc/Careers) © 2018 Arduino (//www.arduino.cc/en/Main/CopyrightNotice) (http sti upatii pelt tema OOH donna feta pind bgiheot sf Avdeiardeihoteam) hitpsplayeround arduino.ccMain/LMaSHigherResolution 46

You might also like