Construction of a Potentiostat to Perform Electrochemical Impedance Spectroscopy ( EIS ) Tests

In this work, it was developed the construction of a potentiostat for the execution of Electrochemical Impedance Spectroscopy (EIS) experiments, using an Agilent 33220a signal generator, a RIGOL 1064b oscilloscope and a protoboard for the connection of operational amplifiers to an electrochemical cell. The coordination of the global operation, in addition to data acquisition, was performed using a code generated in the LabVIEW program. The system analyzed was the corrosion of an 1100 aluminum plate in water, in order to compare the results obtained by other authors. The data acquisition consisted in obtaining the values of amplitude, RMS voltage and phase angle between the generated power signals and the current output, in order to obtain the impedance of the system, for different signal frequencies. Finally, the values obtained were plotted on a Nyquist diagram. In this way, the objective of this article is to demonstrate that with conventional laboratory equipment it is possible to implement an experimental device, capable of delivering results similar to those obtained by commercial equipment.


Introduction
Electrochemical Impedance Spectroscopy (EIS) is a relatively new and powerful method for characterizing many of the electrical properties of materials and conductors.It can be used to investigate the dynamics of an electrode, the mobile load of solutions or interfacial regions of any electrode, whether solid or liq-uid, and even insulators [1].
The most common approach for the development of this technique is to measure the impedance of an electrochemical system by applying a single frequency alternating voltage to the interface.And thus, the system responds with a phase shift and amplitude between the applied voltage and the resulting current.This result is visualized in its real and imaginary components [2].There is a wide variety of commercial equipment to measure impedance as a function of frequency, in intervals of approximately 1 mHz to 80 MHz [3].
The input of a voltage will be given by the expression: , where V 0 is the maximum amplitude of the voltage, and ω the frequency in rad/s.In a similar way to an electric circuit containing combinations of resistances and capacitances, the electrochemical solution can be represented.The circulating current in the cell can be described by the following expression: ( ) where φ is the phase angle between the input voltage and the response.The electrochemical phenomena that occur in the systems will be represented by either resistors, capacitors and/or coils.This equivalent representation is known as the Randles Cell [4].
The Electrochemical Impedance Spectroscopy (EIS) studies allow a wide characterization of various electrochemical systems.Its main applications are: [5]  The determination of surface quality of the electrolytic deposits, because EIS tests are very sensitive to the conditions of the deposit. Quantification of deterioration of electrode surfaces, EIS tests are applied without the need to conduct a destructive test, such as the salt fog chamber or weight loss over time. Obtaining results in short periods of time.
 Allows the determination of reaction mechanisms in the obtaining of metals by electro deposits.However, EIS tests also have a number of disadvantages compared to the most commonly used electrochemical techniques, such as linear or cyclic voltammetry: [5]  Equipment is expensive.
 Requires data analysis in the complex plane.

 Requires complicated data analysis.
It is for these reasons that this work will show the fundamental principles and methodology applied to construct a potentiostat from an Agilent 33220a Signal Generator and a Rigol DS 1064b Oscilloscope, which will be used to characterize the corrosion of an aluminum plate in raw water.This allows obtaining an image of the components in real and imaginary impedance between the voltage and the current, as well as of the phase difference between both signals for different frequencies, which allows the determination of adsorption mechanisms and/or formation of films on the surface of the electrode.
The potentiostats used to develop these kinds of tests can reach values of 7.000 Modern Instrumentation from any instrumentation laboratory and the fundamental principles of operation, it is possible to obtain very similar results with lower costs.

Experimental Development
Figure 2 shows the conventional configuration for most of the electrochemical tests available: In Figure 2 (up), the potentiostat is configured through a computer with a special software capable of doing the data acquisition tasks, and the initial data.This includes the input signal, frequency, amplitude, time, etc.The general flow diagram for the complete process is shown in the same Figure 2 (down).The main stages during the performance of the potentiostat are the followings: tension adjustment, potentiostat function, and data acquisition through the A/D converter [8].
The main functionalities of a potentiostat are: a) driving the sensor electrodes with the desired signal, ensuring that this voltage remains invariable and supplies the current necessary for the electrochemical reaction, and b) be able to extract an output signal, which is the measuring of the current flowing through the electrochemical cell [9].
For this work, the potentiostat will be replaced with conventional equipment from the instrumentation laboratory.In this case, a signal generator, an oscilloscope and a protoboard with operational amplifiers will be used.

