Temperature-dependent transport measurements with Arduino

The current performances of single-board microcontrollers render them attractive not only for basic applications but also for more elaborate projects, amongst which physics teaching or research. In this article, we show how temperature-dependent transport measurements can be performed using an Arduino microcontroller, from cryogenic temperatures up to room temperature or above. We focus on two of the main issues for this type of experiments: the determination of the sample temperature and the measurement of its resistance. We also detail two student-led experiments: evidencing the magnetocaloric effect in Gadolinium and measuring the resistive transition of a high critical temperature superconductor.


I. Introduction
The development of single-board microcontrollers and single-board computers has given physicists access to a large variety of inexpensive experimentation that can be used either to design simple test benches, to put together set-ups for class demonstration or to devise student practical work. Moreover, specifications of single-board components are now such that, although they cannot rival with state-of-the-art scientific equipment, one can nonetheless derive valuable physical results from them.
We will here focus on the Arduino microcontroller board [1]. Let us note that other boards, such as MBED, Hawkboard, Rasberry Pi, or Odroid to cite but a few, exist which may be cheaper and/or have better characteristics than Arduino. In our case, we have employed Arduino boards to take advantage of the important user's community. This has been an important selling point for the students with whom we are working.
Indeed, our experience with Arduino is primarily based on undergraduate project-based physics labs [2] we have initiated within the Fundamental Physics Department of Université Paris Sud for students to gain a first hands-on practice of experimental physics. In these practicals, students are asked to choose a subject they want to study during a week-long project. They then have to design and build the experiment with the equipment available in the lab. The aim is not only to study a physical phenomenon, but to do so by using inexpensive materials and low-cost boards.
In this article, we will describe two projects that have been developed by third year students. The first one aimed at quantifying the magnetocaloric effect in Gadolinium and the second one, which has been popular amongst students, consisted in measuring the resistive transition of a high critical temperature superconductor (HTCS). However, the techniques to do so can more generally be used for any experiment involving the measurement of a low voltage while varying the set-up temperature. In particular, they could be applied to simple transport characterization of samples in research laboratories.
In the following, we will focus on two important issues for this kind of measurements: thermometry and thermal anchoring on the one hand, and measuring resistances on the other.

II. Determining the temperature of an object using microcontrollers
One of the experimental control parameters that is most commonly used to make a physical system properties vary is temperature. There is a wide variety of temperature sensors, depending on the temperature range of interest. The aim of this paper is not to list those, but rather, to focus on the most ordinarily found sensors compatible with an Arduino read out. We will also review some basic techniques to ensure a proper thermal contact between the sample and the thermometer.
i. Sensors types

a. Built-in Arduino sensors
There are a number of temperature sensors that are generally sold with standard Arduino kits. The Arduino Starter Kit, for instance, comes with a TMP36 low voltage temperature sensor [3] (available for about $1 if purchased separately) whose operating principle is based on the temperaturedependence of the voltage drop across a diode. The advantage of this type of thermometer is that it can be directly plugged into Arduino without any additional electrical circuit. Furthermore, provided that the corresponding library is downloaded, the temperature is straightforwardly read via the computer interface in • C, so that no calibration is needed.
However, these sensors are limited in accuracy and operation: the TMP36 sensor for example has a ±2 • C precision over the −40 • C to +125 • C range where it can operate. If they are extremely convenient for non-demanding temperature read-outs, such as students atmospheric probes for example [4], they are not adapted to the precision needed for most research lab experiments.

b. Thermocouple
Thermocouples are cheap and robust thermal sensors that are industrially available for about $15, and which cover a wide range of temperatures (for example from −200 • C to +1250 • C for a type K thermocouple [5]). They are one of the few thermometers that are reliable at temperatures much higher than room temperature.
Thermocouples are also extremely convenient to measure the temperature of small-sized samples. Indeed, only the hot junction between the two metals needs to be in contact with the region where the temperature is to be monitored. On the other hand, the quality of the readings will strongly depend on how thermally stable the cold junction is, and the temperature measurement is less precise than using a thermistor. Indeed, the voltage to be measured is small: the sensitivity of a thermocouple is of the order of tens of microvolts per Kelvin, and it decreases when the temperature decreases (a type-K thermocouple has a sensitivity of 40 µV.K −1 at room temperature but a sensitivity of 10 µV.K −1 at liquid nitrogen temperature).
Let us note that an amplification of the voltage signal is then needed to read the temperature with Arduino. Some chips provide a ready-to-use thermocouple amplifier for microcontrollers (such as the MAX31856 breakout with a resolution of a quarter of a kelvin when using the Adafruit library [6] and an accuracy of a few kelvins). Better sensitivity could be achieved with a home-made amplifier (see below) and some care.

