A USB-controlled potentiostat/galvanostat for thin-film battery characterization
Thomas Dobbelaere



Supplementary material available online: <cit.>

thomas.dobbelaere@ugent.be
Department of Solid State Sciences, Ghent University, Belgium 



This paper describes the design of a low-cost USB-controlled potentiostat/galvanostat which can measure or apply potentials in the range of ±8V, and measure or apply currents ranging from nanoamps to max. ±25 mA. Precision is excellent thanks to the on-board 20-bit D/A-convertor and 22-bit A/D-convertors. The dual control modes and its wide potential range make it especially suitable for battery characterization. As an example use case, measurements are presented on a lithium-ion test cell using thin-film anatase TiO2 as the working electrode. A cross-platform Python program may be used to run electrochemical experiments within an easy-to-use graphical user interface. Designed with an open hardware philosophy and using open-source tools, all the details of the project (including the schematic, PCB design, microcontroller firmware, and host computer software) are freely available, making custom modifications of the design straightforward.


A USB-controlled potentiostat/galvanostat for thin-film battery characterization
    Thomas Dobbelaere
    December 30, 2023
================================================================================





§ INTRODUCTION




 §.§ Potentiostat basics


The potentiostat is an essential tool in electrochemical research. It allows the experimenter to apply a potential to a system (i.e. an electrochemical cell) and measure the resulting current, or vice versa. The unique property of the potentiostat – the thing that differentiates it from a simple combination of an adjustable voltage source and an ammeter – is that it can do so while keeping the path where the current flows separate from the path where the potential is measured. This is necessary in electrochemical cells because potentials are usually measured against a “reference electrode” which only provides an accurate and stable potential in equilibrium conditions, i.e. when it is not disturbed by any current flow. Using two terminals for current flow and two others for potential sensing, a total of four electrode connections are needed; they are usually named as follows:



  * Working electrode (abbreviation: WE)

  * Counter electrode (abbreviation: CE)

  * Sense electrode (abbreviation: SE)

  * Reference electrode (abbreviation: RE)

In a four-electrode connection scheme, the potential is measured (and no current flows) between SE and RE, and current is applied (regardless of the voltage drop) between WE and CE.[It should be noted that the potentiostat is functionally equivalent to a source-measure unit with separate force/sense lines, with the WE/CE pair corresponding to the “force” connections and the SE/RE pair corresponding to the “sense” connections.]

In most electrochemical cells, the SE and WE are tied together (and still referred to as WE), resulting in a three-electrode connection scheme: the potential is measured between WE and RE, and current flows between WE and CE. This is illustrated in Figure <ref>. Using this scheme, one would naively assume that it is impossible to control the potential; as there is zero current flow, the potential can only be measured and not forced to a certain value.



The potentiostat can, however, apply current between WE and CE, which in turn influences the potential between WE and RE; thereby, using a feedback loop, any desired potential between WE and RE can be achieved by applying whatever current is necessary between WE and CE. This control mode is called the “potentiostatic mode”: it allows the user to set a desired potential, and the potentiostat will try to reach that potential by adjusting the current.



Alternatively, it is often useful to have control over the current instead (i.e. allowing the user to set a desired current, no matter what the resulting potential may be); this is called the “galvanostatic mode”. The presented circuit elegantly combines both of these modes by making it possible to switch the feedback path between the potentiostatic and the galvanostatic modes, as shown in Figure <ref>. On a basic level, the circuit operates as follows:




  * A digital-to-analog convertor (DAC) outputs an electrical signal representing either the desired potential (in the potentiostatic mode) or the desired current (in the galvanostatic mode).

  * An operational amplifier compares this to the measured potential (in the potentiostatic mode) or the measured current (in the galvanostatic mode), and drives current into the CE until the measured value equals the DAC setpoint.

  * Both the measured potential and the measured current are fed into an analog-to-digital convertor (ADC) for data acquisition purposes.




 §.§ Comparison to previously published designs


Although a number of similar open source, “do-it-yourself” potentiostat designs have recently been published <cit.>, these designs are not suitable for battery characterization. The Friedman et al. design <cit.> does not allow the working electrode potential to be scanned (it can only be adjusted to a fixed value in hardware), limiting its use to chronoamperometry (i.e. recording the working electrode current as a function of time). The CheapStat <cit.> supports a number of electrochemical techniques including cyclic voltammetry, but its potential range is limited to ±1 V. The DStat <cit.> improves upon the CheapStat in several ways, and has impressive low-current capabilities, but it is still limited to a potential range of ±1.5 V. Although these potential ranges are wide enough for many aqueous electrochemistry experiments, they are insufficient for e.g. lithium-ion batteries which can reach cell potentials over 4 V. The potential range of the design described in this paper is ±8 V.

