LM35 Temperature Sensor with Arduino Uno

Sdílet
Vložit
  • čas přidán 4. 08. 2024
  • Let's interface Analog Temperature Sensor LM35 with Arduino Uno. We'll discuss how to setup hardware with circuit connection and then write arduino code to read temperature sensor reading from LM35 in Degree Centigrade. This video also demonstrate, how to convert ADC counts into degree centigrade with LM35 Sensor.
    Formula for Temperature Conversion (In Degree Centigrade):
    temp = analogRead(A0);
    float temp = ( temp/1024.0)*5000;
    float temp = temp/10;

Komentáře • 88

  • @unglaubichuberlieber8048
    @unglaubichuberlieber8048 Před 6 lety +24

    clear+short+beautiful, danke !!!

  • @vedansh29
    @vedansh29 Před 5 lety +2

    Nice, amazing, easy and educational video.

  • @gabrielkennethmarinas6244

    Another thing to consider, especially those who have followed the instructions on the video and get a reading of around 90, is the type of temperature sensor you have. In the video, the temperature sensor used is LM35 that is linearly proportional to Celcius scaling. Check maybe you have an LM34 that is linearly proportional in FAHRENHEIT SCALING.

  • @Navneet07860
    @Navneet07860 Před 5 lety

    it would very useful if you can give an idea totransmit this temperature and receive on another arduino using rf 432mhz module?

  • @khalilaouzade7812
    @khalilaouzade7812 Před 6 lety +1

    I have a problem with the temperature measurement it is not accurate it gives me 49.95 each time. Did you know where the problem came from?

  • @kingshahzad78
    @kingshahzad78 Před 5 lety

    wonderful sir.

  • @achyutreddy2007
    @achyutreddy2007 Před 3 lety

    @BINARY UPDATES hey, how do we make the Celcius outputs to ferinheit

  • @aimankhalim6190
    @aimankhalim6190 Před 5 lety

    Can we use this in flame sensor?

  • @saisravanivanama9591
    @saisravanivanama9591 Před 4 lety +2

    I have tried this code...but its showing value of 7, -11. My temperature sensor is 62AB LM35 DZ

  • @jailsonsanthos724
    @jailsonsanthos724 Před 4 lety

    thank you for your suport

  • @charnjit525
    @charnjit525 Před 6 lety +1

    Can I use arduino nano board to this sensor , where I am using other digital pins for a relay & 7seg display???????? Actually I want to control a relay on/off timing according to temperature limit,,,, please suggest me...

    • @BINARYUPDATES
      @BINARYUPDATES  Před 6 lety

      Yes, you can use Arduino Nano with LM35 Sensor

  • @hanafiahgunawan1137
    @hanafiahgunawan1137 Před 6 lety

    bagus videonya..

  • @AirmanAcademy
    @AirmanAcademy Před 6 lety

    sir tell me what if i connect 3 lm sensor to know the temp of three diffrent chambers

  • @chaitalineharkar161
    @chaitalineharkar161 Před 3 lety

    Can I take small arduino board

  • @achyutreddy2007
    @achyutreddy2007 Před 3 lety +2

    hey man. I'm kinda desperate, but could you explain a code, where if the thermal sensor detects a certain temperature, the servo turnes?

  • @MrRenoman2011
    @MrRenoman2011 Před rokem

    Thanks very much great video

  • @maysoonmissou6371
    @maysoonmissou6371 Před 5 lety

    I can apply this with Arduino méga 2560???

  • @Simpinski
    @Simpinski Před 5 lety +4

    If people encounter wrong readings, it's probably because the 0.48828125 is the conversion for a 5 volts power supply... If your specific Arduino supplies 3.3 volts, it would have to be a different number; do the same steps with the calculator but starting with 3.3 instead of 5.

  • @Xxkevin203xX
    @Xxkevin203xX Před 5 lety

    i am using the 36gz sensor and have this same set up, is my math wrong? my temp is reading 78c to 80c

    • @TheGremlinsParadise
      @TheGremlinsParadise Před 4 lety

      It looks like you are interpretation the raw sensor data as your temperature. Devide the sensor value by 2 and you will output your degrees celsius.

  • @thapaharis
    @thapaharis Před 5 lety

    thanks.

  • @aamirehsankhan
    @aamirehsankhan Před 5 lety

    Sir how can I use this in house and seeing the temperature in my office???

  • @stockeaswar4150
    @stockeaswar4150 Před 3 lety

    If anyones geting any high values of temperature....pls check the connections first....if problem persists pls change the sensor.....i hv done it and its working........The code above is correct

  • @pareshrahool3048
    @pareshrahool3048 Před 3 lety +1

    thanks

  • @unlimitedcreativity4400
    @unlimitedcreativity4400 Před 5 lety +13

    My Sensor is exactly the same one in the video, but it is giving me 0.00 output. please help.

    • @tupa2pac
      @tupa2pac Před 3 lety

      Mine too, and the legs are opposite. If I connect them as the video, my Arduino turns off and get disconnected (port disconnects), and the sensor gets hot.

    • @SahilSharma-ld1ho
      @SahilSharma-ld1ho Před 3 lety

      @@tupa2pac if you flip it, it gets short that why it gets disconnected, your sensor will be burnt like this

  • @AtiraHann
    @AtiraHann Před 6 lety +1

    hi. can LM35 detect temperature lower than 0 dgree celcius?

    • @AtiraHann
      @AtiraHann Před 6 lety

      and does anyone hv any suggestion on other temperature sensor that i can use to detect negative temperature.

    • @BINARYUPDATES
      @BINARYUPDATES  Před 6 lety +3

      Yes, according to the datasheet of LM35 from TI. This sensor can measure temperature from range -55 to 150 Degree Centigrade.

    • @AtiraHann
      @AtiraHann Před 6 lety

      BINARY UPDATES previously i tried to connect arduino and lm35 equipped with a java application, but somehow lm35 cannot detect lower than 0°C. And i encounter a forum saying that lm35 cannot detect lower than 0 dgree temp when connected to arduino. Which is different than the specification of the lm35.
      Some even said to try use lm335 instead. Can anyone clarify me about this? Thanks in advance.

    • @akashpatil9456
      @akashpatil9456 Před 4 lety

      Upto -55

  • @avinprakash8527
    @avinprakash8527 Před 3 lety +1

    Sir is it possible that after reaching a particular temperature, the sensor goes off? Can you please give me the code and the curcuit diagram?

    • @BINARYUPDATES
      @BINARYUPDATES  Před 3 lety +1

      Hi Avin, sensor never stops as long as it has power. You can program in a way that when certain temperature threshold reach then stop reading data from temperature sensor. I hope this can help. Good Luck

    • @avinprakash8527
      @avinprakash8527 Před 3 lety +1

      @@BINARYUPDATES thank you for the info sir but actually I am not a kind of professional and I have to code a temperature sensor for a school competition so can you please send the code?

  • @charnjit525
    @charnjit525 Před 6 lety +5

    Hello sir,,, I have tried LM35 with arduino nano board as you showed in video. Same circuit same code. But LM35 is giving incorrect reading to serial monitor. Like 11.45 /21.06 /39.88 /17.2 /25.22 . Please solve this problem

    • @2kBofFun
      @2kBofFun Před 5 lety

      It is correct. You just need to process the raw data into something sane.

    • @MrPanthalaimon
      @MrPanthalaimon Před 5 lety

      The problem is rather complex, you should first set refrence point(best to be zero centigrade of Celsius) and then mesure voltage drop from there. It requires a lot more knowledge than described here.

    • @2kBofFun
      @2kBofFun Před 5 lety

      Those answers are ok, just take average of 500 of those.

  • @gurmitsingh804
    @gurmitsingh804 Před 5 lety

    nice

  • @motoboki8991
    @motoboki8991 Před 5 lety +2

    hello, i followed your code and setup on the arduino uno. however, i never be able to get an accurate result(The result aint stable. It Looks like waves, Peak to 0, 0 to Peak). how can i fix this?

    • @TheLegend-mb8wc
      @TheLegend-mb8wc Před 5 lety

      it probably means the sensor is picking up a lot of noice, so try connecting the sensor to the 3.3V

    • @TheLegend-mb8wc
      @TheLegend-mb8wc Před 5 lety

      the output changes as well then, so youll have to use another conversion from output volts to degrees

    • @motoboki8991
      @motoboki8991 Před 5 lety

      Alright, thanks

  • @dannyt2341
    @dannyt2341 Před 5 lety

    Could this code be used with a fan to control the temperature of a room? I want to kick in a fan if the temp goes to or above 28c then cut off when it gets down to 25c

  • @adhilmehmud8171
    @adhilmehmud8171 Před 4 lety

    guys the diagram is wrong, the 1st one is righ, but the other two wires are interchanged, hope yall like this and i was helpfull

  • @malakmohammedahmedmohammed8615

    From where we got 1024 . Didn't get it

  • @kashirajvkkalshetti3498
    @kashirajvkkalshetti3498 Před 6 lety +2

    sir 4.8828125 it is in volts and ur dividing by 10 and saying that 10mv=1degree celsius how it is possible

    • @BINARYUPDATES
      @BINARYUPDATES  Před 6 lety +11

      Mr. Kashirajvk Kalshetti, I mean when we divide 5/1024 = 0.0048828125 V. Now when we conver 0.0048828125 V into mili-volt we get 4.8828125 mV. Now 1 Degree Centigrade is 10mv (according to datasheet). We must divide 4.8828125/10 = 0.48828125. Now this 0.48828125 will be multiplying factor to get Temperature in degree centigrade from LM35 Sensor. I hope this would help. Have a Good Time. CHeers

  • @arsalanwasim4177
    @arsalanwasim4177 Před 4 lety +3

    This tutorial is not correct please make corrections as follows:
    Suppose I have 0-80 volts range:
    10mv/1 C *80= 0.8= Vref
    suppose I have 8 bit adc 0-255 range and suppose my sensor value is 200
    so formula would be: sensor values * (Vref/max value)
    = 200 * (0.8/255) =0.627
    To convert to degrees centigrade 0.627*(1 C/0.01 or 10mv) = 62.7 degrees centigrade

  • @siddhifulari6044
    @siddhifulari6044 Před rokem +1

    I am getting output on serial monitor from 90 to 120 and I'm using LM35. When I remove all the connections from arduino, it is still showing some garbage value on serial monitor. What could be the issue?

    • @BINARYUPDATES
      @BINARYUPDATES  Před rokem

      Hi Suddhi, It seems like as Issue is with LM35 temperature sensor. Your Arduino is fine. If you want to test then try other sensor to make sure its not an fault of Arduino Board. Good luck and best wishes!

  • @Ali-is1wh
    @Ali-is1wh Před 6 lety

    Hii,plz give me the code of the program ,thank you

    • @BINARYUPDATES
      @BINARYUPDATES  Před 6 lety

      Mr. Ali, download program/code from github.com/binaryupdates/LM35-with-Arduino

  • @n0stalgic476
    @n0stalgic476 Před 6 lety

    I'm getting really high temperatures..I dunno what i'm doing wrong

  • @itzayaan4026
    @itzayaan4026 Před 2 lety +1

    ardu-ino-uno XD (no offense great video)

  • @prankwrankie5314
    @prankwrankie5314 Před 5 lety

    great!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @jainnypatni5345
    @jainnypatni5345 Před 2 měsíci

    I am not getting temperature reading in serial monitor... So can you tell me what's the issue?

    • @BINARYUPDATES
      @BINARYUPDATES  Před měsícem

      Hi Jainnypatni, please check with the connection between LM35 and Arduino Uno. Make sure when you hold sensor facing your face then left pin with connect to 5V, middle pin will connect to A0 and right most pin will connect to GND. I hope this may help to get temperature data. Good luck and best wishes!

  • @cyadid
    @cyadid Před 2 lety

    even though it is not effecting the result , the accurate calculation is to divide by 1023 and NOT 1024
    analogRead() returns values from 0 to 1023 so 0v is 0 and 5v is 1023 !!!

  • @mlgamer3405
    @mlgamer3405 Před 4 lety +1

    5v / 1024 = 0.0048828125 is already in volts... multiplied by 1000 to make it in millivolts. hehe.

    • @TheGremlinsParadise
      @TheGremlinsParadise Před 4 lety

      LMAO of cause if you devide voltage with a number you still have voltage as your result. Multiplying the result with 1000 will just bring you back to almost 5 volts so i am not understanding your logic.
      You do 5v divided by 1024 because that is your arduino range. Then you multiply that by 10 to see the exact (millivoltage) mV per unit.
      but DIVIDING 5v by 1024 gives you mV per unit. ITS ALREADY MILLIVOLTAGE !!! You dont have to multiply that to get mV, it will just bring you back to 5v

    • @jared1122
      @jared1122 Před 4 lety

      I guess you could divide by 5000 instead of divide by 1024 and then multiplying by 1024
      ''''
      temp = analogRead(A0);
      Serial.print(temp);
      temp=temp/1024;
      Serial.print(" /1024 ");
      Serial.print(temp);
      Serial.println();

      temp= (temp/5)*1024;
      Serial.print("TEMPERATURE: ");
      Serial.print(temp/10);
      Serial.print("*C");
      Serial.println();
      delay(1000);
      '''

    • @cyadid
      @cyadid Před 2 lety

      @@jared1122 at any case 1024 is wrong it should be 1023 cause analogRead returns values from 0 to 1023 representing 0v to 5V

  • @NoOne-br7bl
    @NoOne-br7bl Před rokem

    Hi,
    I followed your Vedic step by step by it gives me wrong values. it gave me VALUES OF 500 *C

    • @BINARYUPDATES
      @BINARYUPDATES  Před rokem

      Please make sure your LM35 Sensor genuine and functioning properly. Otherwise connections will be the only reason for not getting real temperature value. Good luck and best wishes!

  • @CorryTerblanche
    @CorryTerblanche Před 4 lety

    Why 1024 ? sorry the audio was not clear.

    • @vijayadeepika2039
      @vijayadeepika2039 Před 4 lety

      Yah tell me ans to this question

    • @BINARYUPDATES
      @BINARYUPDATES  Před 4 lety

      The Analog Pins means an ADC Channel on Arduino Uno is 10-bit so 2^10-1=1023 and if you start counting from 0 as in any digital electronics. Its become 2014. I hope this can help you. Thanks

    • @cyadid
      @cyadid Před 2 lety

      @@BINARYUPDATES Wrong !
      the analogRead() returns linear value representing the voltage 0 for 0V up to 1023 for 5V so the voltage calculation is V=analogRead * (5/1023)
      NOT 1024

  • @nayyabwaleed7223
    @nayyabwaleed7223 Před 4 lety

    hi

  • @bkyuksel
    @bkyuksel Před 3 lety +1

    thank you for the code. but this lm35 is totally not accurate. cant be trusted. instead good to use DHT11 or DHT22

    • @ardhi1269
      @ardhi1269 Před 3 lety

      Lm35 is really accurate
      If you use it correctly
      Its only 0.5% error

  • @Woodcraft1987
    @Woodcraft1987 Před 5 lety

    Are you robot?

  • @gangaprasadsupare6771
    @gangaprasadsupare6771 Před 4 lety

    bc