DS18B20 Not Found

Posted on
  • Been doing some experiments with a DS18B20 sensor on an Espruino WiFi, I've had a couple of successful reads but mostly I'm getting this error:

    (Sorry for the screenshot I can't figure out how to copy/paste from the console!

    My code is just this for now:

    var ow = new OneWire(A0);
    var sensor = require("DS18B20").connect(ow);
    
    function read(){
      sensor.getTemp(function (temp) {
        console.log("Temp is "+temp+"°C");
    });
    }
    

    1 Attachment

    • Screen Shot 2022-01-25 at 8.37.07 AM.png
  • Do you have a pullup resistor on A0? There could be some instability if not.

    Also are you powering the DS18B20 on the 3rd pin, or trying to run it parasitically?

  • Ah yes, pullup resistor that's sorted it, thanks :)

    Are there internal pullups I can use in this scenario?

    Sam

  • Yes and no... So as far as I remember the nRF52 can do it, but the ST parts had some strange behaviour where it was really hard to keep the pullup on something that was an output so I don't think they could...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

DS18B20 Not Found

Posted by Avatar for sammachin @sammachin

Actions