Another highly desirable feature for battery characterization is the inclusion of a galvanostatic mode. The aforementioned designs implement the “adder potentiostat” topology <cit.> which only provides potentiostatic control. The presented design has a different topology which enables switching between potentiostatic control and galvanostatic control with a single (digitally controlled) switch.



 §.§ Comparison to commercial instruments

While there are plenty of commercial instruments which can be bought from manufacturers such as Metrohm Autolab, Bio-Logic, Gamry, Ivium Technologies, CHI, Pine Research, Admiral Instruments, etc. to fulfill the same purpose, including models which provide wider current ranges, higher sample rates, and more measurement techniques (e.g. including impedance spectroscopy), the price of these instruments generally ranges from $2000 up to $20000 and more. To the author's best knowledge, the lowest-cost commercial instrument which could substitute for the presented design is the Squidstat Solo, sold by Admiral Instruments for a retail price of $1900 <cit.>. While it has a higher sample rate (1 ms/sample, versus 90 ms for the presented design), a slightly higher potential range (±10V versus ±8V) and similar current ranges (±3 A to ±25 mA versus ±2 A to ±20 mA), it has worse potential and current resolution (16-bit versus 22-bit), it is approx. 20 times more expensive, and its hardware and software cannot be freely modified.



§ THE HARDWARE



 §.§ Circuit description

An annotated schematic diagram of the device is shown in Figure <ref>. It consists of several subcircuits, which are discussed below.





  §.§.§ Power supply

In order to be able to apply cell voltages between -8 V and +8 V, the analog circuitry needs dual power supply rails which supply at least these voltages (plus some overhead). The required current is fairly low; the cell current will not exceed 25 mA, and the quiescent current of the analog circuitry is in the order of a few mA. To eliminate the inconvenience of needing an external power supply, the supply is generated internally from the +5 V line provided by the USB bus. This is achieved by a charge pump[The choice of a charge pump rather than a switched-mode power supply simplifies the design and eliminates inductors or transformers, which may emit undesirable electromagnetic noise.] consisting of U1 (an LM2662 switched-capacitor voltage convertor) and its associated circuitry. The switching action of U1 drives both a positive voltage doubler network (C2, C3, C4 and D1) and an inverting voltage doubler network (C5, C6, C7 and D2); this results in supply rails of ±10 V, minus the forward voltage losses of the diodes. These losses are minimized by choosing Schottky-type diodes such as the BAT721S, which conveniently houses two of them in a single package. The result is approx. ±9 V. Ceramic capacitors are recommended for C2–C8; their low ESR results in low ripple, they do not degrade over time like electrolytics, and the required 10 F capacities are nowadays inexpensively available.



  §.§.§ Analog circuitry

The analog circuitry is implemented using OPAx192 operational amplifiers. These relatively new op-amps from Texas Instruments <cit.> are high-precision, low offset voltage, low bias current, low-noise devices which have a wide supply voltage, rail-to-rail inputs and outputs, and a rather high output current. They closely approximate ideal op-amp behaviour, making them highly suitable for a measurement circuit like this where DC precision is of the utmost importance.

The core of the circuit is the control amplifier, U7A. It compares the voltage set by the DAC output to either the potentiostatic or the galvanostatic feedback voltage, and drives the working electrode of the cell until they are equal. To prevent oscillation, its bandwidth is limited by R5 and C24. The present component values yield a –3 dB frequency of approx. 3 kHz, which is still much faster than the typical measurement timescale. An additional “snubber”-type network consisting of R4 and C25 on its output pin increases stability towards capacitive loads. The cell switch K1 allows the electrochemical cell to be connected (this will later be referred to as the “” state) or disconnected (“”) from the output of U7A; in its disconnected state, the cell is not driven, but may still be measured.

Potentiostatic feedback is acquired through U7B, U7C, and U7D. U7B and U7D are unity-gain buffers which present very high input impedances on respectively the sense electrode and the reference electrode, satisfying the requirement of having nearly zero current flow between SE and RE.[The OPAx192 has a typical input impedance of 10^13 and a typical input bias current of 5 pA <cit.>. Using e.g. a reference electrode with an impedance of 10 k, this results in an error voltage of 50 nV – an insignificant quantity.] The buffered voltages are then fed into U7C, which is configured as a differential amplifier by means of R6–R9. This amplifier implements the following operation:

    V_MEAS=V_REF+(V_SE-V_RE)×(R7/R6) 
       (for R8=R6, R9=R7)


