Application of single-board computers in experimental research on unsaturated soils

. In this contribution, the application of single-board computers for the investigation of the hydro-mechanical behaviour of unsaturated granular soils is presented. Single-board computers, such as the Raspberry Pi or Arduino, have recently experienced a hype of applications in school and university teaching, in the maker scene, amongst hobbyists, but also in research. In combination with easy to learn and open programming languages, such as Python, individual experimental set-ups for research in unsaturated soil mechanics, using actuators and sensors can be easily developed with the help of di ﬀ erent programmable hardware, such as stepper motors, analog-to-digital converters and other controller boards. For the experimental application in imaging of unsaturated granular soils by computed tomography (CT), we present a miniaturized uniaxial compression device for the measurement of unsaturated shear strength and capillary cohesion in CT-experiments. The device has already been applied for CT-imaging of the development of water distribution and capillary bridges in between di ﬀ erent shear steps. Furthermore, a new fully programmable hydraulic experimental set-up for the automated investigation of transient hydraulic paths of the water retention curve of granular media is presented. Both devices have been developed in the framework of the Raspberry Pi single-board computer and Python programming language with simple and relatively inexpensive hardware components. In addition to the technical development of the testing devices, experimental results of the hydro-mechanical behaviour of unsaturated sand and glass beads, derived from uniaxial compression tests and water retention tests, will be presented.


Motivation of research
In our times, the evolution of technology as well as spread and accessibility of information has opened many doors for non-experts to make progress in the field of computer technology and electronics. Single-board computers, such as the Raspberry Pi, developed by the Raspberry Pi Foundation [1] to teach programming at schools, are used more and more in teaching but also in research. A broad documentation on the internet allows everyone to access information about technology-based projects, ranging from home made plant-watering systems to selfmade 3D-printers and other applications in informatics and robotics. Furthermore, a growing market of peripheral and compatible hardware components allows to develop unique and very specialized projects. As the statistics in figure 1 show, the application of single-board computers in research has been rapidly growing in the last decade.
In this contribution, the application of single-board computers in soil mechanical research is motivated by giving the example of two experimental set-ups, designed for experiments on the hydro-mechanical behaviour of unsaturated granular soils. The hardware and software development as well as the practical application to questions of unsaturated soil mechanics will be addressed. * e-mail: marius.milatz@tuhh.de

Single-board computers
Single-board computers are autonomous computers, mainly consisting of a single circuit board, that is kept very simple in its design and that contains a micro controller chip for data processing. In industry, microcontrollers represent the controlling electronic unit in many applications in production and automation and are frequently used in process control, which implies the measurement of data and the initiation of processes. With the development of the Raspberry Pi single-board computer in 2012 by the Raspberry Pi Foundation a single-board computer to be applied in teaching was born. In figure 1 a very noticeable increase in publications related to single-board computers can be seen after the year 2012.
The Raspberry Pi is an easy to use single-board computer with an operating system, Raspbian [3], ensuring user friendly interaction with the device. Furthermore, the single-board computer allows to interact with peripheral devices, such as sensors and motors, with the help of so-called General Purpose Input Output-pins (GPIO-pins). This functionality makes it possible to use the Raspberry Pi as a data logger and for the control of actuators in individual experimental set-ups.

Application in research on unsaturated soils
The different devices presented in the framework of this paper have been recently developed by the author for the purpose of performing miniaturized experiments that can be imaged with computed tomography (CT). The experiments are meant to give microscopic insights into microscopic origins of fundamental unsaturated soil behaviour, such as the water retention curve (WRC) and unsaturated shear strength and capillary cohesion, that are typically measured on a macroscopic level. In a first project, the Raspberry Pi single-board computer has been used for the control of a miniature uniaxial compression device for the investigation of the shear strength of unsaturated granular material at very low stress state. In a second project, a miniature testing device for the measurement of transient water retention curves has been designed. Both devices have been tested under lab conditions and also CTexperiments have been conducted.
Experimental soil-testing in unsaturated soilmechanics depends on different very typical functionalities that can be summarized as follows: the application of loads or displacements by actuators, the measurement of forces by load cells, the measurement of pore water pressure or suction by pressure sensors or tensiometers, and the control and measurement of volume changes, especially of pore water. The aforementioned set-ups include most of these functions, which will be presented in the following.

