/
DHT11 BASIC TEMPERATURE-HUMIDITY SENSOR

DHT11 BASIC TEMPERATURE-HUMIDITY SENSOR


DataSheet

https://akizukidenshi.com/download/ds/aosong/DHT11.pdf


Tutorial:

https://iotbykarthik.wordpress.com/2016/02/07/dht11-spi-and-raspberry-pi/

IoT temperature and moisture sensor integrated to Node-RED and Bluemix IBM

https://developer.ibm.com/recipes/tutorials/iot-temperature-and-moisture-sensor-integrated-to-node-red-and-bluemix-ibm/


Amazon:

https://www.amazon.co.uk/Temperature-Relative-Humidity-Sensor-Arduino/dp/B00HI7LUKW/ref=cm_cr_arp_d_pdt_img_top?ie=UTF8



Configuration:


https://developer.ibm.com/recipes/tutorials/iot-temperature-and-moisture-sensor-integrated-to-node-red-and-bluemix-ibm/

npm package:    node-dht-sensor

https://www.npmjs.com/package/node-dht-sensor


bcm2835

http://www.airspayce.com/mikem/bcm2835/

node-red-stop


apt-get update -y

apt-get upgrade -y

npm install node-dht-sensor
(npm list | grep node-dht)


vi  /usr/local/lib/node_modules/node-red/settings.js
vi  /home/pi/.node-red/settings.js


Add to those 2 files:   sensorLib:require('node-dht-sensor'),sudo vi /home/pi/.node-red/settings.js

sudo vi /usr/lib/node_modules/node-red/settings.js

functionGlobalContext: {

     sensorLib:require('node-dht-sensor'),



Function in Node-RED:

var sensorLib = context.global.sensorLib;
var d = new Date();

sensorLib.initialize(11, 4);
var readout = sensorLib.read();
msg.topic="temp";
msg.payload = {time:d.toLocaleTimeString(),temp:readout.temperature.toFixed(2), hum:readout.humidity.toFixed(2)};
console.log(msg);
return msg;


JavaScript: display date and time:

https://www.w3schools.com/jsref/jsref_obj_date.asp




Related content

SKY ATP appliance SKUs JATP700
SKY ATP appliance SKUs JATP700
More like this
show optical
show optical
More like this
1a- Rules on Healthbot GUI and Playbook for the HB to NorthStar
1a- Rules on Healthbot GUI and Playbook for the HB to NorthStar
More like this
3- install package
3- install package
More like this
IoT on AWS
IoT on AWS
More like this
MQTT message example1
MQTT message example1
More like this