Open Source Data Acquisition, Control and Automation

Introduction

Every physical research project, be it a final year student or PhD candidate, requires the measurement and logging of data, most often while controlling and preferably automating the experimental set up. For smaller projects Data Acquisition (DAQ) units are often used, with the student required to control the device manually. Larger projects may make use of full laboratory automation and control systems, with National Instruments (NI) DAQs combined with their NI Labview software being the standard in my laboratory experience.

However DAQ units are costly , especially for the simpler projects. As a result there is often a shortage of these devices in laboratories , with students having to share devices.

Thus an open source DAQ device, coupled with software that would allow for data logging, control and automation capabilities is being investigated that could in effect replace an industry version.

This site details the various aspects of the the solution found and the rationale behind it.

Overview of Solution

The final solution has rested on an Arduino micro controller serving as the DAQ board and Node-Red as the programming and user interface, all while node.js with Johnny-Five Javascript libraries serve as the intermediary between the Arduino board and Node-Red.

The Hardware

A number of low cost development boards could have be used - an Arduino was chosen simply as it very common and been a round for a while, allowing for a large amount of easily accessible example code and easy access for us tip of Africa dwellers.

While one can perform on the various control and automation logic on the board itself, I felt a similar approach to Labview was required, namely that the control, automation and data logging code would be kept on a connected PC, with the Arduino simply recording data based on commands from the PC. This is in line the rationale employed by the robotics community that has started to use these development boards quiet extensively, and from who the majority of this project has stolen from.

Thus the Arduino board is loaded with Firmata, which will allow node.js to communicate with the board's various input and output pins.

I've described some more of the details here: Setting up the Arduino DAQ

Node.js

node.js is actually what does all the work talking to the Arduino - Node-Red is merely a nice front end for it. node.js is a Javascript based runtime environment that is particularly suited to input and output operations, so it's ideally suited to development of a DAQ.

Further details on setting up node.js

Node-RED

Node-Red is a great front-end for node.js, and allows for pseudo graphical programming ( and can thus serve as an alternative to Labview). It consists of a number of nodes that can be linked together and programs can thus be built in a modular fashion.

It was designed with the Internet of Things (IoT) in mind - namely to link everything, from your fridge to your watch, to the internet. Thus the wiring system and the various nodes available by default are designed for quickly connecting to hardware and then doing whatever it is you want with that information ( "My washing is done - let me send myself an email reminder" or something equally silly).

I say Node-Red is a pseudo-graphical programming language largely because, as opposed to Labview, there are not as many nodes available as Labview VIs, especially in the field of data capturing, analysis and control. This is largely because, as far as I can tell, no one has really used it for this purpose up until now. (Now being 2016). Thus while in future there may be a large community generated database of useful nodes and you can just copy and paste, at the moment you often have to still code up a function node in Javascript to do a job (or piece together some code from the internet).

But this Open Source Hardware initiative is aimed at starting this process.

Further details on Setting up Node-RED

Examples

Temperature measurement with two thermistors - data logged to CSV file.