With V_REF=2.500 V, R7=75.0 k and R6=240 k, potential differences between SE and RE ranging from  to  are linearly scaled to output voltages V_MEAS ranging from 0 V to +5 V. In this way, the signal spans the same range as the DAC output (allowing it to be used as a feedback signal) and the ADC input (allowing it to be measured).

Galvanostatic feedback is acquired by making use of the shunt resistors R10, R11 or R12 to convert the CE current into a voltage (selectable by the ranging relays K2–K4), multiplying this voltage by a factor of exactly 10 through the non-inverting amplifier U9A, and summing this voltage with V_REF using U9B. In the highest current range, a range of –25 mA → +25 mA is mapped linearly to the range of 0 → +5V, which is again suitable as a feedback signal and for acquisition by the ADC. The lower current ranges are respectively 100 times and 10 000 times more sensitive, resulting in ranges of resp. ±250 A and ±2.5 A.

The potentiostatic and galvanostatic feedback signals (labelled  and ) lead into the “normally closed” and “normally open” terminals of U8, a DG449 analog switch. When  is low, the control amplifier receives the potentiostatic feedback signal; when high, it receives galvanostatic feedback. In this way, the circuit can quickly switch between the potentiostatic and galvanostatic control modes.



  §.§.§ A/D conversion

The  and  signals are connected to U4 and U5, which are MCP3550 A/D convertors, for data acquisition. The MCP3550 is a 22-bit delta-sigma ADC which offers high accuracy and low noise; in particular, it strongly rejects line noise at either 50 Hz (using the MCP3550-50 model) or 60 Hz (using the MCP3550-60 model) <cit.>. This is highly desirable because it eliminates what is often the most important noise source in many lab environments; however, this comes at the cost of a fairly limited conversion rate of max. 12.5 samples/s. If faster conversion would be required, it could be directly replaced by the MCP3553 which samples at 60 samples/s but lacks the line noise filter. The inputs to the ADCs are additionally low-pass filtered by R1/C13 and R3/C15 to remove high-frequency switching noise; the present component values yield roll-off frequencies of approx. 1.6 kHz, well below the delta-sigma modulator’s oversampling rate of 25600 samples/s (corresponding to a Nyquist frequency of 12.8 kHz) <cit.>.

With 22-bit resolution, the potential is measured with a granularity of 3.8 V. In the most sensitive current range, current is measured with a granularity of 1.2 pA; this figure increases to resp. 120 pA and 12 nA for the higher ranges.



  §.§.§ D/A conversion and voltage reference

The control amplifier receives its “setpoint” voltage from U6, a DAC1220 digital-to-analog convertor. The DAC1220 is a 20-bit delta-sigma DAC which is inherently linear and contains an on-chip calibration function <cit.>. It receives its +2.500 V reference voltage V_REF (as do U4, U5 and the analog circuitry) from U3, an ADR421 voltage reference using XFET technology for low noise, high accuracy (∼0.1%), and high stability <cit.>.

The 20-bit DAC resolution results in potential control with a granularity of 15.3 V, or in current control with granularities of 4.8 pA, 480 pA or 48 nA, depending on the current range.





  §.§.§ Digital control

The device connects to a host computer by an on-board USB interface. This function is implemented by U2, a PIC16F1459 microcontroller which has built-in USB capabilities and provides a sufficiently large number of general-purpose input/output pins for relay switching and SPI communication <cit.>. Its function is to receive commands from the host computer through USB, which may instruct it to either toggle a pin, read from the ADC, or set the DAC. It communicates with the ADC or DAC through a software-implemented SPI interface, and in case of a DAC read, it then sends back the acquired data to the host computer.

Status LEDs D3 and D4 provide some basic status indication. D3 provides the “” indication; when D3 is illuminated, the cell is connected to the control amplifier. D4 is a dual-color LED which provides power-on and mode indication; it lights up green when the circuit is in the potentiostatic mode, and orange when it is in the galvanostatic mode.



 §.§ PCB design

A compact, double-sided printed circuit board design was made in KiCad <cit.>. The design files are available in the supplementary material <cit.>, and a 3D rendering of the (populated and unpopulated) board is shown in Figure <ref>. The board is most easily fabricated by sending it off to a PCB prototyping service. Assembly can be carried out by either reflow soldering or hand-soldering.

