An Open-Source Data Acquisition System for Laboratory and Industrial Scale Applications

We introduce a cost-efficient, and open-source measurement system for measuring and monitoring indoor air quality, aerosol concentration, dust contamination, and comfort-relevant quantities. The system allows to access these quantities simultaneously at multiple sites. The software architecture is described along with the hardware set-up including an overview of the supported measurement transducers so far. The system allows flexible adaptation on laboratory-scales as well as on large-scales like aircraft cabins, vehicles, buildings, and passenger compartments in general.


Introduction
There is a plethora of measurement systems for the examination of air properties, e.g. humidity, aerosolconcentration, thermal comfort, or air quality. However, many of such systems support just one measurement quantity, are closed-source, cost intensive, or not extensible [1,2,3]. In addition, the use of costly measurement equipment is an impediment for measurements on large-scales, where a large number of sensors is needed. This is especially true not only for the research community, but also for a wider public. Citizen and open science projects aim to reduce barriers, to open findings to a wider audience [4] and to allow the reproduction of experiments for a reasonable balance of costs and benefits. Examples of ongoing projects are monitoring drinking water quality [5], light pollution [6], or air quality [7]. These topics are of vital interest since they influence our everyday life. This also applies to indoor air-quality, especially against the background of the SARS-CoV-2 pandemic. To investigate ventilation concepts inside buildings, the interior of vehicles, and aircraft cabins under realistic environmental conditions, a portable measurement system is needed. To meet the requirements of measurement application in the afore listed environments, we developed an open and cost-effective multi-sensor measurement platform. We utilize this system in a wide range of experimental facilities, which vary in their physical dimensions, operational conditions, number of sensors and sensor types. For instance, we use the system: -To assess the risk of infection during the rise of the pathogen SARS-CoV-2 in 2020. This was achieved by studying the aerosol propagation in aircraft cabins [8]. The system's flexible design and low power consumption enabled online in-flight measurements on notebooks driven solely by power banks in airplane passenger compartments of an Airbus A320, a Boeing B737 and a Boeing B787. The use of over 70 optical particle-matter sensors enabled the estimation of infection risk derived from the aerosol concentration and dynamics of artifical saliva in the vicinity of passenger faces. Investigations of aerosol distributions in a generic classroom-configuration [9] and the simulation of human respiration in trains [10] were also conducted using this system.
-To quantify passenger comfort in compartments resembling aircrafts [11] and trains [12] with the objective to investigate novel ventilation concepts. Therefore, we use our measurement system to quantify energy efficiency, air quality, and passenger comfort. These multidimensional quantities require the spatial and temporal measurement of i.e. temperature, humidity and CO 2 concentration.
-To investigate the latent and sensible heat transfer in mixed convection with phase transition it is of utmost importance to measure the water vapor content of humid air precisely [13]. Here, the system's API aids the control of temperatures, flow rates and humidity and also records measurement values.
Additionally, we use the measurement system's support of high accuracy dew-point mirrors to automatically calibrate capacitive humidity-sensors.
In the following we introduce the system's hardware and software architecture as well as the software interface.

System architecture
Several open-source and open-hardware based measurement systems have been proposed in the past. Most of these systems require manufacturing of printed circuit boards (PCB) [1] and a pre-calibration [2]. Oftentimes, systems are split into multiple hardware systems, where one or more are responsible for measurement data acquisition and others for the humanmachine interface (HMI) [3]. Software on more than two different systems increases the initial installation and system maintenance effort. In the following, we present a well-proven system architecture that requires only a single host device that communicates with digital transducers via standard hardware and software interfaces. The main objective is to provide a software and hardware solution with minimal effort to procure, install, and operate.

Software requirements
The source code and hardware description of the presented systems are available in a public repository [14].
Both, our in-house code and third-party software packages are open-source and suited for commercial and scientific applications. A sensor device supported by this system must use an open communication protocol and have a public command-set to evaluate its readings and operational status. Peripherals and wiring are standard, readily available parts or feature an open design of the PCB used.
The broad accessibility of spare parts or the ability to manufacture them yourself contributes to reduced downtime.
In addition, a browser-based data visualization and control interface makes the system easy to use.
The scope of application ranges from small laboratory-scale experimental set-ups to large set-ups with a variety of sensors. This scalability also allows the same evaluation code implemented in the proof-of-concept phase to be used and applied at industrial scale. The support of a well-defined application programming-interface (API) ensures the integration of the present system into higher-level measurement environments or into specialized visualization frameworks. Furthermore, an open API offers the option to control one or more copies of this system remotely. This guarantees easy integration into production chains, where the measured values need to be automatically converted into control units.

