-
It's one of thoose chines sensors, posting pic, i think they might do it for me.
http://i.ebayimg.com/images/i/271967983438-0-1/s-l1000.jpg -
-
-
-
-
-
-
Trying to read humidity and temp in a jar. Worked 20 minutes ago, but now all I get is:
{ "err": true, "checksumError": false, "raw": "", "temp": -1, "rh": -1 } Temp is -1 and RH is -1
Any thoughts ?
Sensor hookup: Gnd = Gnd , Vcc = D1, DATA = D2My code:
setWatch (function(){ digitalWrite(D1, 1); var dht = require("http://www.espruino.com/modules/DHT11.js").connect(D2); dht.read(function (a) { console.log(a); console.log("Temp is "+a.temp.toString()+" and RH is "+a.rh.toString()); if (a.rh > 70) { digitalPulse(LED1, 1, [2000]); } if (a.rh >= 60 && a.rh <= 70) { digitalPulse(LED3, 1, [2000]); } if (a.rh < 60 && a.rh != -1) { digitalPulse(LED2, 1, [200, 100, 200, 100, 200, 100, 200, 100, 200]); } if (a.rh === -1) { digitalPulse(LED1, 1, [200, 100, 200, 100, 200, 100, 200, 100, 200]); } }); setTimeout(function() { digitalWrite(D1, 0); }, 7000); }, BTN, { edge:"falling",repeat:true,debounce:50});
Running a nodemcu lolin v3 and trying to communicate with a DS3231 which is on a ZS-042 board.
Tried using the module for DS3231 but no luck so far..
My Code:
Error:
Any thoughts of what i might be doing wrong ? , maybe the module isn't right for me.