nodemcu + ds18s20

Hi,
I'm trying to wire up a nodemcu with ds18s20, but it is not found the sensor. DS18S20 is connected to 3.3V and GND between the 3.3V and DATA line I connected a 4k7 resistor. Data line connected to ~D3 port.
What i'm doing wrong?
I'm getting null for sensor.getTemp();
I'm trying to wire up a nodemcu with ds18s20, but it is not found the sensor. DS18S20 is connected to 3.3V and GND between the 3.3V and DATA line I connected a 4k7 resistor. Data line connected to ~D3 port.
What i'm doing wrong?
Code: Select all
var GPIO0 = new Pin(0); // GPIO0 | ~D3 port
var ow = new OneWire(GPIO0);
var sensor = require("DS18B20").connect(ow);
console.log('sensor getting data');
setInterval(function() {
console.log(sensor.getTemp());
}, 1000);
I'm getting null for sensor.getTemp();
Code: Select all
>ow.search();
=[ ]