DS18B20 Temperature Sensor Needs No Resistor

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • I wanted to see how the DS18B20 one wire digital temperature sensor worked in parasitic power mode compared to having previously tested it with its own power source (all at 5 volts on Arduino Uno) so I set up a customized scope trigger pulse from the OneWire library to help me lock on to the data bus.
    While doing that, I also tested the concept of using Arduino's internal pull up resistor instead of a 4.7K external bus pull up resistor.
    I ran into a few snags but this is my overall investigation and report!
    Original DS18B20 project and sketch:
    • DS18B20 Arduino Temper...
    My modified OneWire.cpp file to give a debug scope trigger output:
    github.com/GadgetReboot/misc_...
    Josh's OneWireNoResistor research project:
    wp.josh.com/2014/06/23/no-ext...
    OneWire no resistor library:
    github.com/bigjosh/OneWireNoR...
    OneWire mainstream library:
    github.com/PaulStoffregen/One...
    Patreon: / gadgetreboot
    Pinterest: www.pinterest.ca/GadgetReboot
    Twitter: @GadgetReboot / gadgetreboot
  • НаукаНаука

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

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

    Thanks for this! My remote water temp sensor needs another sensor for air, and I got some DS18B20's and if I can squeeze them in with no additional parts and only two connections (Vcc + GND tied together and DQ to an AVR pin), that'd be dope!

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

    wow it's work perfectly, thanks !

  • @ABID5
    @ABID5 5 лет назад +3

    well done

    • @GadgetReboot
      @GadgetReboot  5 лет назад

      Thanks! It was a struggle getting through this one between technical difficulties with the audio video recording and then the sensor acting strange but I made it.

  • @jasonmare33
    @jasonmare33 11 месяцев назад

    Would this help? I have one DS on my hot tub and every once on a while it reports 50 degrees hotter than the water . I reboot Arduino no fix need to unplug Controller and it goes back to normal thanks

  • @MarcelDiane
    @MarcelDiane 5 лет назад +1

    Are you using OSB Frank?

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

    Thank you, it is a great, i want to use esp32 with ds18b20 with no resistors and sleep mode with lr44, could you please help me?

    • @scosu1
      @scosu1 4 года назад +3

      just tried this with an ESP32 and it works there as well. You have to edit the OneWire library 'util/OneWire_direct_gpio.h' file and change "ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pulldown | rtc_gpio_desc[pin].pullup);" to "ESP_REG(rtc_reg) = (ESP_REG(rtc_reg) & ~rtc_gpio_desc[pin].pulldown) | rtc_gpio_desc[pin].pullup;". This will enable the pullup for ESP32 but no other architecture.

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

    Im getting - 127 any help plz

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

    Thx for the vid or is very informative. But I cannot get parasitic mode to work at all. With or with out pullup resistors. I am just disapointed they call it one wire where you need 3 wires for it to work. I tried severalof the to 92 types and I have one waterproof on a cable. but in parasite mode I get nothing. They should all be ds18b20's but I gues I must have fakes or sometjing. They work perfect in 3 wire. I tried it on 3 different uno clones and even an a WAVGAT uno 3 imitation but no results with 2 wires. I tried the sketch with the renamed OneWirenoresistor to OneWire and tried the DS direcly in pin 8 9 10 but it just finds nothing. I dont mind using pullups or using extra pins locally but I really expected the 2 wire way to work so I allready made some boxes with only 2 wire connectors. I think I am going to try a thermistor. See how that works.

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

      It seems that any ds18b20 bought on eBay or AliExpress will be a fake and these will not work with parasitic power. It works fine on my genuine TO92 sensors but not on any of the many waterproof cabled versions.

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

      @@solarprojectuk okay that is a good explanation why this one wire (which is actually 2 wires) that needs 3 wires to work.) thanks

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

    Hello and congratulations.
    I am struggling with a network consisting of 15 ds18b20 sensors, where I monitor the temperature of the home.
    I connected most of the sensors with individual telephone cables ( 5 to 20 meters long each).
    In 3 cases I connected 2 sensors to a single cable.
    I tried to monitor them through the wemos d1 version 3 and connected all according to the rule, gnd to gnd, vcc to the 3v3 of the wemos and the data to the pin d7 of the wemos with resistance from 4k7 between data and 3v3.
    I can read up to 6/7 sensors at the same time, if I connect further ones, it returns -127 on all of them. I also tried to lower the resistance value to 1k given the length of the sections but I do not solve.
    I measured the current that supplies the wemos and it is 3.27v.
    How can I solve it?

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

      There's an app note that might give some ideas to compare your wiring structure against the recommendations: www.maximintegrated.com/en/design/technical-documents/tutorials/1/148.html
      If you have some cables with 2 sensors and other cables with one sensor and they all meet at a single star point to connect to Arduino, that would be a combination of star and stub topologies and may have impedance imbalances that cause data collisions when there's too many sensors, for example. I would maybe start by trying to add the low resistance in series with each data pin (150 ohms or so) and see if that helps, that may minimize impedance mismatch and data issues if that was the issue.
      I'm not sure if telephone cable is considered good for long connections (they suggest ethernet cable) so it could also be related to that. If you have enough extra cable, maybe you could try running different setups with the same length of cable but try to make it different topologies just to test, like make them all star with single sensors, or make them a single long run with sensors coming off of the same long wire to see if cable length vs method of hookup is the issue.

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

      @@GadgetReboot thanks for your replay and suggestion.
      I investigate deeper and I discovered that only 1 cable with 2 sensors connected crashed all network.
      If I disconnect that cable, the rest of 10 sensors works, even with 2 sensors in the same cable works.
      I tried to add 1 150 ohms resistor in the data pin of the bad cable but with no result, I tried also with 47 ohms but al the network crush.
      I know for secure that the cable that crush work if I connect it alone.
      I still connected with 3v3 of the wemos d1 mini, do you have other suggestion?

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

      if the bad cable works on its own and the rest of it works on its own but it doesn’t work all together, what if you take the bad cable and instead of putting it as a brand new branch, connect it to the end of one of the other cables to make it an extra long cable as a test? If that works then there is some weird impedance issue when it’s connected the other way and it throws it over the edge.
      if something is barely working on the margin with component tolerances, what if you keep the failing configuration intact but try swapping different sensors from the good section to the bad cable section and maybe you will find a magic combination where certain sensors tolerate the configuration and some don’t. It’s not a long-term stable solution but if it works it might be OK for an individual project.

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

      @@GadgetReboot Thanks again.
      I investigated more and the problem is with the quantity of sensors....
      I connected the 3 cable with the 2 sensors each and is working fine, if I had more cable crash with -127 in all the network.
      I used 1 4K7 resistor for all the sensors connected in 2 different digital pins of the wemos (D2, D3), tomorrow I wont to try a 2K resistor if is going to resolve the problem.

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

      Problem solved!
      I changed the 4K7 resistor with 1K resistor and I can use also only 1 digital pin.
      Thanks.

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

    Hi, I need help, this is a digital temperature sensor on the pellet burner electronics. Everything works well but I need a little diversion on electronics. The thing is that at some point I need to tell the electronics that some temperature has been reached and if creativity has not been reached. How to influence that temperature via a sensor. There are three wires on the sensor: green, brown and white. Green is electronically connected under one connector and brown and white are connected together under the other connector. So, three wires, two connectors. Thanks.

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

      You all prolly dont give a shit but does anybody know a way to get back into an instagram account?
      I stupidly lost my account password. I appreciate any help you can give me!

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

      @Alex Kyree Instablaster ;)

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

      @Xander Skylar I really appreciate your reply. I found the site thru google and I'm in the hacking process now.
      I see it takes a while so I will reply here later when my account password hopefully is recovered.

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

      @Xander Skylar it did the trick and I finally got access to my account again. I'm so happy:D
      Thank you so much you really help me out !

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

      @Alex Kyree No problem =)

  • @electronic7979
    @electronic7979 5 лет назад +2

    Super 👍👍