How to create a very-low-cost , very-low-power , credit-card-sized and real-time-ready datalogger

In order to improve an existing network, a field seismologist would have to add some extra sensors to a remote station. However, additional ADCs (analogue-to-digital converters) are not always implemented on commercial dataloggers, or, if they are, they may already be used. Installing additional ADCs often implies an expensive development, or the purchase of a new datalogger. We present here a simple method to take advantage of the ADCs of an embedded computer in order to create data in a seismological standard format and integrate them within the real-time data stream from the station. Our first goal is to plug temperature and pressure sensors on the ADCs, read data and record them in mini-seed format (seed stands for Standard for the Exchange of the Earthquake Data), and eventually transfer them to a central server together with the seismic data, by using seedlink, since miniseed and seedlink are standard for seismology.


Motivations
Inside and outside vault temperatures, outside vault atmospheric pressure (Beauduin et al., 1996), wind speed, or, as shown recently, geomagnetic pulsations for high-latitude stations (Kozlovskaya and Kozlovsky, 2012), have a strong influence on broadband seismic signals.Therefore, environmental measurements represent valuable data as well as the seismic signals which should be stored, ideally by the seismic datalogger, in order to take advantage of the same transmission protocol.This implies that the number of auxiliary ADCs (analogue-to-digital converters) needed by the data-logger increases since main ADCs (24/26 bits) are designed for sampling seismometer analogue outputs.This motivated our study and we specifically work around the auxiliary channels.Several commercial dataloggers offer additional channels, but often not enough or at a prohibitive price.Table 1 presents the availability of auxiliary channels and the sampling environmental parameters for a series of commercial dataloggers that are currently used in French seismic networks.

Datalogger
According to our criteria, a reliable datalogger for environmental data includes the following features: -at least four ADCs, 100 dB dynamic range at a 1 Hz sampling rate; -a real-time transmission protocol, with an adjustable buffer (1 to 24 h); -a local data archive, recorded in mini-seed, keeping the last 3 months; -a robust and efficient delayed-time transmission protocol; -synchronisation with GPS; -sampling of all ADCs synchronised together; -weak power consumption; and -robust hardware.
Published by Copernicus Publications on behalf of the European Geosciences Union.Sampling those data at a frequency higher than 1 Hz may not be necessary, since we are only interested in improving the long-period noise.In order to estimate the needed dynamic range, we used temperature and pressure data from the Geoscope network during the year 2012.We first calculated the power spectrum density (PSD) of all signals, and then extracted the maximum and minimum PSD shown in Figs. 1  and 2. The Geoscope network includes broadband stations installed over the world, covering a large range of climate conditions.According to Figs. 1 and 2, a dynamic range of about 100 dB is the best performance at a frequency range of 1e-5 to 5e-1 Hz.Those data have to be both sent through the same transmission protocol and locally recorded in the same format as the seismological data, i.e. using seedlink and miniseed, commonly used in seismology.A robust delayed-time protocol has to be implemented in case of loss of transmission, allowing the recovery of the missing data, only, with an optimised algorithm.

Choice of software and hardware
We specifically use standard and robust toolkits: a Linux distribution, running gpsd and ntpd for synchronisation with an Usb GPS receiver (XBU-353 from UsGlobalSat), rsync for delayed-time transmission protocol and seiscomp3 for realtime acquisition and transmission through its seedlink protocol (Gempa GmbH, 2014), and finally local archive capacity through its slarchive plugin.In order to study the possibilities of using a commercial embedded computer, more often used in robotics, we used a BeagleBone Black (BBB) Rev C.1.Its main features are an ARM Cortex A8 (32 bit) processor at 1 Ghz, 512 MB of DDR3 Ram, 4 GB onboard flash, eight ADCs of 12 bits and a dynamic of 0-1.8 V, and 1 W of power consumption.Other industrial embedded computers are probably better suited for our purpose, but we selected this one on the criteria of price and ease of use, but also because the BeagleBone Black is provided with a Debian 7 operating system, and an active community maintains the needed documentation and libraries.The main first issue was the determination of the exact dynamics of its ADCs, because only few manufacturers communicate the real dynamic range, since it is not a crucial parameter in robotics.Therefore, we looked at the three-channel coherence analysis (Sleeman et al., 2006).Figures 1 and 2 show the actual dynamic range of ADCs by calculating their self-noise compared to both minimum and maximum PSD values of temperature and pressure, respectively.Compared to the Geoscope stations, a loss of performance occurs between 0.003 and 0.5 Hz (up to 15 dB at 0.4 Hz) for temperature and between 0.08 and 0.5 Hz (up to 5 dB) for pressure, due to the lower quality of BBB's ADC against Geoscope's auxiliary channels.