Due to the small size of the PCB (approx. 5×5 cm), it may easily be put in a small enclosure, e.g. a mint tin, provided some openings are made to allow the mini-USB connection and the cell connection cables to pass through.

A bill of materials and a fabrication diagram (showing a top view of the PCB superimposed with the component values) may be found in the supplementary material <cit.> to aid component ordering and circuit assembly. The total cost of the device, including the components and a manufactured PCB, is well below $100. A photograph of the finished device is shown in Figure <ref>.





 §.§ Microcontroller firmware

The microcontroller firmware including the source code and a compiled .hex image may be found in the supplementary material <cit.>. Compilation and usage instructions may be found in the sections below.



  §.§.§ Compilation

The source code is written in the C programming language and can be compiled using the Microchip MPLAB XC8 compiler. The provided Makefile allows easy compilation because it automatically provides the compiler with the necessary flags and include paths. On a Linux system, simply running the command  will compile and link everything and produce the output file .



  §.§.§ Raw USB communication

The microcontroller firmware makes use of Signal 11's “M-stack” open-source USB stack <cit.> to implement communication through raw USB bulk transfers. Commands are received as ASCII strings on EP1 OUT, are executed, and a reply is sent on EP1 IN. The following commands are supported:


  * “”, “” 
 Connects or disconnects the cell to the output of the control amplifier.

  * “”, “” 
 Switches between potentiostatic or galvanostatic control modes.

  * “” (where  = “”, “”, or “”) 
 Switches between current ranges; range 1 is the highest (least sensitive) current range, increasing range numbers yield lower (more sensitive) ranges.

  * “” ( = one byte of data)
 Sets the DAC output code (three bytes).

  * “” 
 Performs an automatic DAC calibration.

  * “” ( = one byte of data)
 Sets the DAC calibration data; the first three bytes are proportional to the offset, the latter three bytes are proportional to the gain <cit.>.

  * “”
 Returns six bytes, representing the current DAC calibration in the same format as above.

  * “” 
 Reads the potential and current from the ADCs, and returns six bytes if a previous conversion has finished. The first three bytes represent the potential ADC value, the latter three bytes represent the current ADC value. If a conversion is still ongoing, it returns the string “” instead.

  * “” ( = one byte of data)
 Saves six bytes to internal flash memory; these are used for potential/current offset removal.

  * “” 
 Retrieves the corresponding six bytes from internal flash memory and returns them.

  * “” ( = one byte of data)
 Saves six bytes to internal flash memory; these are used for fine-tuning the three current shunt resistors.

  * “” 
 Retrieves the corresponding six bytes from internal flash memory and returns them.

The host computer communicates with the potentiostat using a generic driver provided by the cross-platform libusb library <cit.>.





§ THE SOFTWARE

A user-friendly GUI application allows the experimenter to easily perform typical electrochemical measurements. The program can be found in the supplementary material <cit.> and is written in Python 3. In addition to a working installation of Python, it requires NumPy <cit.> and SciPy <cit.> for data processing, PyUSB <cit.> for USB communication, PyQt <cit.> to provide the GUI, and PyQtGraph <cit.> for real-time plotting. These packages are freely available, and may be easily installed from the system software repositories on most Linux distributions. On Windows and Mac, it is recommended to use Anaconda <cit.>; it provides Python 3.6 along with all packages except PyQtGraph (which may be installed using conda) and PyUSB (which may be separately installed using pip). Only on Windows, a USB device driver is required upon connecting the device to the host computer; this driver may be generated by libusb <cit.> or downloaded from the supplementary material <cit.>.

After installing these dependencies, the program can be executed by running the command . An application GUI similar to the one in Figure <ref>a should then appear. The USB Vendor and Product IDs shown in the input fields should match the values in the microcontroller firmware source code; the default values are resp.  and , but they can be adjusted if necessary. By clicking the “Connect” button, the application will start communicating with the potentiostat and will start displaying the measured potential and current; it does this both in numeric form (using the upper numeric indicators) and in graphical form (by plotting the potential and the current as a function of the time).



 §.§ Calibration