Hardware and software
In order to measure the capillary effect on unsaturated shear strength of granular media at very low stress state, where the effect of suction stress becomes measurable, small cylindrical soil columns made of sand or a packing of glass beads are sheared at different water contents in uniaxial compression tests (without lateral confinement).
The testing device, developed for this purpose and presented for the first time in [4], consists of a cylindrical specimen holder with a load cell in its bottom and a loading piston at its top that is driven down by a stepper motor, see figure 2.
For the control of the uniaxial compression device, the "UNSAT-Pi", based on a Raspberry Pi 3 model B singleboard computer, was developed. During the experiment, the single-board computer drives a stepper motor for the compression of the soil specimen and also takes readings of the load cell. The load cell with a maximum load rating of ±25 N (type KM10z, combined with a measurement amplifier of type GSV-1L, both manufactured by ME-Meßsysteme GmbH) allows to measure the very low load response of the specimens (h/d = 20/20 mm in laboratory experiments, h/d = 12/12 mm in CT-experiments). The electrical signal is transformed to a digital signal by an analog-to-digital converter (ADS1115, manufactured by Adafruit learning system) [5]. The digital signal is then read by the Raspberry Pi via its I 2 C-data bus.
As very small shear strength due to capillary effects at zero lateral confinement of the specimens is expected, the shearing can be applied by a simple stepper motor (type 28BYJ48-12-300-01, manufactured by Changzhou Fulling Motor Co., Ltd., China). A full revolution is discretized by 512 steps which allows for a resolution of axial displacement of 0.0005 mm/step as derived from the pitch of the applied loading spindle. The stepper motor is driven by a stepper motor controller chip that is controlled by the Raspberry Pi's GPIO pins. The full hardware layout is illustrated in the wiring diagram in figure 3.
The control of the UNSAT-Pi is given by a Python programme [6], that applies a desired loading step, consisting of a given axial displacement, and that saves the axial displacement and force readings to hard disc, acting as a data logger. This allows to shear unsaturated soil specimens by displacement control, either under laboratory conditions with a continuous loading [4], or in a CT-scanner, where a tomography can be obtained after different shearing steps [7].

Applications
After calibration and testing, the uniaxial compression device was applied to measure the shear strength of small columns of unsaturated granular material at different initial water contents. In the experiments, a coarse grained model sand, named "Hamburger Sand", was compared to a packing of glass beads that had the same grain-size distribution curve as the sand.
Unsaturated free-standing soil specimens were created by mixing dry granular material with the amount of water needed for a desired initial water content. The mixture was then compacted in layers to a desired density in a cylindrical mould with a piston-like bottom that allows to push the specimens out vertically. The specimens were then immediately placed on the loading plate shown in figure 2 for testing in order to minimize evaporative water losses. This procedure allowed to shear soil columns at different initial water contents and initial void ratios.
After preparation, the specimens were carefully placed on the load plate and then continuously sheared while pho-   tographs were taken for different axial displacement steps. From the photographs the specimen diameter could be measured for deriving the specimen cross sectional area needed for the calculation of axial stress from the measured axial force. Figure 4 shows the axial stress and specimen cross sectional area versus axial strain for uniaxial compression tests on Hamburger Sand with different water contents w and degrees of saturation S r . The water contents represent averaged values of initial and final water contents to consider evaporation. The degrees of saturation are calculated from these water contents and the initial specimen volume.
The plots of axial stress versus strain show an increase of shear strength with increasing water content. The evolution of specimen cross sectional area indicates a dilative behaviour of the sand specimens. Analogous results from  uniaxial compression tests on the glass bead specimens are shown in figure 5.
In comparison to the tested sand, much lower shear strengths are obtained for the glass beads. The glass beads also show an increase of shear strength with increasing water content. Furthermore, the volume change of the glass bead specimens corresponds to dilative behaviour. However, the glass beads seem to be less dilative compared to the specimens of Hamburger Sand which might be related to the different grain shapes.