Loading Linux and softwares on board
The board is provided with an already installed Debian 7 system and beagleboard.orgprovides the latest ready-to-load system image.The methods for loading a Linux operating system are well documented (BeagleBoard.orgFoundation, 2014a).We choose to keep this Debian distribution, mainly because it is a well-known robust operating system and because rsync, gpsd and ntpd are packaged, making them easy to install through Debian's utility aptitude.

Compiling and configuring seiscomp3 on the BBB
The sources of the packages are available on the seiscomp3 download site (http://www.seiscomp3.org/downloader).The compilation is long, and several dependencies need to be installed.We installed the gui system in addition to the base package, because BBB includes a graphic processor and therefore the configuration of seiscomp3 is possible through its graphic menu scconfig.For a non-negligible gain of time, a BBB system can be emulated on a work station with qemu, and seiscomp3 can be compiled on it.

Sampling ADCs through seiscomp3: bbb_plugin
In the standard distribution, the ADCs are readable in a simple system file.However, standard drivers are not able to handle a continuous analogue application at a high sample rate (1 kHz maximum).Moreover, one of the advantages of the BeagleBone Black is a sub-module of its processor (AM335x from TI) called PRU, supporting that kind of "fast" analogue application.We then wrote a seedlink acquisition plugin filling those roles: 1. drive the PRU to launch sampling; 2. copy data in a buffer; and 3. send buffer to seiscomp server.
Each library necessary to write this program is available on the Internet.We used the libpruio library, specifically written to manage the PRU on BBB (BeagleBoard.orgFoundation, 2014b), and the development file provided with the seis-comp3 package.We called this simple plugin bbb_plugin.Since seiscomp3 is able to manage the mini-seed conversion and the numerical decimation/filtering (see Sect. 7) through its StreamMonitor (Gempa GmbH, 2014), we used the send_raw_depoch() function in bbb_plugin in order to avoid the coding of the mini-seed conversion.Our code is available at https://github.com/mbdb/bbb_plugin. Figure 3 shows a diagram of the seedlink acquisition.

Analogue considerations
Before sampling any data, an analogue anti-aliasing filter per ADC has been designed in order to respect the Shannon-Nyquist theorem.Furthermore, our sensors have an output voltage range non-compatible with the input range of the BBB (0-1.8):we wanted to use a hybrid temperature/humidity sensor (EE08 from EplusE, output 0-10 V) and a pressure sensor (HD9408T Baro from DeltaOhm, output 0-5 V), commonly used in our networks.We applied the common strategy to use a simple first-order RC filter/voltage divider.We designed it to cut frequencies larger than the upper usable frequency (0.5 Hz) of decimated data, but much Response over frequency of every stage at a 10 kHz sampling rate for a EE08 epluse) temperature sensor.The overall response in dB is the sum of all stages; therefore, for data recorded at 1 Hz, the gain is equal to the addition of the T sensor gain, the anti-alias filter's optimal gain, and ADC's gain.Only frequencies between 0.4 and 0.5 Hz (i.e.just before the Nyquist frequency) could be attenuated by the last FIR (Finite Impulse Response) filter stage.
lower than the Nyquist frequency (5 kHz).This analogue stage uses only two resistors and one capacitor per ADC. Figure 4 shows simulations of acquisition stages, and particularly the response of that anti-alias filter in the case study of temperature acquisition.This specific filter gives an attenuation of ∼ 70 dB at the Nyquist frequency.