Even though the device will already be reasonably accurate without applying any calibration (thanks to the precision op-amps, precision resistors, and the inherent linearity of the ADCs and DAC), the remaining – small – offset and gain errors, typically in the order of respectively 0.01% of full-scale and 0.1% of the measured value, can be calibrated out by adjusting the values in the “Calibration” field under the “Hardware” tab. It is recommended that this be done by the following procedure:


  * Short the SE and RE; leave WE and CE unconnected. Either adjust the potential offset and current offset manually until both the potential and the current are exactly zero, or wait at least 20 s (to have the device measure enough data points to average) and press the “Auto Zero” button.

  * Connect SE to WE, and RE to CE. Press the “Auto Calibrate” button. Under “Manual Control”, switch the cell on, and set a few different potentials. The measured potential should exactly match the set potential; if it does not, you can further fine-tune the calibration by making small adjustments to the DAC offset and DAC gain. Press “Save to device” to apply the values.

  * Finally, the values R1–R3 represent relative fine adjustments to the shunt resistor values. If precise shunt resistors were used, they should not require adjustment, except for R1 (the lowest shunt resistor, used for the highest current range, having a nominal value of 10.00 ) which may have a slightly higher value due to the non-negligible contact resistance of the current ranging relay. To fine-adjust this value, connect SE and We to one leg and WE and CE to the other leg of an accurate 1.000 k resistor. Set a potential of e.g. 7.000 V, set potentiostatic mode, and turn the cell connection on; adjust the R1 value until the measured current is exactly 7.000 mA.

  * By pressing the “Save to device” button, the calibration data is saved to the internal flash memory of the potentiostat, so that the correct values are automatically loaded upon the next application start-up. This is also useful in case the potentiostat is connected to a different host computer; the device will remember its own calibration settings.


To maintain the best accuracy, it is recommended to verify the calibration or repeat the calibration procedure if the device has been exposed to significant changes in ambient temperature or humidity.



 §.§ Measurement

The user interface program can run a number of electrochemical techniques, which can be started from within the corresponding tab views. Figures <ref>–<ref> illustrate these techniques using example measurements performed on a “dummy cell”. The dummy cell consists of a series circuit of a 1.000 k precision resistor and a 1000 F (nominal) electrolytic capacitor, connected on one side to WE/SE and on the other side to RE/CE, and is drawn schematically in Figure <ref>. The RC series circuit can be used to verify the correct operation of the potentiostat by comparing the measured potential and current to the expected behavior, which is governed by a first-order differential equation:

    I=   U_R/R=CdU_c/dt
     U=   U_R+U_C






  §.§.§ Constant potential / current

Using the manual controls in the “Hardware” tab, a fixed potential (in potentiostatic mode) or a fixed current (in galvanostatic mode) may be set. This makes it possible to use the device as a constant-voltage or constant-current source. Both the potential and current will be continuously measured and displayed. It is possible to log the data to a file by entering a filename and checking the “Log” checkbox. Figure <ref>a shows the result of periodically changing the potential over the dummy cell between 0 V and +8 V (green curve), resulting in current spikes which decay exponentially as expected for an RC circuit (red curve). Figure <ref>b shows the noise on the measured potential and current, using shorted leads (i.e. zero potential) and with the cell connection off (i.e. zero current). The RMS noise level on the potential is 28 V, while the RMS noise levels on the current are respectively 88 nA, 1.1 nA, and 9.9 pA in the 20 mA, 200 A, and 2 A ranges.





  §.§.§ Cyclic voltammetry

Cyclic voltammetry (CV) is a versatile electrochemical measurement technique which finds application in many fields; the details can be found in literature <cit.>, but it is essentially based on the repeated application of a linear potential ramp, i.e. a “triangle waveform”, while measuring the resulting current. In a typical CV plot, the current is then plotted as a function of the applied potential.

Before starting a CV measurement, a number of parameters must be set in the user interface program (Figure <ref>). These parameters determine the nature of the applied triangular waveform and are graphically illustrated in Figure <ref>. Because of the finite resolution (i.e. step size) in potential and time, the waveform is actually not truly linear but rather consists of a “staircase” shape; however, when the steps are sufficiently small, the results are equivalent to a truly linear ramp.



By clicking the “OCP” button next to the “Start potential” input field, the currently measured potential is copied into the input field; this is convenient when starting a CV measurement at the open-circuit potential (OCP) of the cell.

The “Samples to average” parameter is automatically calculated based on the scan rate, but can be overwritten. It determines how many samples are averaged for one measurement of potential and current. Samples are acquired every 90 ms; this means that a measurement containing n averaged samples will take n ×90 ms. Averaging reduces noise, but also reduces the effective sampling rate; thus, n>1 should only be used for sufficiently slow scan rates. Because the minimum sampling time is 90 ms, the maximum scan rate is limited to approx. 500 mV/s; at this scan rate, the height of the potential steps is 45 mV.

Because the resulting current is not known a priori and may span a large dynamic range, an autoranging feature is available: during the measurement, the device will automatically choose an appropriate current range based on the actually measured current. This allows it to accurately measure currents ranging from nanoamps to max. 25 mA. If this is, for some reason, not desirable, a current range can be “disabled” (i.e. prevented from being selected by autoranging) by unticking its checkbox.

Before starting the measurement, the “Preview sweep” button may be used to make a potential vs. time plot based on the currently set CV parameters. This allows the experimenter to verify the CV settings. After setting an output filename, the measurement can be started by clicking “Start cyclic voltammetry”. This will switch the device to potentiostatic mode and start applying the potential profile. During the measurement, the application shows a continuously updating CV plot and continuously writes the measurement data to the output file. The output file is formatted as ASCII text and contains three tab-separated columns representing resp. the elapsed time (in s), the measured potential (in V), and the measured current (in A). It may be imported in any plotting or data analysis tool.

The CV curve of the dummy cell (Figure <ref>), acquired at a scan rate of 100 mV/s, reveals nearly horizontal plateaus at currents of ±100.6 A (with the plus sign on the rising potential and the minus sign on the declining potential). This is expected; because the current through the capacitor is proportional to the rate of change of its voltage, and that (given a constant current) the voltage drop over the resistor is constant, the rate of change of the capacitor voltage is also equal to ±100 mV/s. A straightforward calculation reveals that a 1006 F capacitance yields the measured constant current. This value is well within the tolerance of the (nominally) 1000 F capacitor in the dummy cell.





  §.§.§ Constant-current charge/discharge

Another commonly used electrochemical technique is to apply a constant current and to observe the evolution of the measured potential over time. In analytical redox chemistry, this method is known as coulometric titration. In the field of battery research, it can be used to determine the capacity of an electrode material. Using the galvanostatic mode of the potentiostat, such a measurement technique is easily implemented. Figure <ref> shows a charge/discharge measurement running on the dummy cell. Before starting a measurement, the following parameters need to be set in the “Charge/Disch.” tab:


  * Upper bound and lower bound: during the charging phase, the charge current is applied until the measured potential reaches the upper bound. This marks the end of the charging phase and the beginning of the discharging phase. During the discharging phase, the discharge current is applied until the measured potential reaches the lower bound.  This marks the end of the discharging phase and the beginning of the next charging phase, thus repeating the cycle.

  * Charge and discharge current: sets the applied currents (in A) during the charge, resp. discharge phases.

  * Number of half cycles: sets the total number of charge and discharge phases. As opposed to counting full cycles, this allows the experimenter to carry out e.g. a single charge measurement (one half cycle), or a charge/discharge/charge measurement (three half cycles).

  * Samples to average: has the same function as explained earlier for cyclic voltammetry. Set it to the desired acquisition period, divided by 90 ms; higher values reduce noise, but result in slower data acquisition.


The meaning of these parameters in the context of a typical charge/discharge measurement is illustrated graphically in Figure <ref>.



After setting the measurement parameters and choosing an output filename, clicking the “Start charge/discharge” button will start the charge/discharge process. During the measurement, the current half cycle is indicated in the “Information” box, and the plot window shows a continuously updating plot of the potential vs. the charge. The charge is calculated as the absolute value of the product of the (constant) current and the elapsed time.

For the dummy cell, the resulting measurement is shown in Figure <ref>. In the charge phase, using a constant current I of +100 A, the potential over the resistor U_R has a constant value of +100 mV, and the potential over the capacitor U_C increases linearly at a rate of dU_C/dt=100 mV/s. This corresponds to the observed behavior. In the discharge phase, the same current is applied in the opposite direction. This causes the potential to decrease linearly at the same rate. The inserted/extracted charge over the 1.8 V potential window equals 100 A×(1.8 V/0.1 V/s) = 1.8 mC = 500 nAh, which is in agreement with the value indicated on the horizontal axis.



  §.§.§ Rate testing

Specifically in battery research, the experimenter is often interested in the “rate behavior” of a test cell. This refers to the influence of the charge/discharge current on the measured cell capacity; typically, the capacity decreases with increasing current due to kinetic limitations. The current is expressed as a “C-rate”, where 1C is defined as the current necessary to charge/discharge the cell to its theoretical capacity in exactly one hour.