c. Platinum thin resistive films
Platinum thin films are practical and very reliable resistive thermometers typically working from 20 K to 700 K [7]. They are therefore suited for cryogenic applications -at least down to liquid nitrogen temperatures -as well as for moderate heating. The advantage of this sensor is that its response is entirely determined by the value of its resistance at 0 • C [8]. The most commonly used platinum resis-tance is the so-called Pt100 which has a resistance of 100 Ω at 0 • C and costs approximately $3 to $5. These thermal sensors have a typical precision of about 20 mK up to 300 K and about 200 mK above room temperature. Moreover, their magnetic fielddependent temperature errors are well-known [7].
It is possible to mount those resistances on a dedicated Arduino resistance-to-temperature converter such as MAX31865 [9], but it is often simpler to plainly measure the resistance with a dedicated electrical circuit as will be explained in section III. This is particularly convenient for low or high temperature measurements for which the Arduino board cannot be at the same temperature as the thermometer and the sample are.

ii. Thermal anchoring
For the temperature measurement to be relevant, the thermometer must be in good thermal contact with the sample. How to achieve a good thermal anchoring is a subject of investigation in itself, but in this section we will outline a few standard techniques, focusing on the low temperature case.
To cool down a sample at low temperatures, one could use a Peltier module, but the simplest -and not so expensive -way is to use liquid nitrogen. Some basic safety measures have to be taken to manipulate this cryogenic fluid: use protection glasses, gloves, work in a well-ventilated room and, above all, ensure that it is poured into a vessel that is not leak-tight to allow natural evaporation of liquid nitrogen and avoid pressure build-up in the vessel. Once these precautions are observed, the manipulation is relatively safe.
To ensure that the thermometer indeed probes the sample temperature, the most obvious technique is to solidly attach the thermometer to the sample using good thermal conductors. The thermal sensor can, for instance, be glued onto a copper sample holder. The glue then has to retain its properties at the probed temperature range. In the low temperature case, one frequently uses GE 7031 varnish which sustains very low temperatures and can easily be removed with a solvent. Alternatively, the thermometer could be mechanically fixed with a spring-shaped material whose elasticity is maintained at a low temperature, such as CuNi sheets. Upon cooling, the spring-shaped material will continue to apply pressure onto the thermometer, thus ensuring a good mechanical and thermal contact with the sample holder.
Another method is to thermally insulate the thermometer and the sample from the outside world, while putting them in contact with a common thermal bath. This can be done by inserting them into a container filled with glass beads of a few millimeters in diameter [10] (inset of Fig. 7), or alternatively, sand. These materials provide a good thermal insulation of the {sample+thermometer} system from the outside world while allowing for an important thermal inertia. Moreover, when working at temperatures close to 77 K, they limit the liquid nitrogen evaporation so that the temperature increases back to room temperature only very slowly: typically for a volume 1 L of beads that is initially immersed in liquid nitrogen, the temperature reaches back 300 K in 3 to 4 hours. The heat exchange between the sensor and the sample is then guaranteed through the evaporated N 2 gas, thus ensuring the temperature is homogeneous within the entire volume. An alternative method for achieving good thermal contact between the sensor and the sample through gas exchange is explained in Ref. [11].

III. Measuring resistances with microcontrollers
Microcontroller inputs give a reading of electric potentials. Measuring resistances is then slightly more complicated than plugging a resistance into an ohmmeter. For educational purposes, this is actually rather valuable since it gives students the opportunity to experiment with the notion of resistance and to realize that even the simplest measurement may present some challenge. In the following, we will present standard methods to measure resistances and we will particularly focus on the low-resistance case.

i. Current-Voltage measurement
The simplest set-up for measuring a standard resistance is the voltage divider set-up represented in Fig. 1: the resistance of interest R 0 is put in series with a reference resistance R ref . The voltage drop across both resistances is controlled by the board 5 V output. The potential V 1 can be read by one of the microcontroller's inputs and should be close to 5 V. The potential V 2 -read by a second input -corresponds to the voltage drop across the unknown resistance. R 0 can then be determined through the simple relation: The monitoring of V 1 allows for a better precision through a direct monitoring of the current. Arduino's 5 V output sometimes varies in time. To have a better stabilization of the voltage, it may be useful to use an external power source for the microcontroller and not use the computer's USB output.
Let us note that, if R ref R 0 , the current through the circuit can be considered to be constant, which is often very convenient when the resistance measurement does not require a large precision.
This method presents several drawbacks when dealing with small values of R 0 : since the ultimate resolution of an Arduino UNO board is of about 1 mV with V ref = 1.1 V, one cannot measure R 0 smaller than about 2 × 10 −4 R ref . In the case of a standard commercial HTCS sample for instance, the normal state resistance is often of the order of a few tens of mΩ. To observe the resistance drop across the critical temperature T c of a superconductor, R ref should then be of the order of a few Ω. Such resistances are commercially available or, alternatively, can be custom-made with a relatively good precision (of the order of a few mΩ) by using a long string of copper wire (commercially available Cu wires of 0.2 mm in diameter have a resistance of about 0.5 Ω/m for example). However, unless V 2 is amplified, the precision of the measurement is not optimal. Moreover, using this method to measure small resistances leads the circuit current to exceed the maximum current allowed at the microcontroller's output. In the following, we will see another method to measure small resistances.

