Arduino, DS18B20/DS18S20 Temperature Sensor and 1-Wire Bus - The Details

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

КОМЕНТАРІ • 51

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

    Excellent and useful video. I liked it

  • @rene-jeanmercier6517
    @rene-jeanmercier6517 4 роки тому +1

    Hi Robert. Excellent and exhaustive explanation. Despite your remark of non completeness at the end, it is like you have said, all is needed to implement a fully functional system. Thank you for your time. It is much appreciated. Regards, RJM.

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

      Hello René-Jean, you're welcome! Regarding "fully functional" - I'm still searching for a library that works flawlessly with, respectively, fully supports the DS18B20 (at least the features I need). And if I can't find one I'll probably derive my own from that DallasTemperature library. So there will be an addendum to this video :-) Best Regards, Robert

  • @BASEDinMaine
    @BASEDinMaine 2 роки тому +1

    *thank you* for such a thorough tutorial -- it is appreciated! I am using this sensor for a final project in my year 1 digital electronics class. This is the most detailed I have found so far.

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

    Great video! You are a very good presenter and did very well explaining the hardware and software. SUBSCRIBED!
    I am just getting into Arduino and videos like yours are very appreciated. so, don't worry about length--the subject dictates the time needed.
    Thanks so much!

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

      Thanks for the praise and subscribing! I don't know about being a "very good presenter" - almost blushing here ;-) - but I'm trying to do my best, and I'm always happy when people get something out of my videos. So, thanks again and you're very welcome!

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

    Hi Robert, thank you for your tutorial. Unfortunately I have also "-127" problem with waterproofing sensors. I noticed that when I connect 1-wire bus to pin 2 (or 3) after loop is running, measuring was ok. So I removed line with "sensors[bus].begin()" and it works fine. So I guess that waterproof sensors are not bad but initialization has to be different.

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

      Yes, initialization might have been the problem. With these waterproofed sensors you never know what chips are actually in there. The original DS18B20/DS18S20 are relatively expensive, so the temptation to use cheaper copies is definitely there.

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

    OMG So simple and tiny sensor, soo many quirks and details! amazing video, just what I need for my current project

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

      Yes, the devil is always in the details. Even if the devil has three pins only 😉 And thanks for the praise 😅

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

    This video is very interesting. In industry, however, most applications use something called "the 4 to 20 milliamp loop". It would be good to hear an explanation of how that works with temperature sensing. Thanks for posting.

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

      You're welcome! Ah, the industries great 4…20mA "standard". I assume you're talking about the analog version (German standard DIN 66258) for connecting remote sensors (one per line) and not the digital TTY/V.31/EIA-422/RS-422 stuff. I don't really have any use for that stuff (not being in a noisy industrial environment), but it's indeed interesting. I'll put it up on my wall of video ideas - but no promises ;-)

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

    Gain lot of knowledge
    I'm not using parasite mode still not getting more than 85°C for boiling water
    Below 85°C it works fine..

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

      Well, according to the datasheet parasite power should work fine up to 100°C. And while accuracy will degrade above 85°C, you should still be able to get readings +/- a few degrees C.

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

    Hello, I need a little help, it's a temperature sensor
    DS18B20.
    I wonder if I can influence it to read the wrong temperature.
    I need to cheat the electronics to which such a sensor is connected at a given moment.
    It is an electronics for a pellet burner, more precisely a centrometal burner from 2012, and the principle of its operation is such that when the water temperature in the boiler drops below 60 degrees, it goes into automatic ignition. The ignition automatically goes should or should not need hot water.
    I tried everything but the only solution is to fool the electronics and give it the wrong information about the water temperature, that is. that the electronics receive a signal that the water temperature is 60 degrees or higher.
    Thanks in advance.

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

      There are many ways to get DS18B20 to deliver wrong temperature readings :-) But if you need the "wrong" temperatures to have a specific values (e.g. greater 60°C) only two solutions come to my mind:
      A) If you have physical access to the DS18B20: Use a heating element (e.g. resistor in TO-220 case) to artificially heat up the DS18B20 beyond 60°C. Make sure it doesn't go beyond 120°C though!
      B) If you have access to the dataline between the DS18B20 and the electronics: Open up the dataline and put a microcontroller (e.g. Arduino) between the DS18B20 and the electronics. The microcontroller reads the data from the DS18B20 via 1-Wire and acts towards the electronics as a 1-Wire slave (code for Arduino available) emulating a DS18B20. The microcontroller then either just forwards the temperature readings from the DS18B20 to the electronics, or transmits a constant temperature, e.g. 65°C.

  • @Mr.Leeroy
    @Mr.Leeroy 3 роки тому

    38:16
    It's not the same at all. Phantom power is used on a _differential_ _analog_ transmission line and it is _never_ gets disrupted during operation like 1wire gets with pull-down.

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

      You're absolutely right! My bad for mixing up the terminologies - sorry!

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

    Thank You, And one question is there are sides more sensitive than others ? trying to sense temperature of a glass plate (top, flat side, round side or button)

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

      Never thought about that ... and to be honest, I don't know. I usually mount them with the flat side to the surface which I want to measure. In my opinion it is more important to thermally isolate the sides that are not touching the measured surface (e.g. with some foam) and to make sure that the face that is touching the measured surface has a good thermal contact (e.g. by using a bit of thermal compound).

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

    This was great, I have a DS18B20 and have used successfully, but I only had a vague idea that it was capable of so much more, i'm starting to read datasheets more carefully (about time at 54 !) certainly if you do a deeper dive into 'one wire' busses I will find it interesting...cheers.

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

      Thanks! Meanwhile I found another Arduino library specially for the DS18B20. Very simple, but maybe that will work. And you have no idea how deep I will go "down the rabbit hole" in regards to the 1-wire bus next week ;-) BTW the ADS1115 video will come up on the 10th of May :-)

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

      @@robertssmorgasbord great, I will be right behind you in the hole ! not sure I will get as deep as you but I will be tying hard, and i'm hooked on ADC's and making measurements in general, this seems a bit addictive.

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

    Hello sir, I am working on the project where I have to use DS18B20 temperature sensor, and When I want to make the connection for Parasite Power mode, It shows me the error value "-127", I keep trying on it, and still unable to get the result, I am using temperature probe for it.

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

      Well, only one thing comes to mind: Do you have both, pin 1 GND and pin 3 VCC of the DS18B20 connected to ground? Otherwise the parasite power mode might not work. Anyway, without knowing the library you are using I can't tell what the error value "-127" means. Are you using my code from this video?

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

      @@robertssmorgasbord Yes Robert,. I am using your code and I am using waterproof temperature probe DS18B20,the library i am using is onewire and dallasTemperature, and I also connect vcc to the ground, still the sensor is unable to detect and shows -127degrecelcius.

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

      @@khangeshmatte4930 Do you have a link to the waterproofed DS18B20 you are using? I guess it has already a cable attached. Maybe they mixed up the colors of the wires and so the sensor ended being connected the wrong way. Another possibility is that your sensor is simply broken. Do you have access to a "naked" DS18B20? If so, you can use it to check if the Arduino side of your system is really working.

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

      @@robertssmorgasbord Hello Robert here's, the link:-de.rs-online.com/web/p/entwicklungstools-sensorik/2049893/ but I wanted to mention something
      1. I am using 4 sensors they all are working fine in Normal mode when I connected Vdd to external power 5v or3 3.3v.
      2 .but when I connected with Vcc to the ground(Parasite power) it shows a -127 dc error according to the datasheet it says the sensor is disconnected.
      3.I have tried to break the sensor but it is difficult to open it, so I don't have access to the "naked DS18B20" but I am trying to find ways.
      4. Do I use Mosfet for strong pull-up? Thank you

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

      @@khangeshmatte4930 The waterproofed DS18B20 sensors you are using (DFRobot) are absolutely OK. It was not my intension to make you break open one of them, I just thought maybe you have access / can get a DS18B20 without the waterproof stuff around it for tests.
      Anyway, using the OneWire and DallasTemperature library with an Arduino you won't need an external MOSFET for strong pull-up during temperature conversions - the libraries / the Arduino does everything for you (see 05:46​).
      I'm a bit at a loss here ... only two three things that come to my mind: 1) Make sure that all sensors on the (single) 1-wire bus are either normal or parasitic power. Mixing devices with different power modes on the same bus leads to disaster. 2) Increase the delay between .requestTemperatures() and .getTemp...() to say 1000ms (temperature conversion time for 12-bit resolution is 750ms). 3) Decrease the value of the pull-up resistor (minimum is 1.4kOhm - see 34:24​).
      Hope that some of this helps!

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

    Hello Robert, keep up the great work!Your thorough explanations provide much greater insight than all the short videos out there. I was hoping you could cover how to properly choose a ferrite bead for isolating noise between analog and digital supplies. Perhaps this would be good for the upcoming ADC video you hinted at in the comments of your triac video.
    All the best,
    T

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

      Hello Toby, thank you very much for the praise and yes, I will keep uploading tutorials like this :-) Regarding the application and calculation of ferrite beats: Unfortunately that's not really my area of expertise - yet ;-) Though I will use some inductors in two upcoming videos to filter 5V rails. But their values are either from datasheets or guesstimates :-( However, I'll put it on my wall of video ideas - no promises though. On a side note: A few days ago I was asked to make a video about NTC inrush current limiters for transformers. Also something I've got to read up on first. You guys really keep me on my toes - thank you for that :-) Best Regards, Robert

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

      Looking forward to it, Thank you!

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

    I used one sensor ds18b20 but i always get -127 C can you help me please

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

      Well, not really without seeing your code and circuit. -127 can mean many things:
      Your sensor is not connected correctly ...
      Your requesting the temperature too early (DS18B20 hasn't finished the conversion) ...
      Any other possible hardware/software fault ...
      Sorry that I can't help you out there.

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

      @@robertssmorgasbord thank you

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

    Keep up the good work Robert, Thank you