Hardware and software
Based on priliminary experiments on the water retention curve of granular soils with the focus on hysteresis and transient flow conditions [8], an experimental set-up for the automated and continuous measurement of transient water retention curves has been developed. For the control of the test set-up the UNSAT-Pi 2, based on a Raspberry Pi 3 model B+, has been developed. Again, a Python program allows full control of the experiment, in which the degree of saturation of the specimen can be continuously changed in terms of drainage and imbibition paths, while matric suction is measured as a response. In order to measure different hydraulic paths of the WRC, the single-board computer controls a 3D-printed stepper motor-driven syringe pump, firstly presented in [9], and logs the data of a pore water pressure sensor for the measurement of suction underneath a filter membrane. The filter membrane (Versapor-800, pore size 0.8 µm, manufactured by PALL Corp.) has a suitable air entry value while ensuring a sufficient water flow [10]. It is clamped underneath the cylindrical specimens in an acrylic specimen holder that contains specimens with h/d = 12 mm/12 mm. The design of the specimen holder allows to place it in a CT-scanner to obtain 3D-images on different hydraulic paths. Similar to the uniaxial compression device, a stepper motor controller board for the control of the NEMA 17 stepper motor (type 17HS13-0404S, 12 V, 0.4 A, torque 26 Ncm), and a 16-bit analog-to-digital converter for the reading of the miniature low pressure sensor (type 26PCBFA6G, differential measurement, manufactured by Honeywell) [11] with a pressure range of ±5 psi (±34.75 kPa) are used and connected to the Raspberry Pi.
The full set-up is described and tested in detail in [12] and shown in figure 6. A Schematic wiring diagram of all hardware components is given in figure 7.  The Python program has been designed to run a fully automated test. A WRC of the tested specimen is obtained by combining the time series data of the applied change of saturation and the suction response measured with the pore water pressure sensor. The user can program the desired changes of degree of saturation over time in different testing stages and start the program to measure arbitrary hydraulic paths of the WRC of granular materials. The liberty of directly programming the pore water volume changes applied by the syringe pump makes it possible to design special testing scenarios, e. g. for the acquisition of CT-scans in between hydraulic steps.

Applications
With the help of the water retention test set-up, arbitrary hydraulic paths of the water retention curve of granular materials can be investigated in an automated way. Different consecutive drainage and imbibition paths have been prescribed to Hamburger Sand and glass beads as used in the experiments presented before.
The soil specimens are made by pouring dry material into the already water-filled container with all water tubes connected to the pore water pressure sensor and the syringe pump. The material is compacted in layers to the desired specimen height of 12 mm for a desired initial void ratio e 0 = 0.65 for the sand and e 0 = 0.615 for the glass beads.
All experiments start with a primary drainage from initial full saturation, followed by main imbibition and further drainage and imbibition cycles leading to different higher order scanning paths. The testing procedure is programmed in a way that reduces the amplitude of prescribed  [13,14]. Here, the primary drainage path is measured during a very slow evaporation process using tensiometers for suction measurement and a laboratory balance for measurement of the change of water content and degree of saturation, resulting in an equilibrium WRC. The data measured in individual hydraulic steps is highlighted by a different color for a test on Hamburger Sand in figure 8 and on glass beads in figure 9. The transient water retention curves show the typical hysteretic behaviour with closed ellipsoid scanning loops. Also, the phenomenon of air entrapment can be noticed, with the curve of suction becoming asymptotically horizontal for elevated degrees of saturation at main imbibition. For both materials the measured primary drainage paths are very close to the equilibrium primary drainage paths measured in the evaporation tests. Therefore, it is assumed that the selected flow rate is low enough to measure transient WRCs that are close to equilibrium conditions.

Conclusion and outlook
Single-board computers, such as the Raspberry Pi used in the research projects on unsaturated granular soils presented here, allow scientists to create their own very  specialized testing apparatuses with full control of the hardware and software components. Although timeconsuming, especially in the beginning due to planning and calibration, the development of own experimental setups comes with numerous advantages. As there exists a large community of users, many electrical and mechan-  ical engineering problems are at least addressed or even already fully solved and well documented on the internet. Furthermore, a variety of inexpensive and easy to use electrical and mechanical hardware components, such as sensors and actuators, are found on the market. In many cases technical solutions especially designed for their application along with single-board computers for learning and teaching applications are easily available. Typical engineering applications, such as reading out load cells or applying movements with motors can be easily realized as shown in both examples presented here. Thus, very customized experimental set-ups can be designed. Other benefits come with the open source software approach that is fully supported by the Python programming language. This language is pre-installed on the Raspberry Pi and can be used to control all kinds of peripheral devices with compatible open software libraries found and distributed by developers and hardware manufacturers on the internet.
Both projects presented here are already used in laboratory CT-scanners to obtain 3D-images of the investigated processes [7]. Without individual hardware and software solutions this would not be possible. The analysis of CTdata is supposed to give new insights into the microscopic processes in unsaturated granular soils and the role they play for the macroscopic behaviour, measured in a conventional way, e. g. the shear strength and the water retention behaviour, where many open questions still exist.