Using the “Rate testing” feature which is accessible from the correspondingly named tab in the user interface program (see Figure <ref>), the measurement of this rate behavior can be automated. For each C-rate (multiple values may be separated by commas), a charge/discharge measurement is ran between the lower and upper potential bounds (as explained in the previous section) for a configurable number of cycles. The charge/discharge current is calculated as:

    I [A]=± C [Ah]×C-rate

with the positive sign for the charge current, and the negative sign for the discharge current.



During the measurement, the plot continuously updates itself to show the charge/discharge capacity measured in the final cycle as a function of the C-rate. The measurement on the dummy cell (Figure <ref>) reveals a capacity which decreases linearly with the C-rate; indeed, the potential that is “lost” over the resistor is proportional to the applied current. The fact that the capacity decreases with the current, just like for a real battery, is no coincidence; in fact, the resistor in the dummy cell can be considered to represent the internal resistance encountered in real batteries.



§ USE CASE: A THIN-FILM LITHIUM-ION BATTERY ELECTRODE

In the following section, the utility of this low-cost potentiostat will be demonstrated by an example use case in the context of thin-film lithium-ion batteries. A lithium-ion test cell was constructed using a PTFE body filled with electrolyte (1 M LiClO4 in propylene carbonate) which was clamped against a 40 nm anatase TiO2 film on a TiN-coated silicon substrate, giving an active area of 0.95 cm^2. An electrical contact was made by applying conductive silver ink on the cleaved sides of the substrate in order to connect the TiN current collector layer to a piece of copper foil. This formed the working electrode. The counter electrode and reference electrode consisted of lithium metal strips dipped into the electrolyte.

As lithium-ion cells are incompatible with moisture and oxygen, the whole cell was constructed inside an argon glovebox. Thanks to its small size, the potentiostat could also be put inside the glovebox, needing only a USB cable feedthrough. Moving the potentiostat close to the test cell (inside the glovebox) greatly reduces noise and interference, compared to having it outside and extending the cell connection leads.

Cyclic voltammetry patterns were acquired at scan rates between 0.5 mV/s and 5 mV/s and are shown in Figure <ref>. The cathodic and anodic peaks are clearly visible around resp. 1.7 V and 2.2 V, as is expected for anatase TiO2.<cit.> As the scan rate increases, the available time for charge transfer decreases, causing the peak current to increase. The separation between the cathodic and anodic peak currents also increases; this is a kinetic effect, caused by the limited speed at which the lithium ions can diffuse through the TiO2 film. This makes such a CV experiment useful to study the electrode kinetics. A thorough study can already be found in literature <cit.> and will not be repeated here.



The same electrode was subjected to charge/discharge cycling at a constant current of ±0.18 A/cm^2 (positive sign for charge, negative for discharge) and between the same potential limits as in the CV experiment. The potential evolution, plotted as a function of the inserted/extracted charge, is shown in Figure <ref>. It shows characteristic plateaus at 1.85 V (charge) and 1.75 V (discharge). The final capacities are 3.03 Ah/cm^2 (charge) and 3.09 Ah/cm^2 (discharge), yielding a coulombic efficiency (defined as the ratio between the delithiation and the lithiation capacities) of 98.1%. The measured capacity corresponds to the insertion/extraction of approx. 0.6 Li^+ per unit of TiO2, according to the following calculation:

    #Li=C_measured× M/d ρ N_A q_e



with C_measured≈0.011 C/cm^2, d=40×10^-7 cm, ρ=3.8 g/cm^3, M=79.9 g/mol, N_A as Avogadro's constant, and q_e as the elementary electron charge. 



Taking the average of the measured charge and discharge capacity and defining 1C as 3.06 Ah/cm^2, the current density of ±0.18 A/cm^2 can be equivalently expressed as a C-rate of approx. C/17, which is a rather slow rate. The charge/discharge measurements were repeated with increasingly higher currents using the rate testing mode of the potentiostat. The capacity was determined for each C-rate and the result is shown in Figure <ref>. The results indicate that the capacity decreases quickly with an increasing C-rate, demonstrating the sluggish kinetics of the TiO2 electrode. At a rate of C/2, only approx. 50% of the C/10 capacity remains. At very high C-rates (≥10C), the slope of the decline becomes flatter; in this region, only a small pseudo-capacitive contribution to the capacity remains.





§ LIMITATIONS AND POSSIBLE MODIFICATIONS

Although this potentiostat design may be used “as-is” for many applications, some may have requirements that exceed its capabilities in its current state. Because the design is fully open source, it is entirely possible to modify it in order to accommodate custom requirements. In particular:


  * In the present design, the maximum current of 25 mA is limited by (1) the current that can be delivered by the charge pump, and (2) the maximum output current of the control amplifier U7A. A higher current could be achieved by (1) replacing the charge pump by an external ±9 V power supply (which must be able to supply the desired current), (2) including a high-current buffer stage (e.g. a pair of medium current transistors in a class AB amplifier configuration), and (3) adding a low-value current shunt resistor (e.g. 1 for a maximum current of 250 mA) and ranging relay.

  * The sampling period of 90 ms may be too slow in case of fast electrochemical processes. It can be straighforwardly lowered to approx. 17 ms by replacing the MCP3550-type ADCs with the MCP3553 and adjusting the polling interval in the Python software. Even faster sampling would require more elaborate modifications.

  * A new experimental technique may be required. As these are implemented in the software running on the host computer, it is relatively straightforward to add a new technique by editing the Python source code.



T. Dobbelaere thanks the Fund for Scientific Research - Flanders (FWO) for financial support.


99
sup Supplementary material: GitHub repository, <https://github.com/thomasdob/tdstatv3>
friedman2012 E. S. Friedman, M. A. Rosenbaum, A. W. Lee, D. A. Lipson, B. R. Land, and L. T. Angenent, “A cost-effective and field-ready potentiostat that poises subsurface electrodes to monitor bacterial respiration”, Biosensors and Bioelectronics, vol. 32, no. 1, pp. 309–313, 2012.
rowe2011 A. A. Rowe et al., “CheapStat: An Open-Source, ‘Do-It-Yourself’ Potentiostat for Analytical and Educational Applications”, PLOS ONE, vol. 6, no. 9, p. e23783, 2011.
dryden2015 M. D. M. Dryden and A. R. Wheeler, “DStat: A Versatile, Open-Source Potentiostat for Electroanalysis and Integration”, PLOS ONE, vol. 10, no. 10, p. e0140349, 2015.
bard_faulkner A.J. Bard and L.R. Faulkner, “Electrochemical methods: fundamentals and applications”, 2nd ed., John Wiley & Sons, Inc., New York, 2001.
squidstat Admiral Instruments, Squidstat Solo. <https://www.admiralinstruments.com/product-page/squidstat-solo> (accessed August 23, 2017)
opax192 Texas Instruments, OPAx192 datasheet. <http://www.ti.com/lit/gpn/opa192> (accessed August 23, 2017)
mcp3550 Microchip Technology Inc., MCP3550/1/3 datasheet. <http://ww1.microchip.com/downloads/en/DeviceDoc/20001950F.pdf> (accessed August 23, 2017)
dac1220 Texas Instruments, DAC1220 datasheet. <http://www.ti.com/lit/gpn/dac1220> (accessed August 23, 2017)
adr421 Analog Devices, ADR421 datasheet. <http://www.analog.com/media/en/technical-documentation/data-sheets/ADR420_421_423_425.pdf> (accessed August 23, 2017)
pic16f1459 Microchip Technology Inc., PIC16F1454/5/9 datasheet. <http://ww1.microchip.com/downloads/en/DeviceDoc/40001639B.pdf> (accessed August 23, 2017)
kicad KiCad EDA. <http://kicad-pcb.org/> (accessed August 23, 2017)
mstack Alan Ott, Signal 11 Software, M-stack. <http://www.signal11.us/oss/m-stack/> (accessed August 23, 2017)
libusb libusb. <http://libusb.info/> (accessed August 23, 2017)
numpy NumPy. <http://www.numpy.org/> (accessed August 23, 2017)
scipy SciPy. <https://www.scipy.org/> (accessed August 23, 2017)
pyusb PyUSB. <https://github.com/walac/pyusb> (accessed August 23, 2017)
pyqt Riverbank Computing, PyQt. <https://www.riverbankcomputing.com/software/pyqt/> (accessed August 23, 2017)
pyqtgraph PyQtGraph. <http://pyqtgraph.org/> (accessed July 28, 2017)
anaconda Continuum Analytics, Anaconda. <https://www.continuum.io/downloads> (accessed August 23, 2017)
wang2007 J. Wang, J. Polleux, J. Lim, and B. Dunn, “Pseudocapacitive Contributions to Electrochemical Energy Storage in TiO2 (Anatase) Nanoparticles”, J. Phys. Chem. C, vol. 111, no. 40, pp. 14925–14931, 2007.


