DS18B20 Arduino Temperature Sensor - How to Tutorial

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 82

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

    Thank you for explaining that in such detail. I found your video useful

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

    It's naturally slower than the thermocouple, because the sensor's heat transfer function is a function of specific heat, mass of the sensor, surface area of the heat sensing element, i.e., the time constant (time it takes to reach 63% of equilibrium condition).

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

      Yeah, those are important. The thermal mass of the sensor and its metal can are likely much larger than the little thermocouple - even with their wires (which are probably of similar gauge). I would have preferred to have seen both fully submerged, as the heat transfer would have been faster, reaching equilibrium sooner, and the readings a touch more accurate, as the Dallas sensor wouldn’t have been influenced by the ambient air and/or ice (if the ice and water hadn’t yet agreed on 0C). Of course, doing so might have shorted the sensor, given it’s iffy seal - a situation unlikely to yield good results.

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

    Nice. Always glad to see a new video on your channel.

  • @AlexEden-ey5bp
    @AlexEden-ey5bp 24 дні тому

    Would you be able to make a cable map thingy for the same thing just with 3 seperate thermometers attached?

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

    hiee bro i need your help. I am using this sensor, for the first time it worked perfectly but after that, I had cut the wire to solder jumper wires but after soldering it is showing -126 degree celcius only. How to resolve this??

  • @yasmineyachmina8898
    @yasmineyachmina8898 4 роки тому +3

    hello sir, I have a problem that my Ds18b20 sensor always displays on the serial monitor -127.00 and I don't know where the fault is

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

      I had this, I think flipping the SDA and SCL into the board fixed this for me.

    • @vic-san12
      @vic-san12 4 роки тому

      same here. i tried this today at december 7, 2020. got this problem too.

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

      @@vic-san12 send me ur email i will send uo a program

    • @vic-san12
      @vic-san12 4 роки тому

      @@yasmineyachmina8898 fixed my problem. I just need to install the library. thank you for taking the time to reply tho. really appreciated

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

      @@vic-san12 which library did you install ?

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

    what is the difference between sensor DS18B20, DS18S20, DS1822, DS1820?

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

    Hi! Is it possible to use this device on other controler like stm32f446RE with the same library as you used? I'm quite unfamilliar with I2C comunication and your library look user friendly. Thank you in advance!

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

    Thanks for your demo video for DS18B20 sensor, Sir. I want to ask, can the DS18B20 sensor measure the temperature for soil ?
    Thank you...

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

      I don’t know if the metal cover would corrode in the soil and I also wouldn’t trust the existing black sleeve to be completely waterproof where it ends, so I would probably coat the exposed metal With either epoxy or silicone sealant to cover the metal and go partway on the sleeve to seal that area. Then I would also coat the other end of the black sleeve where it meets with the rest of the cable so the metal is now covered and what looks like black heat shrink tubing on my probe at least, is sealed on both ends of it.

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

      ​@@GadgetReboot Ohhh, I see, i didn't think about the corrosion before, thanks for your suggestion. One more question Sir, will the silicone reduce capability of the sensor ?

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

      I’m not sure to what extent the sensor will change its profile such as becoming slower to respond to changes or being less able to discern between steps in temperature changes but for measuring a slow environment like soil temperature it probably doesn’t need to be so accurate or fast responding so if I were doing it I would apply just a thin coat to provide some protection with minimal obstruction and then test it out and re-characterize it and go with that.

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

      @@GadgetReboot Ohh I understand, thanks a lot Sir for your explanation ! I will try to implement your suggestion with DS18B20 sensor.

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

      @@GadgetReboot Totally agree. The thermal mass of the soil is huge compared with the sensor. So, the signal output will change _very slowly - just like the soil.

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

    Thank you very much for your sharing. But I have a problem when I verify the code that " no matching function for call to 'Adafruit_SSD1306::Adafruit_SSD1306(int)' ". Could you please help me to solve this problem?
    Thank you for your support

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

    Brilliant video

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

    hello sir.. i don't have OLED display, please give me code temperature sensor (ds18b200) without OLED display but i can see temperature in serial monitor. thank you

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

      I just edited the OLED sketch and made it serial monitor only and uploaded that new sketch. Try that.
      github.com/GadgetReboot/Arduino/tree/master/Uno/DS18B20_Temp_Sensor

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

      @@GadgetReboot it's work well, thank you very much sir

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

    i want to add a relay to this to turn on a pump when the water teemp drops below a set point. is it possible?

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

      If the relay can handle switching the pump and it just needs the coil actuated, then if there is a transistor driver circuit to handle that and allow logic level on/ off control, then the Arduino can turn the relay on and off anytime it wants and that can occur when the temperature is below a certain level.
      There are some Arduino compatible relay boards out there that might be suitable for switching AC loads.

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

      @@GadgetReboot thanks. its just a 12v dc pump.

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

      @@michaelgaul2244 sorry if this sounds too pedantic, but don’t forget the flyback diode on the control circuit/s. Both the pump and the relay primary can create a large spikes when they’re turned Off - leading to premature death of your relay (secondary, due to bounce pitting) and/or Arduino. A zener & switching diode combo is also popular. Watch the voltage ratings for the diode/s.

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

    sir i have arduino mega and temperature sensor (ds18b20) and a lcd 1602A sir please tell me how to connect all these which shows temperature on lcd please sir help or give me a link

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

      I think I will actually try to quickly put together a video to do that because I’ve worked on the temperature sensor in one project before and used that LCD in a different project so I will see if I can put something together and do a video in the next couple of days.
      Does the 1602 LCD you have use a serial interface or does it just have all those 16 or so pins only?

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

      I put together a demo
      ua-cam.com/video/lr1x96s3TKY/v-deo.html

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

    where did you simulate the circuit?

  • @electronic7979
    @electronic7979 6 років тому +3

    Useful video 👍 Excellent 👍

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

    Are you able to "extend" probes to put them in different corners of a room (for instance)?

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

      Yes, but if you may need one or more transceiver to buffer (boost and sharpen) the data signal. Also, the greater the distance, the more susceptible the data signal may be to interference. So, I’d recommend the 4-wire version mentioned in the video, with the shield grounded. This is pure speculation, but the voltage drop associated with long, thin wires may result in inaccurate readings. This could largely be resolved by running sufficiently larger gauge wire (e.g. 18ga). Keep in mind that you can use this wire to power the transceivers. Powering the sensor with the highest voltage your MCU/Arduino supports would mitigate the potential issue with voltage drop.

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

    What kind of pullups? I didn't hear any numbers nor see any on the datasheet

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

      On the project schematic it shows 4.7K raw.githubusercontent.com/GadgetReboot/Arduino/master/Uno/DS18B20_Temp_Sensor/DS18B20_Schematic.jpg
      and the datasheet says on page 10 the pull up is around 5K datasheets.maximintegrated.com/en/ds/DS18B20.pdf

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

    Can this sensor be used to measure the human body temperature accurately?

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

      This sensor can have an accuracy up to +/ -0.5°C and to properly measure the temperature of something, I would think the entire sensor should be immersed in the environment being measured so that other ambient temperatures don’t interfere, so it depends how the sensor is going to be measuring the temperature. If it is just being pressed against something then it’s partly measuring the room and partly measuring what it’s pressed against.

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

      I’m tempted to make a joke, but seriously, it depends on where is the probe is placed. This would be no different from a typical thermometer place under the tongue, in the armpit or inserted rectally.

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

      The resolution is adjustable. According to the data sheet, it can be operated with a resolution from 0.5 C to 0.0625 C by changing the requested bit depth, from 9-bit through 12-bit, as shown. Presumably, the speed (sampling rate) and repeatability (noise) are influenced by the resolution setting. As with nearly _all temperature sensors, accuracy beyond ~0.5 C requires calibration. The method shown in the video, using ice water (at equilibrium) and boiling water (actually boiling) is a very common technique used for this purpose. Then, using the initial measurements obtained, output from the sensor can then be scaled (aka interpolated) to obtain the actual, real-world temperature.

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

      @@GadgetReboot Totally agree. Respectfully, I wonder if the response time and accuracy of the Dallas probe in the video was influenced by the probe not being fully submerged (and completely below the ice) like the thermocouple.
      Edit: to be effective, the sensor not only needs to be fully immersed, but it also needs to be given time to reach a point of stability/equilibrium. Given the probe’s relatively large thermal mass, this will take longer than a small thermocouple or a drugstore thermometer.

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

    I really like to know how to use the parasitemode. Coz I you read about this mode every where so asumed it was a working mode. I allready have the 2 wire connectors in place and I do not have 3 wire connectors or cables. You hinted that you need 2 arduino pins to control the pull up and thats fine. Any suggestions whee I can find arduino examples that work in parasite mode?

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

      I looked at parasite mode here ua-cam.com/video/145ml4ii1ao/v-deo.html

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

    Can we use modbus protocol for ds18b20 with arduino?

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

      If you’re talking about the Modbus serial protocol, then the Arduino should have no problem with that at all. If you’re interfacing with other devices, such as a PC or PLC, you’ll almost certainly need an RS232 or RS422 driver on the Arduino serial lines to boost the signal and make the signal differential. Take a look at the MAX232 series. They’re easy to use and, last time I looked, they were still available in DIP packages. Pro tip: add a TVS diode array or low capacitance, high-voltage capacitors on the signal lines (on the 232/422 side). This will reduce sadness caused by the discharge of static electricity, nearby motor coils, long wires and the like.
      If you’re talking about Modbus TCP, then you’ll need a serial-to-Ethernet module. They’re also readily available and straightforward to use. For those, take a look at ones based on the WizNet 5500.

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

    i have a project " contoling system of climatisation with arduino uno and ds18 and wifi card " i have some difficult can u help me pliz ?

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

      I don’t know how much help I can give, what is the Wi-Fi card? I have only used Wi-Fi with ESP 8266. What does the project need to accomplish?

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

      @@GadgetReboot i have a problem with the creaction of application on Android to remote the system .. thnx so much

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

    Plz help sir, i have some problem here. why my measurement result is -127?

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

      have you resolve it? i have same problem

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

      @@adisurya6408 me too i have the same probleme

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

      Make sure the temp sensor is connected and has power as i had this problem and found my sensor had no power dur to a bad crimp in one of the dupont connectors i have used after replacing the connector it worked ok after.

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

    why it don't know the address when i open serial monitor

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

      Is there a pull up resistor on the data line?

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

    thank you very
    much

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

    There is a library that support parasitic with 1 gpio, and another that supports parasitic without a resistor milesburton/Arduino-Temperature-Control-Library , bigjosh/OneWireNoResistor, I had moderate success with them. But I know there is 2 versions of these s model maybe

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

      I guess there’s a way to make use of the single GPIO to do the parasitic feature if it’s sitting idle anyway during that time. I’ll check it out at some point. It would be fun to get it working that way and to possibly use the knowledge to be creative with GPIO pins in other projects too. Thanks.

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

    Can this be done with 14 thermometers?

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

      www.instructables.com/Multiple-Fermenter-Temperature-Control-With-Arduin/
      Yes i think that is possible becuase that link suggests that they want to control temperatures of multiple fermenters

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

      Beware: of the most common libraries has an arbitrary limit of eight sensors. However, the protocol from the data sheet appears capable of having an absurdly large number of sensors - like trillions (only on paper, of course). 14 seems totally reasonable, once the driver code is tweaked from 8 to, say, 16.

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

    Sir , may i get code for this project

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

      The link to the sketch is in the description

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

    what resistor i need

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

      4.7K worked for me

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

      Oled display Temp: -127.0 c only.

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

      help

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

      im using arduino arduino uno r3 atmega 328, OLED Display Module 128X64 I2C SSD1306 12864 LCD Screen Board GND VDD SCK SDA for Arduino

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

      @@carljavier5248 It sounds like the data isn't being read so it's the default reading. Do you have an extra sensor? It could be bad. It would also help to see some sort of wiring diagram - what GPIO pin is the sensor on? Do you have an oscilloscope to look at the data signal to see if it's communicating?

  • @عليعادل-ر5ف7ر
    @عليعادل-ر5ف7ر 4 роки тому

    I need a code.
    Who knows let him write a code

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

    please help me brother

  • @MuhammadAkbar-ij4lm
    @MuhammadAkbar-ij4lm 4 роки тому +2

    I have some problems when i get data from sensor. It always show -127 celcius can you give me the solution??

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

      me too the same probleme

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

      Same problem. Were you able to figure out what’s wrong!

    • @MuhammadAkbar-ij4lm
      @MuhammadAkbar-ij4lm 3 роки тому

      @@cdavid0624 i already solve this issue. You need to put resistor 5k on 5v connection on ds18b20 and Arduino