For use with: ipykernel

Voltammetry - Final Project

18B - Cyclic Voltammetry - Data Evaluation#

Background#

Notebook 18B contains a set of guidelines for evaluating data acquired with the Pico Pi - based Potentiostat and saved as a file on a computer.

Introduction#

A restricted implementation of the typical Python modules like numpy and matplotlib in the Alpaca Kernel (Micropython) significantly reduce the flexibility and the possibilities offered by these powerful modules forcing us to migrate some tasks to a Python-driven notebook (ipykernel) for evaluation of the results from the Potentiostat. Separating data evaluation from the data acquisition environment is nevertheless a common workflow in many commercially available devices, and one of the perhaps unexpected and advantageous outcomes of this approach is that the processed data becomes easily available for sharing.

Use this short notebook as an inspiration and an example. The methods chosen for this notebook are not mandatory, and all Python tools are allowed.

Goals#

  • Import and extract data saved as a file

  • Plot a voltammogram

  • Prepare a workflow for week 19

Structure#

  1. Background Preparation

  2. Implement: Classroom, Recommended as Preparation!

  3. Conclude and Choose: Classroom

Requirements#

  1. ❗❗❗ = Mandatory

  2. 🏆 = Entirely optional - It is interesting and leads to a deeper understanding.

  3. 🏆🏆 = Optional. Recommended - It can be re-visited later.

  4. 🏆🏆🏆 = Recommended - It is relevant now.

  5. 🏆🏆🏆🐐 = Strongly recommended - It might be challenging, but it is surely worth the effort!

Note: The number of trophies (🏆) indicates the level of recomendation for the optional tasks. It does not correlate with the level of difficulty.

Cyclic Voltammetry - Part 2 - Data Evaluation#

Similarily to the Background section of Notebook 18A, the outline of this chapter reflects a proposed order of tasks for plotting the data recorded with Pico Pi.

Potentiostat - Data Evaluation

  1. Initialisation

  2. Retrieving

  3. Processing

  4. Displaying results

Mentioned tasks are further explained in the sections below.

❗❗❗ Initialisation#

Importing numpy and matplotlib is the minimum requirement.

❗❗❗ Retrieving#

The method to retrive data depends on the format used.

❗❗❗ Retrieving numpy arrays#

filename = "Buffer#1.npy" 
DATA=np.load(filename) # Load the content of the file into a single array

### Un-pack the individual signals
U0 = DATA[0,:] 
U1 = DATA[1,:]
U2 = DATA[2,:]
Waveform = DATA[3,:] # Optionally

🏆 Retrieving text files#

If the Potentiostat configuration was stored in a text file, you might find useful the example in the hint below.

Hint: Variables from a text file
file_path = 'Buffer#1_parameters.txt'
# Read the file
with open(file_path, 'r') as file:
   lines = file.readlines()
   
# Further possible steps:
# 1. Convert lines into a dictionary
# 2. Convert numerical values from string
# 3. Looping through the dictionary to re-create variables from the key-value pair

❗❗❗ Processing#

🏆🏆🏆 Pre-processing#

If you followed the recommendation to refrain from any post-processing of the recorded data directly in Pico and the Data Acquisition notebook, the retrieved arrays with the results contain raw ADC count values. Possibly, they are summed over a number of instantaneous readings for further averaging. Now is the time to convert these samples to Volt, and to average them if necessary.

❗❗❗ Extracting Ucell and Computing Icell#

Depending on the design and the choice for the recorded reference signals, you may have to apply formulas derived in the notebooks 17A and/or 17C to extract the cell potential Ucell and the cell current Icell.

❗❗❗ Displaying Results#

🏆🏆🏆 Intermediate plots#

Feel free to plot or print any intermediate data for your convenience at any point in the notebook.

❗❗❗ Plotting a Voltammogram#

In our experiments, we are expecting currents in the range of up to a few hundreds of \(\mu \text{A}\), so make sure that your plots are using the relevant scale, and decorate your plot with the essential features and information to make it presentable to a wider audience.

🏆🏆 Saving figures to files#

Save your Voltammogram as a graphics file and insert it into your report

❗❗❗ Implement#

❗❗❗ Implement 1: Plot the Voltammogram of the Buffer solution#

  1. Create a separate Jupyter notebook with ipykernel for evaluating your Cyclic Voltammetry experiments.

  2. Use the Background section of this notebook 18B - CV - Data Evaluation as a guide and write code evaluation of the results of the Cyclic Voltammetry acquired with your custom Data Acquisition notebook (See 18A: I1.1).

  3. Evaluate the measurement of the Buffer solution and plot its voltammogram. Make your plot ready for publishing.

❗❗❗ Implement 2: Prepare for further experiments#

  1. Come up with a practical workflow for measurements of multiple samples in week 19.

    • How will you organise your data? In one folder or in separate folders for each measurement?

    • How many notebooks will you need?

      • in total

      • per substance

      • per sample

    • What naming convention will you use for your data?

    • Will you use real-time timestamps?

    • How will you keep track of parameter configuration for each measurement?

❗❗❗ Compare and Conclude#

To be checked off by a TA:

  1. Voltammogram of the Buffer solution

  2. Discuss your workflow for experiments in week 19.

### Notes