Make an Arduino Temperature Sensor (Thermistor Tutorial)

Поділитися
Вставка
  • Опубліковано 8 вер 2024
  • Make an Arduino Temperature Sensor (Thermistor Tutorial)
    In this video, we walk through the steps in setting up a thermistor temperature sensor on an Arduino Uno. First I show how to output the temperature readings to your serial monitor. Then I go over how to connect and output the temperature readings to a 16x2 LCD display.
    Get the thermistor here: www.amazon.com...
    More information about this project can be found in the tutorial at: www.circuitbas...
    Check out the Circuit Basics blog for more articles and tutorials on the Raspberry Pi, Arduino and other DIY electronic projects! www.circuitbas...
    Facebook: / circuitbasic
    Twitter: / circuitbasics
    Instagram: / circuitbasics

КОМЕНТАРІ • 297

  • @DeaBroggn
    @DeaBroggn 6 років тому +37

    To anyone getting negative values, measure the resistance of the thermistor and use a resistor with the same value! I had the same problem with the thermistor I got from a cheap Arduino starter pack. Turned out it was not as the seller described a 10k, but a 100k resistance thermistor. after I changed the resistor to a 100k one to match the thermistor, I got plausible values.
    Also thanks for putting together the formulas, Circuit Basics, I gave up after reading about it for 10mins.

    • @JerryEricsson
      @JerryEricsson 4 роки тому +1

      Exactly, and if you want to be very accurate, measure both, and try to match, you may find that some 10 K's read high, others low, I tried six before I got an exact match.

  • @orionsarc2976
    @orionsarc2976 6 років тому +15

    It should be log(10000./(1024./RawADC-1)) via the voltage divider equation.
    The sensor uses a thermistor, which changes resistance at varying temperatures.
    The Steinhart-Hart equation approximates the temperature at a given resistance of the thermistor via 1/T=A+BlnR+ClnRlnRlnR.
    Since the Arduino cannot measure resistance directly, a voltage divider is made by simply adding a resistor in series with the thermistor.
    Since current is the same in a series circuit, the total current I=E1/(R1+R2) and I=E2/R2.
    E1 is the 5V you apply to the + pin.
    R1 is the small resistor in the circuit, which you can measure with a multimeter to be about 10000 Ohms.
    R2 is the resistance of the thermistor.
    E2 is the voltage measured with the S pin in reference to - GND using analogRead().
    Therefore, E1R2=E2R1+E2R2, then solving for R2=E2R1/(E1-E2), which can be rewritten as R2=R1/((E1-E2)/E2) and further as R2=R1/(E1/E2-1).
    So, the resistance of the thermistor R2= 10000/(1024/analogRead(A0) - 1) .

    • @abhijitkumarmanna2031
      @abhijitkumarmanna2031 2 роки тому

      Arduino ATmega 328 microcontroller has an inbuilt analog to digital converter,it can sample and quantize analog reading to digital.

    • @Lyng77
      @Lyng77 2 роки тому

      Do we need to calculate the thermistor resistance manually... And how to enter the values in Arduino to change into temperature

  • @JerryEricsson
    @JerryEricsson 4 роки тому +8

    Thanks a billion! I was digging through my component collection this morning and came across a bag of 40 thermistors, 20 rod and 20 glass bulb. I have no friggin idea why the hell I ever ordered them, but I must have had something in mind at the time, could have been a few years back but I am sure I never did anything with any of them. So I decided to do something with at least one of them today. I spend much of the morning looking at different projects done by others, many very complicated, others rather simple, some that appeared to have less of an understanding of these things then I do. Then I found yours. The instructions were simple, code readily at hand, and it worked right off first try, what a deal! Instead of using a breadboard, I have some screw terminals with plugs on the opposite side, this worked great for experimenting with these things. OH WOW It just came to me, my niece wanted me to build here some temp sensors for her ghost hunting outfit! I got these for that, and never got around to building it, as her mom passed on right after I got them, wow. Well now I have to figure out how to build the group of four sensors to tell if a cold or hot spot develops in her target location. Fun building for her ghost adventures, I am not really into ghosts, but I love building detectors of all sort for her outfit!

  • @FilamentFriday
    @FilamentFriday 5 років тому +14

    The code shows R1 = 10000 but the fixed resistor in your circuit in 100k or 100000. Is the code wrong?

    • @thefunnyguy16
      @thefunnyguy16 Рік тому +1

      Your sensor maximum rezistente can be deferent

  • @rikvdmark
    @rikvdmark 6 років тому +15

    This was very useful, thank you for the great explanation! Exactly what I need to finish a project I'm working on :)

  • @chemicalvamp
    @chemicalvamp 7 років тому +7

    Thanks for the how-to, I'll have to refer to this again when i get all the parts in.

  • @kingblue588
    @kingblue588 5 років тому +8

    I recommend to anyone trying this project to use a trimmer instead of a resistor so, that you can adjust the sensitivity of the temperature reading. Also, there are some temperature reading error. I found the solution within the comments, just change some values to c1=0.7904710802e-3, c2=2.251846924e-4, c3=0.87060700625e-7.

    • @littlefrank90
      @littlefrank90 Рік тому

      lmao these are even worse, instead of 90° room temperature I now have 143° room temperature. Great.

  • @iblesbosuok
    @iblesbosuok 5 років тому +3

    I almost always use LM35 for temperature tansducer. 10mV/°C, precisely 1.00 volt at 100°C.
    Cheers from Indonesia

  • @practicalcircuits3640
    @practicalcircuits3640 4 роки тому +2

    Great job, and a helpful circuit.
    I have made a temperature sensor circuit using NTC and without arduino, just in case if anyone want to understand how does it works.

  • @celtichongy
    @celtichongy 5 років тому +6

    Short but sweet. Excellent intro project.

  • @walterblanc9708
    @walterblanc9708 2 роки тому

    Excellent Thankyou. I probably won't be using an Arduino but the info on Thermistors and converting from V to C is just what I was looking for. Hopefully going to control some fermentation with the info :)

  • @joachim4660
    @joachim4660 3 роки тому +2

    This is just awsome! Simply explained and thus perfectly understandable.

    • @sciencesi5595
      @sciencesi5595 3 роки тому

      Add the termistor to Gnd side of V divider. Suppose if smthng goes wrong & thermistor shorts it would short 5v to the analog pin without resistance so 10K before thermistor is safe

  • @TRONMAGNUM2099
    @TRONMAGNUM2099 3 роки тому +2

    Yes!!! Basic enough I can understand!!!

  • @varunatik632
    @varunatik632 4 роки тому +1

    Thanks a lot. I recently did scavenge a thermistor from an old laptop battery and I was really thinking how could I use it and I just made a thermometer using it although I had a hard time to obtain its resistance value but I finally calculated it to be around 10 k ohms

  • @chrisscullynz
    @chrisscullynz 8 років тому +30

    would be good if you explained what each component does

    • @djsnowman06
      @djsnowman06 7 років тому +11

      Chris Scully the thermistor (thermal resistor) and the resistor create a basic voltage divider. the thermistor's resistance varies with temperature. The voltage divider takes that variation in resistance and turns it into a variable voltage signal. Using math and a little logic you can map that signal to what ever scale you like. Fahrenheit, Celsius, Kelvin etc.

    • @noahwolfe1304
      @noahwolfe1304 7 років тому +3

      Chris Scully qtips clean wax out of your ears.

    • @dieselgeezer18
      @dieselgeezer18 5 років тому

      If you don't know anything about electronics you should close this video and learn basic things about them

    • @Wilson84KS
      @Wilson84KS 3 роки тому +2

      Explaining the code and all those strange values coming from nowhere is a must, without that the video is pretty much worthless, can't understand how it works besides the voltage-divider, like if you need to connect the thermo-resistor to ground or use a ptc instead of ntc, then you can't do anything with the shown code, all you can do is just copy&paste blindly without any understanding of what is going on, this is not the way how one can learn anything, even if the global schooling system works like that, but no one of us goes there to learn anything, but we watch videos like this to learn things.

  • @lis610
    @lis610 8 років тому +15

    How did you come up with these numbers:
    Temp = log(10000.0*((1024.0/RawADC-1)));
    Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp

    • @manla8397
      @manla8397 6 років тому

      This equation comes from the thermistor data sheet. Check this before imputing the equation. Different thermistor have different coefficients.

    • @marcinwojcik9159
      @marcinwojcik9159 6 років тому +1

      this is a answer www.thinksrs.com/downloads/programs/Therm%20Calc/NTCCalibrator/NTCcalculator.htm

    • @Orionsarc12
      @Orionsarc12 6 років тому +1

      Marcin, I actually found out that the code was slightly wrong and should be log(10000./(1024./RawADC-1)) from the voltage divider equation and now the sensor works fine :) Nevertheless, thanks for the link, it helped me understand the formula better!

  • @chfin7251
    @chfin7251 6 років тому

    Excellent video. I am new to Arduino world and this served as a great introduction to Arduino for me.

  • @andrasparanici5491
    @andrasparanici5491 4 роки тому +4

    Thank you! Although, the page from the link to circuitbasics.com it's a bit different that the one in your video.

    • @andrasparanici5491
      @andrasparanici5491 3 роки тому

      @Tatum Leonidas Hi there! I'm not sure how this would be related to my original comment. I commented the video, not about something else.

  • @mahtvabhushan5793
    @mahtvabhushan5793 3 роки тому

    SO COOL! SIMPLE AND EASY TO FOLLOW. YOU DESERVE MORE LIKES

  • @Popsickle950
    @Popsickle950 7 років тому

    Looks cool! will try this when i'm home i like the simplicity you put into your vids

  • @kevinlu9859
    @kevinlu9859 5 років тому +1

    What would be the simplest way to use the data collected and create a longterm graph? (weeks of data)

    • @alochle9566
      @alochle9566 5 років тому +1

      Use a sd reader and simply add your readings to a simple text file

  • @tzachus
    @tzachus 2 роки тому

    Great Chanel great video. Can u upload how to conect the lcd to the androino and what is the resistants that need?

  • @garystafford6570
    @garystafford6570 5 років тому +2

    Does the formula in the code change if I use a 10K thermistor and 10K resistor?

    • @user-pj1er1vc5j
      @user-pj1er1vc5j 5 років тому

      I just used one to control a relay, i used the same code and it worked just fine

  • @gerrymcerlean8432
    @gerrymcerlean8432 3 роки тому +1

    This was useful. Thank you. Does the thermistor need to be calibrated?

  • @0gkeepmy601
    @0gkeepmy601 3 роки тому +2

    Which resistor did you use for the display??

  • @drtechtek2165
    @drtechtek2165 4 роки тому +1

    Thnx :)
    I needed to put the sensor to the 5V pin, if not it was showing me 10 degrees less.

  • @mother-fng-bonswa3612
    @mother-fng-bonswa3612 6 років тому

    i don know why the 100 k divider.. i mean you can put the thermistor on the 5 v tough. and once its increase its value or decrease it change its output voltage. this can be converted to temperature in arduino.

  • @habibulahsan9859
    @habibulahsan9859 Рік тому

    equation of R2 will be R1 / (1023.0 / (float)Vo - 1.0)

  • @shutdahellup69420
    @shutdahellup69420 7 років тому +3

    Can't copy the code...link is not working properly...can copy everything on page except the code itself???? No matter what browser i try...

  • @sigmundojr
    @sigmundojr 7 років тому +1

    Hello. Great Job!! Tks.
    Look, is there any possibility to 'log' (save) this data into a database or TXT file for example?

  • @MrBobWareham
    @MrBobWareham 6 років тому

    That is the best introduction to Arduino I have seen thank you!!

  • @christophertadeo6120
    @christophertadeo6120 Рік тому

    I love my arduino! ❤️😀👍

  • @elecnut8211
    @elecnut8211 7 років тому

    Another excellent video. You did a great job !!!

  • @porterlindsey235
    @porterlindsey235 6 років тому +2

    Why am I getting readings of -459.67 F repetitively?

  • @peiwen4727
    @peiwen4727 5 років тому +1

    what are the resistance value for the second and third resistors?

  • @tylermates2857
    @tylermates2857 3 роки тому +3

    The snow glows white
    On the mountain tonight
    Not a footprint to be seen
    A kingdom of isolation
    And it looks like I’m the Queen
    The wind is howling
    Like this swirling storm inside
    Couldn’t keep it in
    Heaven knows I tried…
    Don’t let them in
    Don’t let them see
    Be the good girl you always have to be
    Conceal
    Don’t feel
    Don’t let them know…
    Well, now they know!
    Let it go, let it go
    Can’t hold it back anymore
    Let it go, let it go
    Turn away and slam the door!
    I don’t care what they’re going to say
    Let the storm rage on
    The cold never bothered me anyway
    It’s funny how some distance
    Makes everything seem small
    And the fears that once controlled me
    Can’t get to me at all!
    It’s time to see
    What I can do
    To test the limits and break through
    No right, no wrong
    No rules for me
    I’m free!
    Let it go! Let it go!
    I am one with the wind and sky!
    Let it go! Let it go!
    You’ll never see me cry!
    Here I stand and here I’ll stay
    Let the storm rage on…
    My power flurries through the air into the ground
    My soul is spiraling in frozen fractals all around
    And one thought crystallizes like an icy blast
    I’m never going back
    The past is in the past!
    Let it go! Let it go!
    And I’ll rise like the break of dawn!
    Let it go! Let it go!
    That perfect girl is gone!
    Here I stand in the light of day…
    Let the storm rage on!!!
    The cold never bothered me anyway

  • @yekutielbenheshel354
    @yekutielbenheshel354 7 років тому +1

    Excellent! Thank you!

  • @TnInventor
    @TnInventor 4 роки тому

    nice video , can you help me and tell me where or how you found Steinhart-Hart equation variables?...

  • @singgihpanji
    @singgihpanji 4 роки тому

    great.
    will try.
    thanks.

  • @vintyprod
    @vintyprod 4 роки тому

    this was a really good video. thanks a ton

  • @lathabv5870
    @lathabv5870 7 років тому

    sir i need clear connections of lcd and aduino as explained for thermistor and arduino will u plzzz made a video oevrall for lcd connections for temperature detection

  • @mohaamoha9272
    @mohaamoha9272 5 років тому

    Tanks for video😍😍😍
    Plz help what can i change if i use 10ohm thermestor

  • @taganilelouisev.3267
    @taganilelouisev.3267 3 роки тому

    Dude. How do you program a Thermal Checker during like the ones they're using to check your temperature.

  • @hiteshpatel650
    @hiteshpatel650 4 роки тому

    how temperature readings may differ if we cover one side of thermistor with hand and the other left open to surroundings..???
    will there any effects of environment temperature to it too or just the temperature from the hands are sufficient to drive the thermistor.?

  • @MrDrekow
    @MrDrekow 7 років тому

    If I used another thermistor instead of the resistor would this give me the difference? I want to monitor the cooling of my radiator.

  • @MinecraftMineturtle
    @MinecraftMineturtle 6 років тому +1

    Thanks, this is a really amazing project! I am having a slight issue where it's reading 194 degrees though... I'm pretty sure my room isn't on fire right now either. Any ideas?

    • @manla8397
      @manla8397 6 років тому

      Or you are not using a 100k ohm thermistor. This is a potential divider circuit. The output voltage you read all depends on your components ‘ resistance.

    • @TheVideoVolcano
      @TheVideoVolcano 4 роки тому

      you probably needed to subtract a value from it to bring it into correct range

  • @hosseinhossein5827
    @hosseinhossein5827 6 років тому

    that was great , can you ask my question? how to read the pirani vacuum gauge using arduino?

  • @asmaafouda4417
    @asmaafouda4417 2 роки тому

    Can you make a distance measure curcit

  • @zx3215
    @zx3215 4 роки тому

    Doesn't a thermistor heat itself up when operating (there's current passing through)?
    (sorry, I don't have sound on my laptop here, maybe it was mentioned in the video)

  • @sshamshuddin6132
    @sshamshuddin6132 5 років тому +1

    Can we change into Celsius with the lcd display??

  • @syaduinotech3681
    @syaduinotech3681 Рік тому

    Is this sensor can detect ultra low temperature? Below -80 degree celcius? Your comment very much appreciated

    • @Circuitbasics
      @Circuitbasics  Рік тому

      The epoxy style thermistors like this one usually only go down to around -55C at the most. If you need to monitor lower temperatures you could always use a dry ice TempTale

  • @florianfuckinggames
    @florianfuckinggames 2 роки тому

    thank you man

  • @sto2779
    @sto2779 3 роки тому

    is that a NTC or PTC thermistor? because the code you provided makes the temperature drop for the thermistor Im using while temperature increases...

  • @user-eq5qh2ub9w
    @user-eq5qh2ub9w 3 роки тому

    The output of a thermistor is nonlinear, in the calibration block of code how to account for it?

  • @placebo_yue
    @placebo_yue 5 років тому

    Would that thermistor thingy survive if applied over a heat sink? i need to keep a metal at a stable temperature and it should be able to survive certain peaks.

  • @user-tr2dh4xx6u
    @user-tr2dh4xx6u 3 роки тому

    i am looking to convert an old freezer into an arduino controlled air conditioner, how would you recommend i do this

  • @qzorn4440
    @qzorn4440 2 роки тому

    great info.. thanks...:)

  • @arnabmondal3436
    @arnabmondal3436 2 роки тому

    Can I do it with a NODEMCU module?

  • @mustafakhalil007
    @mustafakhalil007 5 років тому

    Hi, thank you for this demo, Is that possible to mount 2 thermistor at the same time ? and the output data shows as curve ?

  • @ponciusz
    @ponciusz 5 років тому +1

    noob question. Why the resistor needs to be the same value as thermistor??

  • @adjiepratama778
    @adjiepratama778 6 років тому

    nice video but i have some question.... i have a project like this video but in my project if the temp up to 50 C , i want red led is on if below 50 c the green led is on.... why make it work? thanks before....

  • @chitrarasanangayarkkanni2796

    AS we are using 100k resistor for R1 the value of variable r1 must be 100000 but why the code has value 10000 for R1?,some one please answer if you know

  • @BasharatAli-xs7mm
    @BasharatAli-xs7mm 2 роки тому

    Hello brother this circuit make with volt and current meter means volt amp Watt and temperature show on one display for 5v
    Please make a More video

  • @rogercrier
    @rogercrier 3 роки тому

    Could the Arduino have 64 thermistors that it monitors in sequence, then repeats?
    Or have the Arduino work in unison with an STC1000 temp monitor, and connect the 64 thermistors across the terminals of the STC1000

  • @thecool2328
    @thecool2328 2 роки тому

    Why it stop serial.println when temperature is up 38°c

  • @deadalpeca8099
    @deadalpeca8099 6 років тому

    Hi, I have been using a 10 ohm thermistor which heats up a lot when I use a 10 Ohm resistor. So, can you please tell me what should I do so that the resistor and thermistor don't not heat up so much because I just burned myself without realizing today. Any help will be appreciated

  • @kreatifteknik3179
    @kreatifteknik3179 4 роки тому

    please master, how to combine three or more temperature sensors in an arduino and display on an LCD, I wanna making Thermal
    Conductivity Meter

  • @piotrbielawski4569
    @piotrbielawski4569 Рік тому

    How to send this data to nextion display?

  • @tylermates2857
    @tylermates2857 3 роки тому +1

    keep up the good work

  • @renanzuba6436
    @renanzuba6436 6 років тому

    Is it possible interfacing ultrasonic sensor HC-SR04 with Xcos? If yes, can you tell me how?

  • @yudirudiat6499
    @yudirudiat6499 3 роки тому

    Give the link for downloading math library please

  • @poopdealer4207
    @poopdealer4207 5 років тому

    well, now I know what to do, thanks

    • @neekoooo6282
      @neekoooo6282 5 років тому

      you probably dont remember posting this comment but did you end up using the code on the website? Or the one in the video?

  • @ilmaannafia1262
    @ilmaannafia1262 4 роки тому +1

    Do you know the range from that thermistor?

    • @ilmaannafia1262
      @ilmaannafia1262 4 роки тому

      I have a module of that thermistor. Will it work to module to?I

  • @adamjensen6376
    @adamjensen6376 7 років тому

    hey there I have a ntc thermistor 4k7 I think its blue with UEI 085 on it so not sure what kind is it how can I detect on what kind cause the reading it give me is 200 + F
    and 100+ C

  • @Hibcon
    @Hibcon 6 років тому

    great tutorial, thank you. i have an homework. the goal is to measure the temperatue and the moisture level of a fridge wirelessly. analyzing and saving the data gathered from the device. how can I do that?

  • @umargul5644
    @umargul5644 2 роки тому

    Well done

  • @civicoulas15
    @civicoulas15 3 роки тому

    I intend to build one but i want to measure very high temps(160-200 Celsius). Using a thermistor from my 3d printer as it can measure up to 250 Celsius.Do you think it will work?

  • @dannyelpdyahoocombr
    @dannyelpdyahoocombr 4 роки тому

    Thanks bro. But why is showing negative temperatures for me?

  • @Sean_XT
    @Sean_XT Рік тому

    would this work with a high temperature thermocouple as well?

  • @panthLeoJTm
    @panthLeoJTm 3 роки тому

    Hi sir, c'est une très bonne présentation

  • @srisubhash8421
    @srisubhash8421 7 років тому

    if we want to connect to lcd screen how many resistors needed and with what resistance

  • @hiba5140
    @hiba5140 6 років тому

    Hi what if I wanted to get a table containing each degree of temperature with its own resistance, what can I change in the coding program?

  • @lohithsomasundaram2867
    @lohithsomasundaram2867 3 роки тому

    will it work without contact and can we use 10 k resistor how will the code change

  • @kuttiakhil3627
    @kuttiakhil3627 6 років тому +1

    can we do the same on arduino nano?

  • @andrewlee1791
    @andrewlee1791 3 роки тому

    Is this suitable to measure surrounding temperature?

  • @humaidalvi00786
    @humaidalvi00786 7 років тому

    Hi! Thanks for the help i would like to know how can I attache Bluetooth and take the reading on my phone

    • @bryanDaMazo16
      @bryanDaMazo16 7 років тому

      You have to dev an app. Then, you have to send the data by Bluetooth.

  • @nedimfejzic8811
    @nedimfejzic8811 7 років тому

    Great video 👍🏻

  • @Jan.-
    @Jan.- 5 років тому

    Is it possible to run the thermistor with 3,3v? The NodeMCU´s analogread pin only supports up to 3,3v :/ If yes, how? The analogpin outputs values of 0-1024 like the normal arduino but it doesn´t work properly...

  • @manofmesopotamia7602
    @manofmesopotamia7602 5 років тому

    what range of temperature we can use it? could we use to measure about 300c?

  • @billgrubbs1
    @billgrubbs1 7 років тому

    I got this to work and would like to use it in my greenhouse. I can put the Arduino in a weather proof box, but how do I put the thermister/resistor on a long wire in the greenhouse? I am sure someone has done this. Perhaps you could show me how you did it.

    • @djsnowman06
      @djsnowman06 7 років тому

      Bill Grubbs if you are running a long distance you will have to take voltage drop into consideration. use some small gauge communications wire, something like shilded twisted three wire. solder the whole voltage divider setup on ther end and use heat shrink on all the leads and a larger piece to bundle them up

  • @MuhammadUsman-dy4zm
    @MuhammadUsman-dy4zm 5 років тому

    I need little expert help.
    My AirConditioner outside has a heat sensor when outside temperature is above 35 C it cools alot below 35C everything is fine as per its compressors working .
    Is there any way i can fix the temperature of sensor no matter how hot outside it gives the inside system temperature of 34C fixed any way possible ?

  • @alinioanmoroi1370
    @alinioanmoroi1370 5 років тому

    Nice one...however i have a question.How to add a mosfet to the code to controll a fan when the temp reach a set point?i don't know how to program arduino that why i ask..thank you!

  • @AFE948
    @AFE948 4 місяці тому

    Can you make this water proof?

  • @Danny-cw9iw
    @Danny-cw9iw 4 роки тому

    How do u put the lcd display on the bread board

  • @madhavshanbhag7716
    @madhavshanbhag7716 3 роки тому

    If we use LM35 sensor can we add same code to that??

  • @nicospok
    @nicospok 3 роки тому

    I copy pasted the code and when I touch it it goes down instead of up and im pretty sure im warmer than my room. why is that happening?

  • @BushCampingTools
    @BushCampingTools 5 років тому

    Great thanks.

  • @JTech_._
    @JTech_._ 8 років тому

    when i change it to celsius it doesnt change numbers with both f and c it shows it as minus

  • @mohammadmahdiabbasi4896
    @mohammadmahdiabbasi4896 3 роки тому

    excellent!!

  • @ilyushin78
    @ilyushin78 3 роки тому

    I have ntc 10d/9 what to change in code?