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 liquid, and even insulators  .
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  . 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  .
The input of a voltage will be given by the expression: , where V0 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:#Math_3#, 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  .
The Electrochemical Impedance Spectroscopy (EIS) studies allow a wide characterization of various electrochemical systems. Its main applications are: 
ü 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: 
ü 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 - 8.000 US$  . The goal of this article is to show that, using conventional gear
Figure 1. Nyquist diagram for an electrochemical system, with its corresponding equivalent circuit (Randles cell)   .
from any instrumentation laboratory and the fundamental principles of operation, it is possible to obtain very similar results with lower costs.
2. 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  .
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  .
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.
3. Experimental Development
The overall process for the proposed work is shown schematically in Figure 3:
In Figure 3, the components used during the development of the tests and their interconnection between them are shown. The particular function of each of them is detailed below:
1) PC-Labview Interface: Once the components are installed, the operational parameters to be used are assigned into the interface created using the Labview
Figure 2. (up) Conventional potentiostat configuration for development essays  . (down) General flow diagram for the operation of a potentiostat  .
Figure 3. Overall diagram of the performed process.
software. This program allows the integration of different types of equipment, so that different types of data can be acquired and displayed quickly. This is done through a graphical programming syntax that reduces programming time. This simplifies the development of complex systems.
2) Signal generator: A signal generator is an instrument that provides electrical signals. In particular, it is used to obtain periodic signals, since the voltage varies periodically in time, controlling its period and its amplitude. Typically, it generates signals of square, triangular and sinusoidal forms. The last one was used in this experience.
3) Oscilloscope: It allows visualizing electrical voltages varying in time. When a voltage signal is applied to the input terminal of the oscilloscope, the display will show a graphical representation of the voltage as a function of time. The oscilloscope not only allows to visualize the signal, but also to measure its period, amplitude and, fundamental for the development of this experience, to determine the phase between the input and output signals to the protoboard.
4) Protoboard: The protoboard are small boards with perforations throughout its area, in which were placed operational amplifiers, which allow making measurements in the electrochemical cell.
5) Electrochemical cell: The electrochemical cell represents the working system to be characterized, which consists of 3 electrodes. The first is the auxiliary electrode, which is the input of the sine wave of the signal generator. The reference electrode, which allows measurements of voltage in the cell, and the working electrode, which is the material to be characterized in the working solution.
The equipment used for the construction of the potentiostat is shown in Figure 4:
Figure 4 shows the Agilent 33220a signal generator (right side), which, for this experiment, should emit sinusoidal signals, not exceeding 50 mV of amplitude, to ensure that the system in study obeys Ohm’s law. The RIGOL 1064b oscilloscope (left side), acquires the signals of input and output of the electrochemical circuit for its later processing.
The Agilent 33220a signal generatoruse modern signal generation technology based on DDS. For sinewave outputs, the 33250a offers 10 Vpp up to 80 MHz, and 4 Vpp up to 120 MHz. For square wave outputs, the 33250a offers 10 Vpp up to 80 MHz  .
The RIGOL 1064b oscilloscope series can process dual or four analog channels inconnection with an external trigger channel, and it is capable to capture multiple signals. The instrument is designed for 2GSa/s maximum real-time sample
Figure 4. Equipment used for the construction of potentiostat. (left) RIGOL 1064b oscilloscope. (right) Agilent 33220a signal generator.
rate, 50 GSa/s maximum equivalent sample rate and 200MHz maximum bandwidth. Besides, abundant trigger modes, math and acquire functions enable it easy to capture and analyze waveforms  .
For both hardware to work in a coordinated way, a code was developed in LabVIEW that allows the subsequent acquisition and processing of the mentioned signals. In the following figures are shown the codes used to organize their operation.
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.
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. Labview code to generate a wave signal from the Agilent 33220a signal generator.
Figure 6. Labview code to graphically display 2 simultaneous wave signals from the RIGOL DS1064b oscilloscope.
For the development of EIS tests, it is necessary to consider the measurement of 2 signals: input and output to the protoboard. For this reason, the code shows the presence of 2 signals reaching the oscilloscope, channels A and B.
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  .
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”  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.
Figure 7. State machine generated in Labview, starting state “Initialize”.
Figure 8. State machine, “Set Data” state.
Figure 9. State machine, “Store Data” state.
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:
v 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.
v 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.
v The current-to-voltage converter allows the output current to be determined by applying ohm’s law. When passing through a current measuring resistor Rf, 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
Figure 10. State machine, “Shut Down” state.
Figure 11. VI front panel.
Figure 12. Schematic diagram of the circuit used and configuration used for the development of EIS tests, mounted on a protoboard  .
aluminum 1100; Reference, which was copper-copper sulphate, and auxiliary, in this case, platinum. The configuration is shown in Figure 13.
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 Z0 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.
From the above figures, it is possible to see the characteristic form of the Nyquist diagram proposed for these electrochemical systems. The obtained charac
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.
Figure 14. (Left) Nyquist diagram obtained for the aluminum―raw water system. (Right) Results obtained for works performed under similar conditions  .
teristic curve is similar to the curve shown in Figure 14 (right), for a 1100 aluminum plate, with respect to the imaginary component of the impedance. The main difference between them lies in the existence of an impedance at high frequencies, as shown in the Nyquist diagram, Figure 1, and Figure 14 (left), which 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Ω/cm2. 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 cm2 surface:
Which is in the range of values obtained in other works  .
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.
The authors are grateful for the support provided by the University of Santiago, Chile (USACH) through their academic license for Labview.