Tuesday, June 17, 2014

IoT instrumentation with LabVIEW

Sensor and actuator instrumentation made easy in Internet of Things applications with LabVIEW.

In my Chicken house project, I gained the understanding that in an IoT project nowadays, the IT part is the easy one, and the embedded instrumentation with microcontroller programming and stuff is the most effort consuming one. This may sound obvious to many, but as I have my roots in embedded systems development, I have considered embedded easy, and IT more challenging.

This makes me think that if IT is so easy with modern technology, there must be a more advanced solutions for the instrumentation part as well. Implementing pure C with direct register access is something programmers did already many decades ago, and it haven't changed a bite.

LabVIEW from National Instruments is widely used in measurement and test applications in different industries. LV provides powerful signal processing functions, together with easy and intuitive graphical programming language. LV is a great utility if you need to do something quickly.

Architecture of IoT instrumentation with LabVIEW..

LV was first introduced in 1986, at the time when every single thing was not yet networked, thus the basic architecture of the tool is not primarily intended for distributed computation. However, LV does very good job in parallel computing environments utilizing multi-core CPUs efficiently.

Measurement products of RIO family from NI can run LV code in stand-alone mode without a separate PC connected. That makes RIO and LV good for measurement instrumentation in different conditions. LV can be easily made exchange data with a cloud service or other backend servers, as demonstrated here.

Minimal example of MQTT client implemented with LabVIEW.
MQTT is a M2M protocol well suited for IoT applications with limited bandwidth. A third-party contributed MQTT library is available via NI web pages. The library makes it rather easy to connect the LV program to a MQTT broker running in a cloud or other server, or in Raspberry Pi for example as in my case. RabbitMQ is an example of broker supporting many protocols, contributed by the open source community.

Once the data is delivered to a suitable broker, it is very easy to access it from cloud software, mobile app, web page, or other backend software. As I have told earlier, Node-RED and Bluemix makes it ridiculous easy to develop and deploy cloud software. Node-RED can in fact run in any hardware capable of running node.js, not in cloud only. I'm running Node-RED in a Raspberry Pi for example.

Minimal Node-RED example to receive data from MQTT broker.
With the measurement and signal processing power of LabVIEW and RIO products, combined with integration to cloud and backend services, we really have a quick start to implement IoT solutions with real world physical instrumentation. As the RIO architecture has CPU and FPGA integrated, fast signal processing and even real-time machine vision is possible on the field. Then only the processed higher value data is delivered to further storage and analysis in other places.

NI products are perhaps not most cost efficient if you need a mine field of 5 bucks WSNs. But if there is a complex process to monitor, and you need to do it quickly, then this combo is really worth of considering.

1 comment: