Connect a sensor to the gateway and use Node-Red to automatically read temperature and easily edit a sample Node-Red application to also read humidity.
Connect a sensor to the gateway and use Node-Red to automatically read temperature and easily edit a sample Node-Red application to also read humidity.
Plug the RH-USB temperature / humidity sensor in to any open USB port on the gateway.
Open Node-Red
Navigate to Sensors then click Manage Sensors to open Node-Red.
Show info panel
A default node-red flow has been included. In this flow, an inject node triggers the RH-USB sensor to provide the current temperature and humidity every second. The temperature data then goes through a function node that changes the temperate reading to Celsius and rounds the value down to the nearest tenth. That value then goes through the chart node for formatting and then to the mqtt node. The Intel IoT Developer Hub watches the mqtt service on the gateway and automatically displays and data published to the /sensor topic. Notice how the Humidity chat node is not connected to the RH-USB node.
Add Humidity reading to flow
Wire the second output of the RH-USB sub-flow node to the input of the Humidity chart node.
Click the output point (on right side) of RH-USB and drag a connection to the input (left side) of Humidity node.
Deploy updated flow
Click the Deploy button in the upper right corner.
Test Sensor
View the Intel IoT Developer Hub Dashboard to see the Humidity gauge is now included and displays humidity data.
Test the sensor by gently breathing on it. You should see the temperature and humidity values change immediately.