Hardware set-up
A sketch of the hardware set-up is depicted in Figure 1. Here, a Unix -based single-board computer, a notebook, or a complete desktop computer work as a host system for the data-acquisition system (DAQ, top right). Device communication is realized via USB and proven standard converters to connect to RS232 and RS485. These two serial bus standards are common in industrial grade measurement devices. Most low cost measurement transducers rely on Inter Integrated Circuit (I 2 C) and Serial Peripheral Interface (SPI). The system provides these interfaces via an FT232H breakout board by Future Technology Devices International Limited (FTDI). Both interfaces require a different wiring concept to support a large number of sensors. I 2 C is based on a bus architecture and multiplexing is required whenever there are sensors that respond to identical bus addresses. This results in a standard data acquisition unit consisting of an eight-channel multiplexer (TCA9548A) and a USBto-I 2 C converter. If there is no electrical current limit, up to 64 sensors of the same type are supported via a single I 2 C measurement unit. Due to the bandwidth limit of I 2 C, the polling rate decreases with increasing sensor counts. In contrast to I 2 C, SPI requires one digital output pin per sensor. Hence, by using a digital multiplexer, up to 16 SPI sensors can be connected to a single USB port. This is tested using a 4-wire Pt100 temperature measurement box with a digital multiplexer, an FT232H, and 16 MAX31865 (4wire set-up) by Maxim Integrated on a single PCB (see [14] for layout). The system is able to detect whether a measurement unit is configured for SPI or I 2 C communication. Plug and play operation is supported by an automated sensor detection. The measurement quantities, average measurement accuracies and maximum sampling frequencies of the supported measurement devices are listed in Table 1. It lists only devices and measurement ranges used in referred applications. However, the list of supported devices is extensive and growing rapidly. Proven probes and sensor systems will be updated in the project documentation [14]. Table 1: Measurement transducers including accessible measurement quantities (Qty.), maximum measurement frequencies f max , average accuracies, and measurement ranges. Quantities are temperature (T ), relative humidity (ϕ), volume-flow rate (V ), absolute pressure (P ), differential pressure (p), CO 2 concentration in air (c co2 ), dew-point temperature T dp , and voltage U . v represents the current measurement value. A full list can be found in the repository [14].

Software and API
The web-interface and the sensor drivers are installed inside sandboxed docker containers. An overview of its structure is listed in Figure 2 with the containers, implemented in this project, highlighted in gray. The instances of the web server, the relational time-series database TimescaleDB, dataacquisition workers and the graphical user interface are separated for better maintainability.
The containers communicate via standardized interfaces, which facilitates the maintenance in case a single container has to be replaced or modified. Besides configuration adjustments, the database and the nginx web-server are imported from their respective repository. Operational states are represented in two ways and are accessible via HTTP.
The first provides a graphical user interface (GUI) to start and stop measurements, to connect new devices, to display real-time data, to visualize results, and to download measurement values. The second provides an API, which includes and extends the information and control capabilities of the GUI in a machine readable fashion. The communication with a RESTful API is supported by all state-of-the-art programming languages. This ensures seamless integration to com- plement an existing set-up. In addition, a Message Queuing Telemetry Transport (MQTT) client is used to enable monitoring of data via applications common to the Internet of Things (IOT), such as Grafana or Node-RED. 3a displays the submenu for live data monitoring. Further, real-time computation of statistical quantities i.e. the average measurement value of a sensor set is supported. 3b reveals the submenu of the customizable visualization of the probe time-series. The GUI supports an automatic sensor initialization. In addition, the export to ascii and binary based file formats is supported via the web interface or the API.
The system stores known sensors identified via unique identification numbers in a database. This  numbers link to additional information like: calibration data, displaying settings, or sensor positions. Each sensor has its own optimized initialization routine to ensure stable operational conditions. The initialization runs before each start of a measurement.
Each measurement unit runs in its own thread to obtain measurement values in parallel. This also increases the system stability, since connection losses or device failures only affect a single device and have no impact on the system's integrity. The system has been tested against disruptive factors like increased vibration, high temperature gradient, or strong electromagnetic interference, where sensors often become unresponsive, or temporarily shut down.
In these cases the system attempts to reinitialize missing sensors and resumes measurements after successful reconnection. Critical parts of the software have been written using test-driven development to ensure that readings are retrieved, converted and stored correctly.

Conclusion and future development
We introduced a versatile and compact measurement system. Features of the system are a modular and easily extensible hardware and software architecture and an open-source and open-hardware approach. Support of high precision sensors together with low priced measurement transducers allows for applications ranging from low budget citizen science projects to complex systems i.e. precision control loops in fundamental research. The system has proven itself stable and flexible in a variety of applications. Future work is dedicated to allow for wireless sensor data transmission and to support TCP/IP measurement devices. We cordially invite readers to participate in the development and testing of the system.