element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Need a hand, reading temperature from a NTC thermistor 10k (calibration)
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 2 replies
  • Answers 1 answer
  • Subscribers 390 subscribers
  • Views 867 views
  • Users 0 members are here
  • ntc
  • temperature
  • thermistor
  • reading
  • arduino
Related

Need a hand, reading temperature from a NTC thermistor 10k (calibration)

Former Member
Former Member over 10 years ago

Hi,

 

I'm trying to get a reading of a NTC thermistor, because i want to measure and log water temperature from a garden pond.

I have tryed reading trough the different tutorials on the arduino playground and i can conclude they only work for PTC thermistors.

Same problem with adafruit tutorials.

 

Arduino Playground - Thermistor2

 

And guess what, I'm stuck with some NTC thermistors, which is kinda annoying because the initial base value checks out ok.

But when I either increase or decrease the temperature, the value sendt to the arduino is the "inverse"

 

Meaning, my base value reading is usually  "-22.00" degrees,  well it's sorta correct, it's really +22.00

Well if that was the only problem, then i would just multiply with -1,

 

However, as the thermistor heats up, the value drops, well that is also ok i guess.  from -22 to -16 is a heat increase of 6 degrees..

So..  how would you suggest i go about reading the temperature correctly ?

 

Hardware :

 

NTC thermistor 10k , (I'm worried the seller might have sold me a 100k set)

10k pull down resistor

 

//Schematic:

// [Ground] ---- [10k-Resistor] -------|------- [Thermistor] ---- [+5v]

//                                                |

//                                          Analog Pin 0



My favorite code is the one from Arduino Playground - Thermistor2


The last one called "The Elaborate, cleaned up a bit"  image 


But I'm getting annoyed to switched to something far simpler



************************************** [code] or

dosent work, anyway code starts here.

#include <math.h>

 

void setup() {

Serial.begin(9600);

}

 

double Thermister(int RawADC) {

  double Temp;

  // See http://en.wikipedia.org/wiki/Thermistor for explanation of formula

  Temp = log(((10240000/RawADC) - 10000));

  Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));

  Temp = Temp - 273.15;           // Convert Kelvin to Celcius

  return Temp;

}

 

void loop() {

   double temp = Thermister(analogRead(0));

   Serial.println(temp);

   delay(2000);

}

 



Any help would be greatly appriciated

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 10 years ago

    Well of course my wife (vera) came and said, why don't you just add some degrees to the base value..

     

    So i changed the line

     

    Temp = Temp - 273.15;

     

    to

     

    Temp = Temp - 273.15 + 44;  // Adding the Vera Factor..


    And i guess that works. image  still very strange... 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago

    I guess that you are using the SteinhartEquation:

    b8de3b99abb2c1084ed0f52af03679e1.png

     

    T= 1/(a+b*ln(R)+c*ln(R)^3)

     

    I don't understand the temp variable

     

    Temp = log(((10240000/RawADC) - 10000));

      Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));

      Temp = Temp - 273.15;           // Convert Kelvin to Celcius

      return Temp;

     

    Did you try changing the variable name? I'm not pretty sure you can do this

     

    Temp = log(((10240000/RawADC) - 10000));

     

      x= 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));

      Temp = x - 273.15;           // Convert Kelvin to Celcius

      return Temp;

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube