2.0.6 • Published 1 year ago
node-red-contrib-iiot-ds18b20 v2.0.6
node-red-contrib-iiot-rpi-ds18b20
A Node-RED node for multiple ds18b20 digital temperature sensor
Installation
Install with Node-Red Palette Manager or npm command:
cd ~/.node-red
npm install node-red-contrib-iiot-ds18b20
Usage
- Multiple sensors are read on cycle.
- To prevents locks only one node is allowed.
- The output values are °C or °F and send as number array.
- This node works on Raspberry Pi with 32bit or 64bit OS.
- Enable 1-Wire with raspi-config.
Set sensor resolution
You can change the sensor resolution with tool in subfolder setSensor. File readme.txt describes how the tool is used.
Example
This example reads temperatures from 3 sensors. Values are in °C. Each sensor value is send to outputs 0..2 in function node. In Node-Red Dashboard, these are displayed in gauges. Each sensor value is compared with fix value and send to outputs 3..5 in function node. In Node-Red Dashboard, these are displayed in sliders as alarm.
JavaScript Code in Function Node:
return [
{ payload: msg.payload[0] }, // output 1
{ payload: msg.payload[1] }, // output 2
{ payload: msg.payload[2] }, // output 3
{ payload: msg.payload[0] >= 30.5 }, // output 4
{ payload: msg.payload[1] >= 20.5 }, // output 5
{ payload: msg.payload[2] >= 19.3 } // output 6
];