ii. Wheatstone bridge
Another resistance determination method, which can achieve a good precision, is the Wheatstone bridge. The principle of the measurement is illustrated in Fig. 2. R 1 and R 3 are fixed value resistances, while R 2 is a tunable resistance and R 0 the resistance of interest. The potentials V 1 and V 2 are then related by: The bridge is co-called "balanced" when R 2 is tuned such that V 1 and V 2 are equal. The resistances are then related through: The precision that can be achieved through this method and when using a microcontroller is about the same as for the current-voltage measurement method. However, this method is not very practical when dealing with resistances R 0 that vary, since the bridge has to be maintained close to balance at each measurement point. In particular, it is not well suited for the measurement of a superconductor's resistive transition.

iii. Voltage amplifier
The most practical solution for the measurement of small voltages -and hence small resistances -is the amplification of the potential difference across the resistance. This can be done via standard voltage amplification set-ups using operational amplifiers, either in single-ended or differential input configurations. In the single-ended case, illustrated in Fig.  3, the output potential is given by:  The input voltage V in can then be amplified at will, depending on the ratio R2 R1 . The output voltage V out can then be read by the microcontroller.
This amplification method has a much larger precision than the previously mentioned methods, it does not require tuning at each data point and can be used to measure any small voltage: the voltage drop across a superconductor, but also the difference of potential across a thermocouple, or to derive thermoelectric coefficients (Seebeck or thermopower).
Going beyond this simple amplification method requires substantially more work. One possible method is to fabricate a microcontroller-based lockin amplifier, as demonstrated in Ref. [12].

iv. Using another ADC than Arduino's
The specifications of Arduino Digital-Analog Converter are often the main limitation in the above measurements. As already mentioned, the Arduino ADC provides -at best -10 bits on the 1.1 V internal reference voltage, and can only measure a voltage in single-ended configurations.
One alternative would be to use another microcontroller, with a better ADC. For example, the low-cost FRDM-KL25Z from NXP [14] provides a ADC that can measure a voltage either in singleended or in differential input configurations with 16 bits on 3.3 V.
The ease-of-use and the large users community can be a strong motivation to keep Arduino as your board of choice. In which case, a second solution would be to use an external ADC when better resolution or a differential mode configuration is needed. For example, we have tested the ADS1115 chip [15]: this external ADC can measure 4 single channels or 2 differential channels with 16 bits on 4.1 V. The possibility of a preamplification up to 16 times brings the resolution down to 8 µV per bit instead of the standard 5 mV (or 1 mV with the 1.1 V internal reference).
The possibility of measuring a voltage in a differential mode configuration with a resolution better than 10 µV are two important advantages that open many interesting possibilities for physics measurements: for instance, measuring a strain gauge or a resistance in a four-wire configuration, or measuring directly a thermocouple or the resistance of a superconductor across the transition.
The main drawback to this method is that it is not as easy as using the Arduino ADC: a library should be installed first (but good tutorials can be found online, see for example Ref. [15]). Also, an external ADC is generally not as robust as the Arduino's ADC, and the user should carefully monitor the voltage input so as not to damage the ADC.

