Это видео недоступно.
Сожалеем об этом.

Analog Temperature Sensor with Arduino

Поделиться
HTML-код
  • Опубликовано: 16 авг 2024
  • Find code and diagrams at: www.EliTheComp...
    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....
    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);
    }

Комментарии • 12

  • @webdeveloperninja9220
    @webdeveloperninja9220 4 года назад +1

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

  • @junaid_qadir
    @junaid_qadir 3 года назад

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

  • @perfection4all
    @perfection4all 4 года назад +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.

  • @sunnyeworks
    @sunnyeworks 4 года назад

    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.

  • @RS-vz5gc
    @RS-vz5gc 4 года назад

    Good to see Eli back.

  • @NadooyNAB
    @NadooyNAB 4 года назад

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

  • @nhatquangtruong8858
    @nhatquangtruong8858 2 года назад

    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 4 года назад

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

    • @elithecomputerguy
      @elithecomputerguy  4 года назад

      ... 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 4 года назад

      @@elithecomputerguy alright thank you