Analog Temperature Sensor with Arduino

Sdílet
Vložit
  • čas přidán 5. 07. 2024
  • Find code and diagrams at: www.EliTheComputerGuy.com
    You can use Analog Temperature Sensors in Arduino Projects to determine the temperature in your environment.
    Functional Parts in the Project:
    Arduino Uno - store.arduino.cc/usa/arduino-...
    Breadboard Kit - amzn.to/2Xih5ei
    Analog Temperature Sensor - amzn.to/2Rkkl3k
    #define sensorPin A0
    void setup()
    {
    Serial.begin(9600);
    }
    void loop()
    {
    int reading = analogRead(sensorPin);
    float voltage = reading * 5.0;
    voltage /= 1024.0;
    float temperatureC = (voltage - 0.5) * 100 ;
    float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0;
    Serial.print(voltage); Serial.print(" volts - ");
    Serial.print(temperatureC); Serial.print(" degrees C - ");
    Serial.print(temperatureF); Serial.println(" degrees F");
    delay(3000);
    }
  • Věda a technologie

Komentáře • 12

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

    Eli helped me 6 years ago get a developer job without a degree, now he is helping me get into IoT. Thanks man!

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

    Eli you are beyond awesome! You make life in an extremely complex tech world seem simple & make sense of everything. Thank you for what you contribute to our tech world and it's evolution.

  • @RS-vz5gc
    @RS-vz5gc Před 4 lety

    Good to see Eli back.

  • @junaid_qadir
    @junaid_qadir Před 3 lety

    I fall in love with the method of your teaching. You are the shining star.

  • @NadooyNAB
    @NadooyNAB Před 4 lety

    Did this and it worked!!!!!!! THANK YOU ALOT!!

  • @sunnyeworks
    @sunnyeworks Před 4 lety

    the pull up resistor is missing. What I noticed is the middle pin of the temperature sensor needs a pull up with a resistor in between preferably of 4.7KOhm resistor. this is needed to get correct temperature readings.

  • @nhatquangtruong8858
    @nhatquangtruong8858 Před 2 lety

    Hi. I don't knownif you are still checking this channel but I was wondering if I can pay you to program a ds1821 analog to digital sensor. I have a infrared sauna with damaged sensor. My buddy thought it was a reset button so he pressed it so hard that it broke. I bought a new temp sensor and thought it was just plug and play but after many failed attempted I finally found the reason. Your channel explain really well but I am not very technical. All I can do is solder the sensor. Please let me know if you can. I will compensate you for your time. Thank you

  • @gavinpust9669
    @gavinpust9669 Před 4 lety

    My is displaying like 200 degrees. What do I do?

    • @elithecomputerguy
      @elithecomputerguy  Před 4 lety

      ... probably a bad sensor... if you reverse wire them you usually kill them... that's why you buy them 5 at a time...

    • @gavinpust9669
      @gavinpust9669 Před 4 lety

      @@elithecomputerguy alright thank you