Experimental Development
The overall process for the proposed work is shown schematically in  It is possible to see in Figure 5 the characteristics of the generated signal, in this case, with frequency of 1000 Hz, sinusoidal form, amplitude of 1 V (peak to peak) and offset of 0 V.This is the standard code for controlling the Agilent 33220a signal generator available in the labview database, and it will be modified to work together with the oscilloscope.The operation of the signal generator and the oscilloscope was coordinated by using the code generated in the Labview program, version v16, so that the generation of the input signal and the acquisition of data at the output are performed simultaneously.To achieve this goal, a state machine was developed, based on the codes shown in Figure 5 and Figure 6.
State machines are a method of modeling systems, whose output depends on the entire history of their inputs, and not just the most recent one.Compared to purely functional systems, where the output is purely determined by the input, the state machines have a performance determined by previous states.State machines can be used to model a wide variety of systems, in this case, the acquisition of 2 signals simultaneously and their subsequent processing [12].The implemented states of the state machine, allow organizing a sequence of actions to be performed for the operation of the potentiostat.In this case, the connection and configuration of the equipment, the emission of signals, the acquisition of these during the tests, the generation of a file with the data collected for later analysis and the disconnection of the equipment involved.The use of the state machine logic for the development of this work is due to the fact that the codes for issuing and acquiring 2 signals simultaneously of Figure 4 and Figure 5 respectively, must follow flowchart logic.This allows simplification and to coordinate separately the main parts of these previous codes in finite states, which also allows adding more actions to execute thanks to the insertion of more states, such as the acquisition of data and its subsequent storage in a file for their future analysis.
The code created to accomplish the task is explained in the following flow Chart 1: For the study and comparison of 2 sinusoidal signals, it is necessary the synchronization and execution of different tasks in due time, this is why the separation of the different tasks in each state is necessary for the correct operating of the potentiostat.For this reason, this state machine was defined to have 4 different states: Initialize, Set Data, Store Data and Shut Down.
Figure 7 shows the state machine in the "Initialize" state.It connects and configures the oscilloscope and data acquisition, in addition to creating a new text file for the storage of the data to be collected for each test.For the DAQ, 2 channels were configured to receive the information for further processing.
Figure 8 shows the "Set Data" state, In addition, the module "Multiple Waveforms" was added, in order to process information related to the 2 acquired signals.In this case, the "phase" [13] window was added, which determines the phase shift between the two signals, for the subsequent plotting of the electrochemical diagrams.
Figure 9 shows the state machine in its "Store Data" state, which is responsible for calculating data characteristic of the signals, as well as storing it in a text Chart 1. Sequence of steps followed by the state machine proposed.file.In this last one, it is possible to see that the information stored by the program is processed in the module "Amplitude and Level Measurements", and later stored in this text document.
In Figure 10, the "Shut Down" state is displayed, which performs the task of disconnecting the equipment, then completes the execution of the state machine, closes the generated text file with the acquired data and ends the code.
On the other hand, the front panel of the VI implemented is appreciated in Figure 11, which has the configuration functions, both of the oscilloscope and the signal generator, in order to generate different types of signals, at different frequencies and amplitudes.As for the oscilloscope, it is possible to configure the measuring range, as well as to select the channels to be measured.
The schematic configuration used to connect the potentiostat is shown in Figure 12.This arrangement is made of 3 unitary gain operational amplifiers, which fulfill different functions:  The function of the control amplifier is to compare the voltage of the measured cell to the desired voltage and direct the current to the cell to force the input and measured voltages to be equal. The voltage follower measures the voltage difference between the reference and working electrodes.Its output has two main functions: it is the feedback signal in the potentiostat circuit, and it is the signal that is measured each time the cell voltage is needed. The current-to-voltage converter allows the output current to be determined by applying ohm's law.When passing through a current measuring resistor R f , the voltage drop across the latter is a measure of the current of the cell.
The electrochemical cell was designed using 3 electrodes: work, which was

Results
The following figure shows the types of results obtained in the experiences developed: In Figure 13, the results obtained on the oscilloscope are shown for the input and output signals.The current at the output is obtained through the use of the transimpedance amplifier connected to the working electrode, which, by means of ohm's law, allows obtaining the current signal of the system.
Once the data was obtained, the amplitude, RMS voltage and phase shift of both signals were obtained, the value of the system impedance was obtained for frequency values between 100,000 and 1,000,000 Hz.The formula for obtaining the impedance was as follows: ( ) ( ) where Z 0 represents the maximum value of the impedance and θ is the phase difference between the voltage and current signals.
In this way, the values of the real and imaginary component of the impedance were obtained, which were plotted in Cartesian axes "x" and "y", respectively, in order to construct the Nyquist diagram of the system.The obtained results are shown in Figure 14.shows the existence of an additional resistance in the system, due to the distance between the auxiliary electrode and the working electrode, equivalent to 25 kΩ/cm 2 .Besides, another important parameter that can be obtained from this diagram is the capacitance of the Electrochemical Double Layer (EDL).This is calculated from the maximum value of imaginary impedance and the frequency of the sinusoidal wave.For this case, with 1 cm 2 surface: Which is in the range of values obtained in other works [16].

Conclusions
The values obtained from the Nyquist diagram allow the following conclusions:  The coordination of the operation for the equipment used and the data acquisition was carried out successfully using the code generated in Labview. The information provided by the code in Labview, allowed determining the impedance values of the system under study, for signals with different frequencies. The potentiostat, built from the signal generator and the oscilloscope, enables impedance testing in a similar way to commercial potentiostats.

Figure 6
Figure 6 shows the code used for the operation of the RIGOL DS1064b oscilloscope.Again, this is the code available in the labview database.It allows the acquisition of 2 signals at the same time, with amplitude (vertical range) of 1V and a minimum time scale (time base) of 0.0005 s.The data obtained is stored in the "Multiple Waveforms" module.

Figure 5 .
Figure 5. Labview code to generate a wave signal from the Agilent 33220a signal generator.

Figure 6 .
Figure 6.Labview code to graphically display 2 simultaneous wave signals from the RIGOL DS1064b oscilloscope.

Figure 12 .
Figure 12.Schematic diagram of the circuit used and configuration used for the development of EIS tests, mounted on a protoboard[14].

From
Figure 13.(Left) Protoboard connection made for the development of experiences and configuration of 3 electrodes used.(Right) Signals corresponding to input (red) and output (white) voltages of the system.