Skip to content

amitsandhel/PA273-Potentiostat-Software

Repository files navigation

#PA273-Potentiostat Software Version 1.0

by Amit Sandhel
with contributions by Fredrick Leber

This software is designed to operate the PA273 potentiostat.

##Requirements

  • Python (2.7)
  • matplotlib
  • pySerial
  • NumPy (for GUI)
  • wxPython (for GUI)
  • wxglade (for development purposes)

#Features:

  • Custom built command language to execute potentiostat commands (csv file)
  • Graphical User Interface that displays data in real-time
  • Built in simulator for testing purposes
  • Records the time, voltage bias applied (mV), current (with scaling units depending on order of magnitude), and charge
  • Saves data as a csv file for later analysis
  • Argparse command line to run the software using various settings and parameters

The software has three versions:

  1. pa273_v1.py: Version 1 is designed to run experiments with a single, unchanging voltage level.
  2. pa273_v2.py: Version 2 is designed for waveform programming. Manuals provide more information regarding waveform programming.
  3. pa273_v1_record.py: Version 1 script capable of recording voltage and current without any external applied bias/potential from the potentiostat.

#Files:

Note: All file and folder names should remain as is to prevent unwanted error!

  1. init.py: Empty script to build the subdirectory. See Python manual for more information.
  2. main.py: Script contains argparse and controls the execution of all scripts. Handles command execution.
  3. pa273_v1.py: Version 1 of potentiostat software. Version 1 is capable of running single volage measurements.
  4. pa273_v2.py: Version 2 of potentiostat software. Version 2 is an enhanced software capable of waveform programming using a custom built command language.
  5. beastiecommand.csv: Command file for pa273_v2.py script. The command language reads the time and voltages from this file. DO NOT CHANGE THE NAME OF THIS FILE.
  6. SingleVoltageData.csv: Csv file where the data is recorded for pa273_v1.py script.
  7. WaveformData.csv: Csv file where the data is recorded for pa273_v2.py script.
  8. Fake_Serial.py: Simulates a serial port when running the simulator.
  9. wxmain.py: The main script that controls the GUI.
  10. wxgui.py: Skeleton for the GUI, autogenerated.
  11. wxgui.wxg: Used to design the GUI.
  12. Manuals folder: Folder containing the manuals to operate the potentiostat in pdf format.
  13. pa273_v1_record.py: Version 3 of potentiostat software ca. Version 3 is capable of recording the bias and current with no external applied potential.

There are also some scripts that are not currently used, but are being kept for now:
14. graphclass.py: Script outputs data in real-time. This script lags in Windows but is perfectly OKAY in Mac OS and Linux operating systems. 15. postrun.py: Generates data of experiment using matplotlib. Also saves the data as a png image file. Not currently used 16. Test folder: Contains unit tests for all scripts. Run independently of the main software using the terminal/command prompt. Due to changes in the scripts, these do not currently work.

#Operating Instructions ##Introduction

  • Read the manuals provided on the potentiostat before using it to understand all available commands and how to operate the potentiostat.
  • It is recommended to first run the software using the simulator to have a full understanding of how the software works before using it with the actual machine.
  • To determine which COMPORT to use, look in the Devices and Printers section of the Control Panel. Check which COMPORT is used for the "USB to Serial Adaptor".

##Version 1: pa273_v1.py Note: SingleVoltageData.csv records the data for this script.

###Running using the GUI:

  1. Double-click wxmain.py
  2. Click on the tab at the top of the window that says "v1"
  3. If using the simulator, click the "SIM ON" button.
  4. If not using the simulator, type in the value of the COMPORT that you are using in the COMPORT box.
  5. Enter the BIAS value you wish to apply in the BIAS box (in millivolts).
  6. Click Start to run the experiment.
  7. If you wish to pause the experiment, press "Pause". To resume, press "Start" again.
  8. When you wish to exit, click "Close".

###Running using the Command Line:

  1. Open the command prompt/terminal and navigate to the directory that the software is in.
  2. To run the simulator, in terminal/command prompt type "python main.py -s -v1". If you wish to run using the real serial port, in terminal/command prompt type "python main.py -v1".

NOTE: If you are not on COM4 you will also have to specify your COMPORT if you are not using the simulator. For instructions on how to do this see the Argparse section below. 3. Enter the Bias/Potential to apply in millivolts (mV). 4. Software will run with incrementing cycle counter displayed. Data is not displayed in real time if you are using the commmand line. Data will be saved in a csv file called SingleVoltageData.csv. 5. When you wish to exit, press "Ctrl-C".

##Version 2: pa273_v2.py Note: WaveformData.csv records the data for this script.

###Running using the GUI:

  1. Open "beastiecommand.csv" command file in excel.
  2. Write the desired times (in seconds) and the voltages (millivolts) needed for waveform programming.
  3. Save the csv excel file and close it. Do not rename this file.
  4. Double-click wxmain.py
  5. Click on the tab at the top of the window that says "v2"
  6. If using the simulator, click the "SIM ON" button.
  7. If not using the simulator, type in the value of the COMPORT that you are using in the COMPORT box.
  8. Click "Start".
  9. When the program is done running, click "Close".

###Running using the Command Line:

  1. Open "beastiecommand.csv" command file in excel.
  2. Write the desired times (in seconds) and the voltages (millivolts) needed for waveform programming.
  3. Save the csv excel file and close it. Do not rename this file.
  4. Open the command prompt/terminal and navigate to the directory that the software is in.
  5. To run the simulator, in terminal/command prompt type "python main.py -s -v2". If you wish to run using the real serial port, in terminal/command prompt type "python main.py -v2".

NOTE: If you are not on COM4 you will also have to specify your COMPORT if you are not using the simulator. For instructions on how to do this see the Argparse section below. 6. Software will run with incrementing cycle counter and estimated time remaining displayed. Data is not displayed in real time if you are using the commmand line. Data will be saved in a csv file called WaveformData.csv. 7. The script will automatically exit when the cycles are finished. If you wish to exit before then, press "Ctrl-C".

##Argparse Commands (used when running the program with the command line): A list of available argparse commands are given below. These command can be typed into the command prompt/terminal, assuming you are working in the correct directory.

Note: Multiple argparse commands can be given at once (ex: python main.py -v2 -c3).

  1. python main.py -h Opens the help file for the argparse commands. Lists all the argparse commands available with descriptions.
  2. python main.py -v1 Runs the v1 script. You could write v2 instead to run the v2 script. If this command is not present, default version is version 1.
  3. python main.py -s Runs the simulator. If this command is not present, the program connects to the real serial port.
  4. python main.py -c1 Changes the COM PORT. Only necessary when using the actual serial port. The number 1 shown in the example can be changed to any number as desired. If this command is not present, the program defaults to COM4.

##Version 3: pa273_v1_record.py ##Notes:

  • Version 3 is only run from the command line

###Running using the Command Line:

  1. Open the command prompt/terminal and navigate to the directory that the software is in.
  2. To run the simulator, in terminal/command prompt type "python main.py -s -v3". If you wish to run using the real serial port, in terminal/command prompt type "python main.py -v3".

##Notes:

  • Function 10 on the front panel of the potentiostat can be used to reinitialize the machine to its default settings.
  • The command file's name (beastiecommand.csv) must not be changed.

#To Do:

  • Add threads and a callback feature
  • Add proper unit tests
  • Make GUI look nicer

About

This software is designed to operate the PA273 potentiostat.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages