Hard Potato: A Python Library to Control Commercial Potentiostats and to Automate Electrochemical Experiments
간접 관련 수소연료전지 · (7) MEA(막전극접합체) (6) PEM(고분자전해질막)
기본 정보
- 저자
- DOI
- 10.1021/acs.analchem.2c04862
- 저널
- Analytical Chemistry
- 발행년도
- 2023
- 발행기관
- American Chemical Society
- 피인용수
- 26
- 라이선스
- cc-by-nc-nd
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1021/acs.analchem.2c04862
- 토픽
- Conducting polymers and applications
- OpenAlex ID
- W4323538918
평가 내용
- 관련도
- 간접 관련
- 사업분야
- 수소연료전지 · (7) MEA(막전극접합체)
- 부 분야
- (6) PEM(고분자전해질막)
- R&D 측면
- 분석·모델링
- 확신도
- 0.80
- 근거 용어
- potentiostats, electrochemical experiments, cyclic voltammetry, automation, data analysis
- 판단 근거
- 이 논문은 전기화학 실험을 자동화하기 위한 Python 라이브러리 개발에 관한 것으로, 코오롱인더스트리의 수소연료전지(PEMFC) 연구 시 MEA나 전해질막의 전기화학적 특성(전도도, 내구성 등)을 분석하는 공정 및 평가 기법에 간접적으로 활용될 수 있습니다.
- R&D 활용 포인트
- PEMFC용 이온전도성 고분자막이나 MEA의 전기화학적 성능(전하 전달, 확산 계수 등)을 고속·대량으로 자동 측정하고 분석하는 연구 시스템 구축에 활용 가능합니다.
- 평가 입력
- 본문 34,691자 중 30,032자 발췌
초록
본문 34,691자
본문 펼치기
섹션 본문 11문단 · 19,185자
(제목 없음)
1Here, we develop and show the use of an opensource Python library to control commercial potentiostats. It standardizes the commands for different potentiostat models, opening the possibility to perform automated experiments independently of the instrument used. At the time of this writing, we have included potentiostats from CH Instruments (models 1205B, 1242B, 601E, and 760E) and PalmSens (model Emstat Pico), although the open-source nature of the library allows for more to be included in the future. To showcase the general workflow and implementation of a real experiment, we have automated the Randles−Sěvcǐ́k methodology to determine the diffusion coefficient of a redox-active species in solution using cyclic voltammetry. This was accomplished by writing a Python script that includes data acquisition, data analysis, and simulation. The total run time was 1 min and 40 s, well below the time it would take even an experienced electrochemist to apply the methodology in a traditional manner. Our library has potential applications that expand beyond the automation of simple repetitive tasks; for example, it can interface with peripheral hardware and well-established third-party Python libraries as part of a more complex and intelligent setup that relies on laboratory automation, advanced optimization, and machine learning.
2E lectrochemical experimentation is still mostly done in a manual way by introducing parameters one by one into the graphical user interface (GUI) software that comes with the instrument. For general usage, this is arguably enough; however, with recent developments in applications such as redox flow batteries 1 or electrocatalysis, 2 where large amounts of new molecules and materials need to be electrochemically characterized, manual experimentation is cumbersome. Some of the well-known electrochemical instrumentation companies provide some sort of automation capabilities for their potentiostats, either within their own desktop applications via macros and block programming or by an application programming interface (API) written in a general programming language such as C/C+ +, C#, or Python. APIs can be seen as an intermediary communication step between the user and the instrument, where the user can write simple commands and the API will internally translate them into the set of instructions required by the instrument. This simplifies the syntax on the user side, as they do not need to fully understand the specific details of their potentiostats. APIs are most useful for experienced users, as it allows them to write programs or scripts that include the experiment and to control other instruments and data analysis by means of third-party libraries. To the best of our knowledge at the time of this writing, only PalmSens and Gamry provide frameworks to control their devices via a general-use programming language like Python. 3,4 Other do-it-yourself potentiostats are also reported in the literature, based mostly on open hardware microcontrollers with their source code freely available and can be directly programmed. 5,6 These frameworks, however, lack consistency between each other; this is expected, as each instrument has their own implementations and requirements. Here, we overcome the lack of consistency between different frameworks by introducing Hardware Potentiostato (or Hard Potato for short), a generalized Python API that internally translates high level functions into the specific commands required by each instrument. The selection of Python as the programming language for the library responds to its gentle learning curve, its syntax that is easy to understand, and the sheer number of third-party libraries available to perform data analysis, instrumental control, and interfacing with the operating system. The flexibility given by Python allows users to include electrochemical experimentation onto complex setups, for example, as part of a high throughput system where multiple parameters need to be explored through control of peripheral hardware or when using advanced optimization algorithms and machine learning for autonomous operation.
3Furthermore, the open-source nature of the library would allow the electrochemistry community to be involved in its develop-ment, for example, to include the control of potentiostat models not currently available to the authors.
4To test our Python API, we demonstrate its application to the Randles−Sěvcǐ́k methodology 7 to determine a diffusion coefficient (D) for a soluble redox-active species undergoing electron transfer at an electrode using the cyclic voltammetry (CV) technique. This example is a staple of electrochemical studies, but its implementation promptly requires automation when dealing with large libraries of materials. Furthermore, to showcase the flexibility provided by Python, we make use of Soft Potato, 8,9 an open-source library that contains electrochemical equations and can simulate electrochemical processes assuming semi-infinite planar diffusion and Butler−Volmer kinetics. ■ EXPERIMENTAL SECTION API implementation. The API consists of two main components: the potentiostat module and a load_data module. The potentiostat module contains high level functions and calls a "translator" for each commercial potentiostat available in the library, while the load_data module provides easy data handling (see Figure 1). The potentiostat module provides generalized functions for typical electrochemical techniques; for example, some of the arguments for the potentiostat.CV() function are the scan rate (sr [V/s]), the first vertex potential (Ev1 [V]), and the second vertex potential (Ev2 [V]). The Supporting Information includes instructions to install the library (Section S1) and script examples for typical experiments as well as the Randles−Sěvcǐ́k methodology implemented here (Sections S3− S8). (See refs 10 and 11 for the latest version of the library and full documentation.) Figure 1 shows how a common API facilitates communication between the user and each instrument. The generalized functions act as intermediaries between the user and the instrument, where the user does not have to worry about the specific ways on which their commercial software defines the parameters. Internally, these functions are "translated" into specific commands that each instrument understands. In the current version of the library (v1.3.11), 12 we have included several CH Instruments potentiostats. For the following, we are using the CHI760E, a highly popular and versatile research grade potentiostat from CH Instruments with the capability to be controlled via internal macro commands, but not directly with Python. The CHI software allows one to save the instructions as a .mcr text file and to use it as a parameter when calling the software from the Windows command line. The software then starts and runs the instructions written on the macro file. Our library uses this to control the potentiostat, where the user only needs to write the high-level functions; then, internally, the API converts these instructions into macro commands that the CHI760E understands. The resulting macro file also contains instructions to save the data into a .txt and .bin file, the latter being the format expected by the CHI software. It also contains a termination line that closes the software and returns control to Python to continue with the next instruction line. 13 While we have focused on the CHI760E, it is possible to include more potentiostats into the library as depicted in Figure 1, where a developer would only need to write its "translator" to match the API's functions to the instrument of interest. Until January 2023, we have written the translators for the CH Instrument potentiostats models 1205B, 1242B, 601E, and 760E and the PalmSens Emstat Pico potentiostat, the latter enabling the use of a low-cost potentiostat for application in an automated electrochemical platform.
5Controlling instruments from different vendors comes with certain challenges. For example, the CHI760E can perform automated iR compensation if a resistance value is provided, while this is not possible with the Emstat Pico. Meanwhile, the Emstat Pico has different operation modes (low speed, high speed, and maximum potential range) that can be selected. To consider the variability in options for each model, we have included optional parameters specific to each instrument. For example, in cyclic voltammetry, a resistance value can be included if using the CHI760E; this value will be ignored if using the Emstat Pico. This also allowed us to future-proof the code, as developers can write the translators for their own instruments including the core parameters required by the general library and optional parameters only used by their specific instrument. We have also included a validation step to ensure that potential parameters for each technique and potentiostat model fall within their corresponding range. For more details on the inner workings of the library, see refs 10−12.
6In the following sections, we use the CH Instruments 760E to demonstrate how the library can be used to automate data acquisition and include data analysis and simulation on the same script. For this, we have selected the Randles−Sěvcǐ́k routine, a highly used methodology and part of the general electrochemistry toolkit that consists of multiple repetitions and data analysis that may become tedious. To compare between different potentiostat models and to showcase the flexibility of Hard Potato, we have included the results using the CHI760E, CHI1205B, and Emstat Pico and their respective Python scripts ■ RESULTS Randles−Sěvcǐ́k is one of the most used electroanalytical methodologies. It allows one to measure the number of electrons, the geometrical area of the electrode, or the diffusion coefficient of a redox species, provided the rest of the electrochemical parameters are known. It is also one of the first methodologies taught in introductory electrochemistry courses. 17 It consists of performing CV using a macroelectrode with a redox active species and analyzing the peak currents as a function of the square root of the scan rate. If the process is diffusion controlled and displays fast electron transfer kinetics, a linear relationship is observed that is described by the Randles− Sěvcǐ́k equation:
7where i p is the peak current, n is the number of electrons, F is the Faraday constant (96,485 C/mol), C is the bulk concentration of the species, A is the geometrical area of the electrode, D is the diffusion coefficient, ν is the scan rate, R is the gas constant, and T is the temperature. The repetitive nature of the Randles− Sěvcǐ́k methodology, with the variation of one parameter (ν) and the estimation of another (D), makes it a perfect candidate for automation. Figure 2 shows a block diagram of the implementation. Briefly, the routine consists of four main parts. In the first part, we declare the variables required by the setup, which are the potentiostat model, path to the .exe program in the case of the CHI760E, and the folder where to save the data. Then, in the second part, we perform an open circuit potential (OCP) measurement and use it to estimate the potential window of the oxidation of FcMeOH; this could be useful when standard reduction potential of the species (E 0 ) is unknown, for example, when characterizing new nonaqueous redox molecules with unknown redox potentials. The third part consists of a loop that describes the specific steps during measurement, one for each scan rate. Here, we also import the recently acquired data to be used for the analysis later. The fourth part consists of the data analysis and plotting, that is, the estimation of E 0 from the average of the forward and reverse peak potentials and D from eq 1. Importantly, this step allows us to interface with other Python libraries that are useful for electrochemistry. For instance, in our analysis, we used the Randles−Sěvcǐ́k equation included in the Soft Potato library to fit the experimental peak currents and obtain D. We performed
Analytical Chemistry pubs.acs.org/ac
8Technical Note linear regression to obtain the slope of the i peak vs ν 1/2 curve and used the R 2 value to ensure our experiments were above a certain threshold, otherwise meaning that the methodology would be inappropriate to use due to either experimental artifacts (resistance, capacitance, noise), the effect of slow kinetics, or the presence of multiple electron transfer steps. Adding controls such as these prevents the need for manual inspection of the data, which would defeat the purpose of having a fully automated system, or when protocols are used by nonexpert electrochemists. We have also used Soft Potato to simulate the cyclic voltammograms once E 0 and D were estimated. Using Soft Potato in this case helps to confirm the accuracy of the entire approach by plotting the experimental results alongside their simulations. Figure 2a −c shows the results of the automated Randles−Sěvcǐ́k experimentation, data analysis, and comparison to simulation, promptly displaying the obtained CVs, the linear relationship predicted by eq 1, and the comparison between an experimental and simulated voltammogram. The total time of execution of this script was 1 min and 40 s, well below the total time it would take even an experienced electrochemist to apply the full methodology manually. To this point, the first author of this work tested it themselves taking ∼30 min.
■ DISCUSSION
9The use of our API simplifies the execution of straightforward methods such as CV and enables the automation of electrochemical experiments. While the execution time in the case shown here depends on the scan rates used, performing the full methodology in a traditional way is still time consuming as it requires changing the scan rate manually for each CV, saving data in an appropriate format to be used in commercial data analysis software, extracting E 0 and peak currents (or other suitable parameters), and performing linear regression against the square root of the scan rate to obtain D. Additionally, the user could still invest time in manually inputting parameters to perform electrochemical simulations, export the simulated data, and put it back into the data analysis software to compare it with the experimental data. This methodology is straightforward and can be carried out manually; however, its full implementation from experiment to data analysis and simulation is tedious and time consuming. Our API overcomes practical obstacles not only by offering automation of all these functions, but also by introducing a consistent language that defines commonly used parameters that are independent of the instrument used. The API approach shown here also raises new prospects for combining electrochemical methods with a wide variety of Python libraries. While we focused on the Randles−Sěvcǐ́k methodology, basically, any other electrochemical routine can be easily automated. For example, immediate systematic experiments similar to the one here tested are found in electrochemical applications such as potential window opening studies, 18 the Koutecky−Levich analysis, 19 the implementation of sampled current voltammetry, 20−22 the measurement of electrochemical kinetics with macro 23 and microelectrodes, 24 capacitance and solution resistance measurements with voltammetry and electrochemical impedance spectroscopy, 25,26 and the electrochemistry part of a homemade scanning electrochemical microscope. 27 For example, in our group, we have recently reported the use of automated tools to estimate chemical decomposition rates using a set of interdigitated electrode arrays and an early version of Hard Potato. 28 The Hard Potato library enables researchers to automate these tasks, especially when dealing with repetition and/or characterization of large libraries of redox species. 29 The ability to interface with third-party libraries for data analysis, plotting, simulations, machine learning, and even other instruments such as spectrophotometers and (micro)fluidics makes this a very powerful tool. For example, here, we used Soft Potato, an opensource Python library that includes typical electrochemical equations and can perform simulations assuming semi-infinite planar diffusion and Butler−Volmer kinetics. Soft Potato makes the calculation of D from the Randles−Sěvcǐ́k equation straightforward, as the user does not need to manually code it. We also used it to simulate the electrochemical response and compare it to the corresponding experiment, everything on the same script and immediately after the experiments were performed. Fully integrated, the Potato ecosystem can become a powerful tool to automate electrochemical experimentation and data analysis. Furthermore, a script can be shared between research groups "as is" to corroborate results or to make changes to the methodology, supporting the philosophy of more open and transparent analytical science. The potential for this approach can be significantly enhanced if companies offer compatible Python frameworks and the research community is involved with the development and improvement of the library. Specific challenges that can be addressed are the ability to live stream data to perform operations while the measurement is being taken, for example, to change current ranges, detect oscillations due to iR compensation, and even emergency stops. We believe that this will be essential in the coming years, since we see automation making its way into the chemistry realm, specifically, synthetic chemistry, where groups around the world are building fully automated synthesis laboratories. 30,31 It is only a matter of time until digital electrochemistry becomes the norm.
■ CONCLUSIONS
10Here, we have demonstrated the flexibility of automated electrochemical experimentation enabled by our open-source Hard Potato Python library. As a use case, we have implemented a workflow to estimate E 0 from voltammograms and D from the Randles−Sěvcǐ́k methodology, using these parameters to simulate and corroborate the electrochemical response, everything on a single script. The total run time was 1 min and 40 s, limited only by the scan rates used and the number of experiments performed, as the data analysis and simulation are virtually instantaneous. The ability to centralize data acquisition, analysis, and simulation within a single Python script showcases how powerful and flexible this tool is. Our primary goal is to automate processes and facilitate the sharing of electrochemical protocols, as groups can run the same experiments independently of the potentiostat that they possess, provided they have access to the Python script and the potentiostat "translator" is included in the library. Overall, we believe that our generalized Hard Potato library can be incorporated into any electrochemistry workflow and opens the possibility to perform more interesting problems involving automation, high throughput experimentation, and even artificial intelligence for closed-loop experimental design.
* sı Supporting Information
11The Supporting Information is available free of charge at https://pubs.acs.org/doi/10.1021/acs.analchem.2c04862.
참고문헌 26건
- Matplotlib: A 2D Graphics Environment Computing in Science & Engineering · AIP Publishing · 2007 10.1109/mcse.2007.55
- Electrochemical Methods: Fundamentals and Applications Anti-Corrosion Methods and Materials · Emerald Publishing Limited · 2003 10.1108/acmm.2003.12850eae.001
- Theory and Application of Cyclic Voltammetry for Measurement of Electrode Reaction Kinetics. Analytical Chemistry · American Chemical Society · 1965 10.1021/ac60230a016
- Koutecky-Levich analysis applied to nanoparticle modified rotating disk electrodes: Electrocatalysis or misinterpretation Nano Research · Springer Science+Business Media · 2013 10.1007/s12274-013-0372-0
- Application of the Koutecký-Levich Method to the Analysis of Steady State Voltammograms with Ultramicroelectrodes Analytical Chemistry · American Chemical Society · 2015 10.1021/acs.analchem.5b03965
- Evolutionary Design of Low Molecular Weight Organic Anolyte Materials for Applications in Nonaqueous Redox Flow Batteries Journal of the American Chemical Society · American Chemical Society · 2015 10.1021/jacs.5b09572
- Sampled-Current Voltammetry at Microdisk Electrodes: Kinetic Information from Pseudo Steady State Voltammograms Analytical Chemistry · American Chemical Society · 2014 10.1021/ac502645e
- Building a Microcontroller Based Potentiostat: A Inexpensive and Versatile Platform for Teaching Electrochemistry and Instrumentation Journal of Chemical Education · American Chemical Society · 2016 10.1021/acs.jchemed.5b00961
- 3D Printed and Microcontrolled: The One Hundred Dollars Scanning Electrochemical Microscope Analytical Chemistry · American Chemical Society · 2017 10.1021/acs.analchem.7b01764
- A Practical Beginner’s Guide to Cyclic Voltammetry Journal of Chemical Education · American Chemical Society · 2017 10.1021/acs.jchemed.7b00361
- Hydrogen adsorption on nano-structured platinum electrodes Faraday Discussions · Royal Society of Chemistry · 2018 10.1039/c8fd00062j
- Modeling electrochemical impedance spectroscopy Current Opinion in Electrochemistry · Elsevier BV · 2018 10.1016/j.coelec.2018.12.003
- Exploring the Composition–Activity Relation of Ni–Cu Binary Alloy Electrocatalysts for Hydrogen Oxidation Reaction in Alkaline Media ACS Applied Energy Materials · American Chemical Society · 2019 10.1021/acsaem.8b02206
- SciPy 1.0: fundamental algorithms for scientific computing in Python Nature Methods · Nature Portfolio · 2020 10.1038/s41592-019-0686-2
- Beyond Ternary OPV: High‐Throughput Experimentation and Self‐Driving Laboratories Optimize Multicomponent Systems Advanced Materials · Wiley · 2020 10.1002/adma.201907801
- Array programming with NumPy Nature · Nature Portfolio · 2020 10.1038/s41586-020-2649-2
- Sampled current voltammetry for kinetic studies on materials unsuitable for rotating discs or microelectrodes: Application to the oxygen reduction reaction in acidic medium Electrochimica Acta · Elsevier BV · 2020 10.1016/j.electacta.2020.136946
- Array programming with NumPy Nature · Nature Portfolio · 2020 10.1038/s41586-020-2649-2
- SciPy 1.0: fundamental algorithms for scientific computing in Python Nature Methods · Nature Portfolio · 2020 10.1038/s41592-019-0686-2
- The electron transfer kinetics of adsorbed species derived by sampled current voltammetry Journal of Electroanalytical Chemistry · Elsevier BV · 2021 10.1016/j.jelechem.2021.115021
- Seven steps to reliable cyclic voltammetry measurements for the determination of double layer capacitance Journal of Physics Energy · IOP Publishing · 2021 10.1088/2515-7655/abee33
- ACEstat: A DIY Guide to Unlocking the Potential of Integrated Circuit Potentiostats for Open-Source Electrochemical Analysis Analytical Chemistry · American Chemical Society · 2022 10.1021/acs.analchem.1c04226
- Using automated synthesis to understand the role of side chains on molecular charge transport Nature Communications · Nature Portfolio · 2022 10.1038/s41467-022-29796-2
- Electrochemical Mechanistic Analysis from Cyclic Voltammograms Based on Deep Learning ACS Measurement Science Au · American Chemical Society · 2022 10.1021/acsmeasuresciau.2c00045
- Automated Measurement of Electrogenerated Redox Species Degradation Using Multiplexed Interdigitated Electrode Arrays ACS Measurement Science Au · American Chemical Society · 2022 10.1021/acsmeasuresciau.2c00054
- Soft Potato: an open source electrochemical simulator and toolkit ChemRxiv · 2022 10.26434/chemrxiv-2022-4bs3w