For use with: Alpaca Kernel
17C - Implement and Investigate: Linear Potentiostat Model with Alpaca#
Goals#
Build a simple model of the potentiostat on Alpaca
Get an intuition for the (multiple) inversion of polarity between potentiostat’s control and readout
Compute
Icellfrom the measurements, and compose you first voltammogramOptional: Compute the range and accuracy of
IcellOptional: Suppress the noise
Implement 1: Implement the linear Potentiostat Model#
It’s up to your decision whether you will use the Basic or the Advanced Design to implement the resistor-based Measurement Cell Model 1.
Design References#
Schematic: Basic Design - Model 1
Design Basic: Model 1 implementation on Alpaca
Schematic: Advanced Design - Model 1
Design Basic: Model 1 implementation on Alpaca
Fritzing: Alpaca's default jumpers
Alpaca - The starting point configuration for Voltammetry
Fritzing: Basic Design - Barebone with Relay
Basic Design: Barebone with Relay
Implement and Investigate 2.1: \(U_{\text{DAC}}\) and \(U_{\text{ADC}}\)#
Recall or derive the formula for \(U_{ADC}\) as a function of \(U_{\text{DAC}}\) for the chosen design. Look up your results from 17A, and check Udac -> Udaq_assistant -> Ucell -> Ua -> Uadc. First we will noly look at Udac -> Uadc.
Take the relevant parameters into account, write a code to set a desired Udac and to measure Uadc.
Basic design
Udac_assistant = function of UdacA
Uadc = Uadc0and/orUadc=Uadc1Advanced design
Udac = UdacAand/orUdac = UdacB
Uadc = Uadc0
Use resistors R1=10k, R2=10k and Rf=10k and set the attenuation for the ADCs to 1:1.
Set
Udac = 1VandUdac = -1V, and measureUadc.Convert the measured
Uadcto Volts and compare with the expected outcome. Pay attention to the correct sign in your results (polarity).
💡Hints: Custom functions
You may use functions included in
picotoolsas a reminder on how to control the DAC and the readouts.However, we recommend that you write your own functions, because in practice, adapting the existing unfamiliar functions for this purpose might take longer than writing your own.
Optional: Consider creating your own Python module for this project, for example:
picovolt.pyand import your functions with, for example:import picovolt as pv data = pv.function(param1, param2, ...)
Write a code to loop over the
Udacand to store the measured output voltages.
Basic Design
Perform a voltage sweep fromUdac=-0.5VtoUdac=1.5Vand plot the measuredUadcAdvanced Design
Perform a voltage sweep fromUdacA=0VtoUdacA=2Vand plot the measuredUadc
while
UdacB=0V,while
UdacB=1V
Optional: Swap the parameters for
UdacAwithUdacB
💡Hint: Function Generator
You may in this assignment use the in-built Function Generator to extract a
Trianglewaveform with a required symmetry.from functiongenerator import Triangle triangle = Triangle(Vmin=V_min, Vmax=V_max, freq=1, symmetry=50) waveform = triangle.get_voltages(n=NUM_SAMPLES) for ii in range(NUM_SAMPLES): dac_a.write(waveform[ii])
Conclude#
With help of the plots, reflect on:
Goal 2: Get an intuition for the (multiple) inversion of polarity between potentiostat’s control and readout
Implement and Investigate 2.2: Cell Potential#
Recall or derive the formula for \(U_{a}\) as a function of \(U_{\text{cell}}\) in Model 1. Now we dive into the voltages between Udac & Uadc: Udac -> Udaq_assistant -> Ucell -> Ua -> Uadc.
Use the experience from the previous section, and write a code that
sets
Udacto generate the desiredUcelland computes
Uafrom the measurement ofUadc.
Then,
Run a measurement for
Ucell = 1VandUcell = -1Vand extract theUa.Optional: Measure the actual
UcellwithAin2as a reference signal for later.
💡 Hints
Remember to reset your Pico before the measurement and save the data
Choose to measure with or without
-12Vto Cria
Compare the measured
Uawith the expected outcome.
Write a code to loop over the
Ucelland to store the measured output voltages.
Perform a voltage sweep
Ucell=-1VtoUcell=1Vand convert the measured signal toUa
Plot the measured
Uaalong with a calculated, expectedUa_refand discuss any potential differences in each case.
Save your results in a file and fetch it from Pico to your computer
Implement and Investigate 3: Cell Current#
Recall or derive the formula for \(I_{\text{cell}}\) as a function of \(U_{\text{cell}}\) for Model 1 in your design.
Extract
Icellfrom the measurement ofUasaved in Implement and Investigate 3: Cell Potential.
Plot
Icellas a function ofUcell.
Optional: Include a suitable capacitor in your circuit to reduce the noise. Compute the cut-off frequency.
Optional: Compute the accuracy and the noise in the measured
Icellto evaluate the effect of the Noise filter.
Optional: Replace the resistors with
R1=R2=Rf=1k. Then, run the same measurement and plotIcellas a function ofUcell. Finally, compare the quality of this plot with the one recorded with the previous configuration.
Compare and Conclude#
⏳ Estimated time: 5 min
To be checked off by a TA#
Present your plot of
IcelloverUcell.Discuss your results from the optional tasks.
Optional - Implement and Investigate 4: Progress to Week 18#
I4.1: Optimise the range of detectable Icell to improve the Signal-to-Noise ratio.#
Recall or derive the formula for the range of Icell as a function of all relevant parameters in Model 1 for your chosen design.
Goal: Find out how to configure your Potentiostat to ensure that are making use of the avaialable limits to record the strongest signal within a predefined range of
Icell.
Compute the range of possible
Icellas a functionRf(and in the Advanced Design as a function ofUoffset) for roughly the entire range of possibleUawith the given configuration of resistors.the range of
Uais the range of the possible outputs ofOPAMP2:
Basic - positive and negative,
Advanced - only positive.
Select
Rfto increase the current-to-voltage conversion factor and to utilise roughly the entire range ofUawithout causing clipping onOPAMP2, and adjust the attenuation ofAMPsto capture the signal fromUawithout clipping theADCs.Note that it could be optimal to slightly re-adjust the value of
Rfbecause there are only a few available options of attenuation factors. It is also fine to leave some margins.Advanced Design: Focus on optimising the range for the positive currents first, so do not change the
Uoffsetyet. Notice what effect the change ofRfhas on theIcellrange for the negative currents.
Advanced Design: Derive a formula for setting a desired range of detectable
Icelland describe the method to adjust that range while maintaining a fixed range ofUcell.Consider writing a function to compute that
Icellrange for a given set of parameters or to compute the required parameters for a given range of currents.
Pre-compute several essential
Icellranges for a pre-defined set of ranges ofUcell.Optional: Write a function to compute the required parameters on demand.
I4.2: Noise reduction#
Filtering#
Figure out how to estimate the bound for a suitable the cut-off frequency of your filter that will only negligibly affect your Voltammetry measurements.
Averaging#
Gather ideas on how to write an optimised code for measurements with averaging to reduce its effect on the timing precision.