Python GUI For Impedance Spectroscopy Analysis: Scientia Cum Industria August 2018
Python GUI For Impedance Spectroscopy Analysis: Scientia Cum Industria August 2018
net/publication/326961773
CITATION READS
1 1,583
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Cláudio A. Perottoni on 30 August 2018.
Abstract
A graphical user interface (GUI) for a widely used instrument, namely the Keysight 4294A impedance analyzer, was developed
in Python language. This GUI allows control of instrument, acquisition and processing of impedance spectra from dielectric
materials and electric circuits. Examples of analysis of electric circuits and porous alumina are provided to illustrate some of the
GUI possible applications.
Keywords
graphical user interface; impedance spectroscopy; dielectric permittivity; Python; Keysight 4294A impedance analyzer
I. I NTRODUCTION
A. Theoretical Background
Impedance spectroscopy (IS) is an experimental technique
applicable to a broad range of investigations on the dielectric In materials science, IS is mainly used to measure the
response of materials or, more generally, on the electric dielectric permittivity, which is dependent on the polarizability
behavior of the system under analysis [1]. In this technique, the of the charged species in the sample [1]. In fact, the response
system under study (for instance, a sample of a dielectric ma- of a material (in terms of electric current magnitude and
terial or an electric circuit) is subject to a time-varying electric phase) to an applied oscillating electric potential, can provide
potential, and the resulting current magnitude and phase are significant information on charge mobility and, thus, for in-
measured, yielding the system’s impedance (both magnitude stance, on the microscopic mechanisms responsible for ionic
and phase). This process is then repeated sweeping the electric conduction or dielectric relaxation. Furthermore, the electric
potential oscillation frequency, thus allowing determining the charges present in a material have their mobility affected by
system’s impedance phase and magnitude as a function of most structural transitions and kinetic processes. Therefore,
frequency. changes in dielectric permittivity may be used to detect phase
Nowadays this technique is usually employed using transitions and to track the progress of kinetic processes such
impedance analyzers capable of sweep frequencies over sev- as, for instance, the cure of thermosetting resins. Take, for
eral orders of magnitude within seconds. This way, both slow instance, the glass transition in amorphous materials. If an
and fast system’s response can be observed by looking at amorphous or semi-crystalline solid material is cooled below
the low and high frequency ends of the impedance spectrum, its so-called glass transition temperature, the atomic mobility is
respectively. Though impedance spectroscopy is a relatively reduced, with a measurable effect on the dielectric permittivity
easy, fast and powerful technique, the interpretation of the of the sample. The dielectric permittivity is also dependent
results is seldom straightforward. In fact, the interpretation of on the frequency of the applied electric field. In fact, upon
the impedance spectrum of a dielectric material rely on the increasing the electric field oscillation frequency, the finite
proposal of an equivalent circuit, the number and nature of its velocities characteristic of different polarization processes
elements varying according to the particular experimental con- limit the response of a dielectric material to the applied
ditions, and sample’s composition and microstructure. Besides electric potential. Dielectric relaxation, as this phenomenon is
that, equipment control, and acquisition and manipulation of called, is thus frequency-dependent, and changes in the struc-
IS data often require programming skills, which creates an ture/microstructure of a sample can be easily followed up by
additional barrier to the widespread use of IS by the scientific closely monitoring, for instance, the effect of thermodynamic
community. Accordingly, in this work we present a Graphic fields (e.g., temperature and/or pressure) on its impedance
User Interface (GUI) created with the Python programming spectrum [3].
language and designed for IS analysis with a Keysight 4294A In IS analysis, the system being investigated is subjected to
precision impedance analyzer [2]. This GUI was developed an oscillatory electric potential and the resulting current (both
having in mind studies in material sciences, but it can be easily magnitude and phase) across the system is measured. The ratio
adapted to the most diverse applications and used is differ- between the amplitudes of the applied electric potential and the
ent operational systems once its dependencies are installed. resulting electric current thus the magnitude of the impedance
The frequency response of simple LRC circuits and, also, |Z| of the system, while the lag between the peaks of electric
the dielectric permittivity of porous alumina samples, were current and the applied potential gives the impedance phase,
measured using the GUI described in this work to illustrate φ. These quantities are absent of any previous assumption
some possible applications. about the system and are valid for any case. When analyzing
a PGCIMAT, Universidade Federal do Rio Grande do Sul, 95070-560 Porto a solid dielectric material, the sample usually consists of a
Alegre – RS, Brazil dielectric slab between the plates of a parallel plate capacitor.
b Universidade de Caxias do Sul, 95070-560 Caxias do Sul – RS, Brazil
A equivalent circuit is then assigned to the system and the
∗ Corresponding author. E-mail adress: giovani.rech@ufrgs.br
corresponding mathematical model thus allows other quantities
Received: 14/03/2018
Accepted: 22/06/2018
to be calculated. For solid samples in such arrangement, very
frequently inductive effects are negligible and the system can
http://dx.doi.org/10.18226/23185279.v6iss2p10 be modeled by an electric circuit consisting of a capacitor and
SCIENTIA CUM INDUSTRIA, V. 6, N. 2, PP. 10 — 14, 2018
-Im{Z}
where ZR is the impedance of the resistor, which is equal
to its electric resistance R, and ZC is the impedance of the
capacitor, given by (jωC)−1 , where j is the imaginary unit,
ω = 2πf is the angular frequency, and C is the capacitance 0 R/2 R
[4, p. 46]. For a parallel plate capacitor, the capacitance is Re{Z}
given by
A A Fig. 1: Schematic Cole-Cole plot for a parallel RC circuit.
C= = r 0 (2)
d d
where is the absolute electric permittivity of the dielectric
material, r is the sample’s relative dielectric permittivity, 0 is and used independently in other python scripts in a modular
the electric constant (0 = 8.854 187 817 × 10−12 F m−1 [5]), fashion. The interface file contains all the visual objects used
A is the area of the capacitor plates, and d is the distance to present the graphical user interface, which uses instances
between the plates of the capacitor. From the above expres- of QtCore and QtGui from the PyQt4 python package [8]
sions, the real (Z 0 ) and imaginary (Z 00 ) parts of the complex to construct the visual objects on screen. When ran using
impedance (1) are given by Python, the script file imports the python interface from the
R interface.py file and binds the buttons from the interface to
Z 0 = Re[Z] = |Z| cos φ = (3) methods in the script. Therefore, if some modification in the
1 + (ωRC)2
software is desired, it should be made in both files.
ωR2 C
Z 00 = Im[Z] = |Z| sin φ = (4) Modifications on the interface can be done directly on
1 + (ωRC)2 the .py file, though using Qt Designer [9] is recomended.
Likewise, the real (0 ) and imaginary (00 ) parts of the The interface was constructed to a .ui file, which is bundled
sample’s complex dielectric permittivity (for a sample modeled with the software files, and later converted to a .py file for
after an equivalent parallel RC circuit) can be written in terms the bindings with the routines. The conversion can be easily
of the measured quantities |Z| and φ as done using the pyuic4 command, included with the PyQt4
package.
(d/A) sin φ
0 = Re[] = (5) The modification of the script file is straightforward as
ω|Z|
is classical python language. The development of the script
(d/A) cos φ
00 = Im[] = (6) was made and tested in a Jupyter notebook [10], [11] and
ω|Z| later copied to a python file. The routines for the equipment
In more complex situations, care should be taken in propos- control uses the PyVisa package [12] to send HP Instrument
ing an equivalent circuit to model the observed behavior [6], BASIC commands to the equipment drive that is required
[7]. While the data of impedance and phase can be used to be installed on the computer, which in turn send the
to derive other physical quantities for any equivalent circuit, signals through a GPIB interface cable to the Keysight 4294A
capacitance, resistance and permittivity given by the IS GUI impedance analyzer. A summary of the software structure is
here described should only be used on the assumption that the presented in figure 2.
parallel RC equivalent circuit is valid.
It is common practice to represent electric impedance data
by means of a Cole-Cole plot, in which the imaginary part of
the electric impedance is plotted against the real component.
For a RC parallel circuit, a semi-circle centered at R /2 on the
Re[Z] axis is expected, as depicted schematically in Fig. 1.
For series association of two (or more) RC parallel circuits,
two (or more) semi-circles are expected in a Cole-Cole plot.
II. S OFTWARE
A. Description and Structure Fig. 2: Schematics of the software.
The software scripts are written in standard Python pro-
gramming language. The entire program is contained in two
python files that must be on the same folder. It was chosen
to break the script in two files in order to make software B. Functionalities
modification easier. The two files, namely script.py and The graphical user interface called ImpedSpec was devel-
interface.py, are responsible for the routines and the oped aiming to communicate with, control, collect, and process
graphical interface, respectively. The former implements the data from a Keysight 4294A precision impedance analyzer.
classes and methods, which means that they can be imported Before an actual measurement is performed, the interface
SCIENTIA CUM INDUSTRIA, V. 6, N. 2, PP. 10 — 14, 2018
allows to set the compensation conditions, which later will be magnitude and phase, by assuming an equivalent circuit and
taken into account to correct for the instrument contribution by knowing the sample’s cross-section area and thickness.
to the overall electric impedance in a process handled by the The current version of the software always assumes a RC
equipment. Two types of compensations can be done, open equivalent circuit and a sample as a dielectric in a parallel plate
and short compensation. The open compensation is done by capacitor. Accordingly, for the experimental determination of
measuring the response of the open circuit, without any sam- the electric permittivity, the sample to be analyzed can be
ple. The short compensation is done by measuring the closed conveniently placed between two parallel metallic plates or
circuit, also without any sample. These two measurements are electrodes as to form a parallel plate capacitor. The area of
later on used to correct for the instrument contribution to the the electrodes and the distance between them are then used in
measured resistance and capacitance of the sample. the computation of the real and imaginary components of the
The interface allows several parameters be defined by the dielectric permittivity (for instance, according to eqs. (5) and
user. The frequency sweep can be configured for up to 600 (6) above).
points linearly or logarithmically distributed between arbitrary
start and end frequencies, which are limited only by the range
III. I LLUSTRATIVE E XAMPLES
allowed by the impedance analyzer, namely from 40 Hz to
110 MHz, in the case of the Keysight 4294A. It is also possible To illustrate the use of ImpedSpec, the software was used
to define a bandwidth factor from 1 to 5, the maximum in the analysis of simple RLC circuits. As an application
amplitude of the electric potential applied to the sample (up to in materials science, the software was used to analyze the
± 42 V) and also to set up to 256 measurements per point, in behavior of the dielectric constant for alumina with different
which case the arithmetic mean is returned. A screenshot of porosities.
the ImpedSpec screen after an actual measurement is shown
in Fig. 3.
A. Electric impedance of simple circuits
For testing purposes, commercially available capacitors,
resistors, and inductors were arranged in different electric
circuits, which were then measured with a Keysight 4294A
precision impedance analyzer, using ImpedSpec. The results,
expressed in the form of Cole-Cole plots, are summarized
in Fig. 4. The Cole-Cole plot for a RC parallel circuit, Fig.
4(a), is a semicircle of radius R/2. Inductors shift the current
phase oppositely to capacitors and, therefore, the imaginary
component of the impedance of LRC circuits exhibits both
positive and negative branches, as seen in figure 4(b). Figure
4(c) shows the two arcs expected for two RC parallel circuits
in series. Finally, Fig. 4(d) shows the Cole-Cole plot for a RC
parallel circuit in series with a capacitor.
Fig. 3: Screenshot of the ImpedSpec graphical user interface
(GUI). 600 1 kΩ
40
500
20
400
-Im{Z}
-Im{Z}
0
Besides the measuring conditions, the user can inform the 300
1 mF
200 20
thickness and diameter of the sample for the calculation of the
100 40
real and imaginary parts of the sample’s electric permittivity. 00.0 0.2 0.4 0.6 0.8 1.0 1.2 0 20 40 60 80 100 120 140 160
The impedance magnitude and phase, which are independent Re{Z} 1e3 Re{Z}
of the sample dimensions, can also be exhibited and saved to (a) (b)
file. The interface assumes the sample is in the form of a thin
1e3
disc, which allows a more uniform surface charge density on 80
100 Ω
2F
1.50
the electrodes. If this is not the case, an equivalent diameter 1.25 60 500 nF
-Im{Z}
0.75 40
equal to that of the actual sample. Besides the impedance mag- 0.50
20
nitude and phase, Cole-Cole and resistance versus capacitance 0.25
0.000.0 00
plots can be represented without any information regarding 0.5 1.0 1.5
Re{Z}
2.0 2.5 3.0
1e3
20 40 60
Re{Z}
80 100 120 140
C. Sample preparation Fig. 4: Cole-Cole plots for some circuits build with com-
The sample’s impedance (both magnitude and phase) can be mercially available capacitors, resistors, and inductors, as
measured without any input regarding the physical dimensions measured with a Keysight 4294A impedance analyzer, using
(cross-section area and thickness) of the sample. The electric ImpedSpec.
permittivity, on the other hand, is calculated from impedance
SCIENTIA CUM INDUSTRIA, V. 6, N. 2, PP. 10 — 14, 2018
IV. I MPACT
ImpedSpec focuses in scientists that struggle in maintaining
a steady workflow due to the lack of a readily available and
Fig. 5: Schematic representation of the experimental assembly easy to use graphical user interface in impedance spectroscopy.
used for impedance spectroscopy analysis of porous alumina This group is larger than one might expect due to some events
samples. in the scientific instruments industry. The 4294A, produced by
Agilent, is a reference equipment and is still very popular
among users of impedance analyzers. This instrument was
B. Dielectric permittivity of porous alumina discontinued when Keysight Technologies bought Agilent and
To exemplify the application of the ImpedSpec to the was replaced by the E4990A. The newer equipment use a
measurement of electric properties of materials, the dielectric different programming language, making all the new software
permittivity of porous alumina samples (α-Al2 O3 , A-1000SG, for control and data acquisition incompatible with the 4294A.
99.8% purity - Almatis Inc. Leetsdale, PA) was measured as This left a gap in the software development for the Agilent
a function of frequency. Silver ink electrodes were painted on equipment, which has no user interface available so far. Our
the flat surfaces of each sample and thin copper wires were work is concerned with helping all the numerous scientists
attached to connect the samples to the impedance analyzer. left with a discontinued equipment that lacks a user-friendly
A schematic representation of the experimental assembly is interface. The same programming language (HP Instrument
shown in Fig. 5. BASIC) is common to other impedance analyzers produced by
The real part of the relative dielectric permittivity (0r ) of Agilent in the same period. By changing the code substituting
three porous alumina samples (5%, 15%, and 35% porosity) the HP Instrument BASIC commands by other equipment
is presented in Fig. 6, for frequencies (f = ω/2π) in the communication language, our interface can be readily modified
range from 40 Hz to 108 Hz as calculated by the program, as to be used with other impedance analyzers besides the 4294A.
calculated assuming a parallel RC equivalent circuit. Having the collected data readily available in the computer
right after an analysis is not just very convenient, but also a
requirement for maintaining a good workflow in the scientific
60 progress.
35% 15% 5%
r
50 11
Relative dielectric permittivity,
10 V. C ONCLUSION
9
40 The graphical user interface ImpedSpec allows the control of
8
experiments and data acquisition for impedance spectroscopy
r
7
30 6 analysis of electric circuits and dielectric materials. Notwith-
5 standing that this GUI has been explicitly developed having
20 45
10 106 107 in mind a Keysight 4294A impedance analyzer, ImpedSpec
Frequency (Hz)
can be adapted for use with other IS instruments by any
10
user with basic programming skills, given that the scripts
0 102 are open source and thus can be readily modified accord-
103 104 105 106 107 108 ing to specific needs. The software files are available on
Frequency (Hz)
github.com/giovanirech/impedspec
Fig. 6: Effect of porosity (5%, 15%, and 35% porosity) on the
frequency dependency of the real part of the relative dielectric ACKNOWLEDGEMENTS
permittivity of alumina.
The support from the Brazilian agencies Conselho Nacional
de Desenvolvimento Cientı́fico e Tecnológico (CNPq) - grant
For the 5% porosity alumina sample, the measured real part 304831/2014-0 (CAP), Coordenação de Aperfeiçoamento de
of the relative dielectric permittivity, around 10.5, is almost Pessoal de Nı́vel Superior (CAPES), Secretaria de Desenvolvi-
frequency-independent, and is in very good agreement with mento Econômico, Ciência e Tecnologia do Estado do Rio
the literature (see, for instance, Ref. [13, p. 83]). As the Grande do Sul (SDECT/RS), Programa de Apoio a Núcleos de
porosity increases, the high-frequency real part of the relative Excelência (PRONEX), and Fundação de Amparo à Pesquisa
dielectric permittivity decreases, as expected [14], [15]. The do Estado do Rio Grande do Sul (FAPERGS) is gratefully
dielectric permittivity, however, does not exhibit a well defined acknowledged. Thanks are also due to Matheos H. Birck
trend with porosity at the low frequency end of the spectrum, for his collaboration in the early stages of this work, Janete
increasing from the 5% porosity sample to that of 35% and, E. Zorzi and Eduardo Thomazi for the samples of porous
finally, 15% porosity. This is most probably due to different alumina, and the staff of the Instituto de Materiais Cerâmicos
moisture content in the 15% and 35% porosity samples, as it at the Universidade de Caxias do Sul.
SCIENTIA CUM INDUSTRIA, V. 6, N. 2, PP. 10 — 14, 2018
VI. B IBLIOGRAPHY
[1] E. Barsoukov and J.R. Macdonald, Impedance Spectroscopy: Theory,
Experiment, and Applications, John Wiley & Sons, 2 edition, 2005.
[2] Agilent Technologies Japan, Ltd., Kobe Instrument Division, Agilent
4294A Precision Impedance Analyzer Operation Manual, Keysight
Technologies, 1-3-2, Murotani, Nishi-Ku, Kobe-shi, Hyogo, 651-2241
Japan, 7 edition, Feb 2013.
[3] Andrew K Jonscher, “Dielectric relaxation in solids,” J. Phys. D: Appl.
Phys., vol. 32, no. 14, pp. R57, 1999.
[4] P. Horowitz and W. Hill, The Art of Electronics, Cambridge University
Press, 2015.
[5] Peter J. Mohr, David B. Newell, and Barry N. Taylor, “Codata
recommended values of the fundamental physical constants: 2014,” J.
Phys. Chem. Ref. Data, vol. 45, no. 4, pp. 043102, 2016.
[6] Miguel A. Hernández, Nahum Masó, and Anthony R. West, “On the
correct choice of equivalent circuit for fitting bulk impedance data of
ionic/electronic conductors,” Appl. Phys. Letters, vol. 108, no. 15, pp.
152901, 2016.
[7] P.Q. Mantas, “Dielectric response of materials: extension to the Debye
model,” J. Eur. Ceram. Soc., vol. 19, no. 12, pp. 2079–2086, 1999.
[8] “Pyqt4 reference guide,” 2016.
[9] “Qt documentation,” 2017.
[10] Thomas Kluyver, Benjamin Ragan-Kelley, Fernando Pérez, Brian E
Granger, Matthias Bussonnier, Jonathan Frederic, Kyle Kelley, Jessica B
Hamrick, Jason Grout, Sylvain Corlay, et al., “Jupyter notebooks -
a publishing format for reproducible computational workflows,” in
Positioning and Power in Academic Publishing: Players, Agents and
Agendas, 2016, pp. 87–90.
[11] Helen Shen, “Interactive Notebooks: Sharing the Code,” Nature, vol.
515, pp. 151–152, 2014.
[12] “Pyvisa documentation,” 2017.
[13] W.H. Gitzen, Alumina as a Ceramic Material, Wiley, 1970.
[14] D. Gershon, J. P. Calame, and A. Birnboim, “Complex permittivity
measurements and mixing laws of porous alumina,” J. Appl. Phys., vol.
89, no. 12, pp. 8117–8120, 2001.
[15] Xing-Da Liu, Zhi-Ling Hou, Bao-Xun Zhang, Ke-Tao Zhan, Peng He,
Kai-Lun Zhang, and Wei-Li Song, “A general model of dielectric
constant for porous materials,” Applied Physics Letters, vol. 108, no.
10, pp. 102902, 2016.
[16] T A Belyaeva, P P Bobrov, E S Kroshka, A S Lapina, and O V
Rodionova, “The effect of very low water content on the complex
dielectric permittivity of clays, sand-clay and sand rocks,” Meas. Sci.
Technol., vol. 28, no. 1, pp. 014005, 2017.