Digital considerations
A basic concept of analogue-digital conversion is related to the data oversampled at the highest possible frequency, and then digitally decimated to the usable frequencies (Asch, 2003).The quantisation noise of a datalogger is uniformly distributed between DC and the Nyquist frequency and is independent of the sampling rate.Therefore the effective noise power density due to the quantisation at the band of interest is lower at the highest frequency rates.
Since it is difficult to estimate the noise reduction (a new filter design would be required at each sampling rate and a large number of data needed), we used the decimation option within the seiscomp3 StreamMonitor module and measured the highest frequency acceptable in terms of resource consumption.We therefore chose a sampling rate at 10 kHz. Figure 4 shows the response of the FIR decimation stages in the case study of temperature acquisition.

Conclusions and discussions
Our first tests were conclusive for using a commercial embedded computer (BeagleBone Black) to sample environmental data.Its characteristics give a loss of performance in the range 0.001-0.5Hz for temperature and 0.1-0.5 Hz for pressure, compared to the instrumentation used in the Geoscope network.Except for its standard box, which is not sealed and not suitable for harsh environments, this kind of instrumentation seems to be appropriate for field operations.It is compelling to note that our prototype instrument has been in the field for 3 months, and did not show any signs of deficiency.Other more ambitious projects exist for using a BeagleBone Black and its optional capes, as a real seismological station (Mertl and Lettenbichler, 2014), with associated constraints (135-140 dB dynamic range, good synchronisation, etc.).These tests suggest as well that this instrumentation could fulfill a central role in a station.Up to now, the BBB has only been considered as a secondary source of data at a station, which presents a problem, because the data centre receives two distinct sources of data, and has to associate different streams for each station.To overcome this limitation, another strategy has been tested: (1) we loaded a BBB with a seiscomp3 server and set up the acquisition of the seismological datalogger on it; and (2) we also installed our own software (bbb_plugin) for the acquisition of its ADCs, and set up the server to mix the streams.This latter configuration has advantages: -the data centre communicates with a unique source of data per station; and -the unique model of the source permits a total abstraction of the local instrumentation, allowing a standardisation of transmission protocols and local archive structure for every station.

Figure 1 .
Figure 1.Maximum and minimum values of power spectral densities relative to the full dynamic of temperature, calculated from 10of the Geoscope network.Those values are compared to the self-noise of a BBB's ADC at the optimal sampling frequency.

Figure 2 .
Figure 2.Maximum and minimum values of power spectral densities relative to the full dynamic of pressure, calculated from five stations of the Geoscope network.Those values are compared to the self-noise of a BBB's ADC at the optimal sampling frequency.

Figure 3 .
Figure 3. Seiscomp3 acquisition process scheme.If StreamMonitor is not enabled (by default), the mini-seed data are sent from file descriptor 63 directly to the transmission buffer, and raw data are ignored.Running bbb_plugin implies activating this module within seiscomp3.

Figure 4 .
Figure 4. Response over frequency of every stage at a 10 kHz sampling rate for a EE08 epluse) temperature sensor.The overall response in dB is the sum of all stages; therefore, for data recorded at 1 Hz, the gain is equal to the addition of the T sensor gain, the anti-alias filter's optimal gain, and ADC's gain.Only frequencies between 0.4 and 0.5 Hz (i.e.just before the Nyquist frequency) could be attenuated by the last FIR (Finite Impulse Response) filter stage.

Table 1 .
Comparison of common dataloggers used at EOST.ADCs mentioned here are the auxiliary ADCs, available for sampling environmental parameters.SE means single-ended and DI means differential.Some dataloggers offer extra options like Q330/Q330HR, allowing a total configuration of type and dynamic of its auxiliary ADCs, or Staneo offering solutions through RS232 probes.