Skip to content

Water Temp

Jake Hartnell edited this page Jul 29, 2016 · 2 revisions

Waterproof DS18B20 Digital temperature:

Wiring

Note: the wiring is the same though the water based sensor looks different than the one below.

DS18B20

Example Johnny-Five code

See http://johnny-five.io/examples/temperature-ds18b20/

var five = require("johnny-five");

five.Board().on("ready", function() {
  // This requires OneWire support using the ConfigurableFirmata
  var temperature = new five.Thermometer({
    controller: "DS18B20",
    pin: 2
  });

  temperature.on("change", function() {
    console.log(this.celsius + "°C");
    // console.log("0x" + this.address.toString(16));
  });
});