IV. Evidencing a magnetocaloric effect with microcontrollers
To illustrate these methods, let us detail the magnetocaloric effect that we have measured. This effect consists in the temperature change occurring when a magnetic material is placed in a varying magnetic field. A more detailed explanation of this the phenomenon can be found in Ref. [16]. In our case, Gadolinium (Gd) was chosen for its paramagnetic properties and its Curie temperature close to room temperature (T Curie = 292 K). At a temperature of about 298 K, a 2.242 g Gd sample was submitted to the magnetic field created by a neodymium magnet of maximum value 0.51 T.
In this experiment, the challenge was to measure the small temperature difference induced by the application of a magnetic field. To this effect, a Pt100 thermistor was put in good thermal contact with the Gd sample via thermal paste. The resistance change was measured by a Wheatstone bridge with the following characteristics: R 1 = R 3 = 100 Ω, R 2 has been set at 108 Ω to be close to balance at the considered temperature and V e = 5 V via Arduino's internal source. An additional resistance R c = 800 Ω was placed in series to limit the current going through the Pt100, thus avoiding heating the thermometer. V e is then replaced by R1+R2 R1+R2+2Rc V e in Eq. (2). The off-balance difference of potential V 2 − V 1 was differentially amplified with a gain of 100 (R 4 = 1.5 kΩ and R 5 = 150 kΩ). The voltage V out was then read by the board (Arduino Mega in this case) using 2.56 V as Arduino's ADC reference voltage [17]. The overall read-out circuit is schematically shown in Fig. 4. The temperature is then inferred knowing that, in the [273 K -323 K] range, the Pt100 response can be linearly fitted by: fect is clearly visible with an amplitude of about ∆T 0.33 ± 0.01 K and a time scale of a few seconds. The resolution of the setup corresponds to 50 mK (18 mΩ). Each data point in Fig. 5 corresponds to an average of 50 measurements so that the effective noise that can be observed is of about 10 mK, or about 5 mΩ in resistance. This yields a relative precision for the measurement of a few 10 −5 , which is remarkable given the simplicity of the apparatus . When the magnet is taken away from the Gd sample, the temperature decreases back to its initial value, as predicted by the isentropic character of the magnetocaloric effect.

V. Measuring a superconducting resistive transition with microcontrollers
For the second experiment, we would like to detail is the measurement of the superconducting resistive transition of a HCTS. Indeed, in such compounds, the critical temperature T c below which the sample is superconducting and exhibits zero resistance is larger than 77 K. The transition can therefore easily be observed by cooling the sample down to liquid nitrogen temperature and warming it back up to room temperature.
In the present case, the HCTS is a commercial Bi 2 Sr 2 Ca 2 Cu 3 O 10 sample which specifications indicate a critical temperature T c = 110 K at midtransition point and a room temperature resistivity of 1 mΩ.cm [18]. In this case, the experimental challenge is therefore to measure very small resistances with good precision. To achieve this, it is essential to adopt a four-wire measurement configuration for the superconductor, as schematized in the inset of Fig. 6. Indeed, in this way, no contact resistances or connection wires contribute to the measured resistance. Moreover, the voltage drop across the superconductor has been amplified by a factor of 480 by a single-ended operational amplifier set-up as shown in Fig. 6. The current going through the superconductor is fixed by R 0 = 110.0 Ω R 1 , R HCT S and is experimentally measured via the potential V read at the extremity of a homemade resistance R 1 = 1.18 Ω, made out of copper wire.
The temperature has been measured with a Pt100 resistive thermometer using the set-up shown in Fig. 1  Both the sample and the thermometer have been attached to a printed circuit board and have been wrapped in cotton to ensure temperature homogeneity. The ensemble was placed in a polystyrene container filled with glass beads (inset of Fig. 7). Liquid nitrogen was then poured into the container and the temperature of the ensemble was let to increase back to room temperature while recording the data.
In this manner, we have measured the resistive transition given in Fig. 7. The experimental data have been averaged by a convolution with a Gaussian of half width 0.4 K to take into account the error in the temperature measurement. As it can be seen, the resolution of the measurement is of the order of 0.1 mΩ for the superconductor's resistance. The latter is actually dominated by the thermal gradient that may exist between the sample and the thermometer if the operator does not carefully check that both are close to one another or if the container is forcefully warmed-up (with a hair dryer for instance). Nonetheless, the precision of the measurement is good (< 1% relative uncertainty) and the measured mid-point T c is of 112 K ± 2K, very close to the value given by the specifications.

VI. Conclusion
In conclusion, we have shown that standard temperature and resistance measurement methods could be adapted to microcontrollers. The performances that are then attainable are sufficient to probe with reasonable sensitivity a large range of physics phenomena such as thermoelectric effects, temperature-dependence of the resistivity, Hall effect, magnetocaloric effect, etc. We have illustrated this with the measurements of magnetocaloric effect in Gadolinium and of the resistive transition of a high critical temperature superconductor. We believe that the scope of inexpensive, transportable and easy-to-build experiments that are accessible through the use of single-board microcontrollers is continuously expanding and, in some cases, can now even replace standard characterization methods in research laboratories. Furthermore, they provide a large range of opportunities to devise innovative teaching activities that enhances students involvement.