Low-Cost Phidget sensors wired directly to Tulip using Node-RED

I’m Kyle, and I work on the hardware team at Tulip.

As mentioned in previous community posts, Phidgets are cost-effective, quick and easy to use versatile sensors which can be used in both small-scale or large-scale industrial settings. These sensors can be used in Node-RED which can send data from the sensors to your Tulip instance.

We’ve done this before using this method but now it’s even easier. Let me show you!

Recently at Tulip we have added the ability to connect Phidgets in Node-RED directly to your Edge MC using the Phidgets wired VINT hub by default. Previously, this functionality required a bunch of extra configuration and cost more since we were using the wireless hub .

In one afternoon, I was able to set up my EDGE MC with a Phidgets sensor to record temperature and humidity data in real time, which I could then view in an app I created in my Tulip instance.

I connected the Phidgets to my Edge MC over USB using the Phidgets VINT Hub (wired) and the Humidity Phidget. Once I connected my EDGE MC to Node-RED, I created machine attributes for temperature and humidity, both attributes were set as float types.

The Node-RED flow I am using can be seen below and I will include a JSON of my flow in a comment if you’d like to use it. Both Phidget-Humidity and Phidget-Temperature are Tulip machine-attr nodes which send data to machine attribute endpoints using the Tulip Machine API.

By default all machine-attr have an attribute source msg.payload. We need to edit the attribute source of both of our machine-attr nodes to include the name of the attribute we are associating the node with.

In my case the attributes I made in Tulip were humidity and temperature so I switched my Phidget-Humidity and Phidget-Temperature nodes attribute sources to msg.payload.humidity and msg.payload.temperature respectively.

You can see in the debug window on the right why we are doing this. msg.payload is an object, nested inside this object are {temperature: [19.54]} and {humidity: [41.01]}. I want to send just the humidity and temperature values to Tulip, not the full object which is why I need to go one step inward and define msg.payload.humidity and msg.payload.temperature.

You can see how the temperature and humidity data from the Phidgets are able to be viewed as machineAPI data sources in Tulip with this quick app I created.

From scratch, this whole setup only took me a few hours to set up and required under $50 worth of sensors.

This can be a game changer on a large shop floor! You could measure sound across your facility to ensure employee health and adherence to OSHA guidelines using the sound Phidget. Or you could monitor vibration and movement on all of your machines using the accelerometer Phidget. You could even monitor if employees are at their station or where empty spots for pallets of new shipments to be placed in your warehouse using the sonar Phidget.This text will be hidden

4 Likes

Here is the JSON for my Node-RED flow you can import it into Node-RED if you’d like to use it or modify it:

[{"id":"c8373720.e62f4","type":"tab","label":"Phidget Flow","disabled":false,"info":""},{"id":"9ca3e9dc.929e38","type":"phidget22-connect","z":"c8373720.e62f4","port":"5661","hostname":"0.0.0.0","debug":true,"x":90,"y":240,"wires":[["72614446.57e55c","f247f156.11f5a"]]},{"id":"72614446.57e55c","type":"phidget22-humiditysensor","z":"c8373720.e62f4","channel":0,"deviceSerialNumber":-1,"debug":true,"dataInterval":"5000","hubPort":0,"humidityChangeTrigger":0,"x":310,"y":160,"wires":[["46cb0ce3.25c094","a241d898.d84ed8"]]},{"id":"a241d898.d84ed8","type":"debug","z":"c8373720.e62f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":240,"wires":[]},{"id":"f247f156.11f5a","type":"phidget22-temperaturesensor","z":"c8373720.e62f4","channel":0,"deviceSerialNumber":-1,"hubPort":0,"debug":true,"dataInterval":"5000","temperatureChangeTrigger":0,"RTDWireSetup":3,"RTDType":2,"thermocoupleType":2,"x":320,"y":320,"wires":[["42a73f38.a98fa","a241d898.d84ed8"]]},{"id":"46cb0ce3.25c094","type":"tulip-machine-attribute","z":"c8373720.e62f4","name":"Phidget-Humidity","useCustomApiAuth":false,"apiAuth":"","keepAlive":true,"keepAliveMsecs":10000,"deviceInfo":"{%your instance here%}","payloadSource":"payload.humidity","payloadType":"msg","x":590,"y":160,"wires":[[]]},{"id":"42a73f38.a98fa","type":"tulip-machine-attribute","z":"c8373720.e62f4","name":"Phidget-Temperature","useCustomApiAuth":false,"apiAuth":"","keepAlive":true,"keepAliveMsecs":10000,"deviceInfo":"{%your instance here%}","payloadSource":"payload.temperature","payloadType":"msg","x":600,"y":320,"wires":[[]]}]

Note: %your instance here% should be replaced with each of your machine attributes from your factory instance