Example Code

Cyclic voltammetry using an analogue potentiostat

Code and Documents

Attachment

Update Dec 2011

A Labview 2010 version of the program implemented on a purely analogue potentiostat (BASi CV-27)  through a NI-USB-6251-BNC board has been attached.  This version has no GPIB calls in it since they are not necessary for the potentiostat to function.  You will have to configure the analog input (one task which will measure 2 voltages from the potentiostat which correspond to current and potential) and output (a task which will control the channel attached to the E-input port on the potentiostat) in NI-MAX and select the tasks you have created in the program.  This update courtesy of my collaborator in Oklahoma, since I have not (yet) updated Labview in a few years.  A useful utility (reset_E.vi) has been included, which will reset the analogue output (after the task has been configured) in case the potential does not return to zero.

Functional Description

This VI records cyclic voltammograms using an EG&G potentiostat (e.g. Versastat, Model 263 or Model 273) interfaced via GPIB to a PC as an analogue potentiostat.  It uses an I/O device such as an NI USB-6251 to generate a triangular waveform output which is applied to the external input of the potentiostat. The VI simultaneously records the potentiostat’s output from the Applied Potential and Current channels.  This data is displayed and saved as a spreadsheet text file.

Caveats and Additional Notes

Extensive notes are available in the pdf file included with in the zip file which contains the components of the vi.

“Triangular wave generator.vi” generates an array of numbers using user-selected parameters such as “initial and final potential,” “switching potential 1,” “switching potential 2.”  These are passed through the program from the “Fast Scan CV.vi.”  As a result, this vi generates one cycle of a CV and the initial potential must equal the final potential.  This VI is a sub-vi of “CV only engine.vi”. An advanced user could modify this VI to make more than one cycle possible, and to incorporate separate initial and final potentials.

“CV only engine.vi” sends the necessary commands to an EG&G potentiostat to set the sensitivity, turn the cell on, enable external input, and build the waveform (including equilibration time at the initial potential).  It uses an analog output channel to send the waveform to the potentiostat and simultaneously records the potential and current output from the potentiostat.  The E-I data is saved to a temporary file, converted to an array, the temporary file is deleted, and the cell is turned off.  The CV only engine requires two NI DAQmx tasks to be set up under “Data Neighbourhood” in the Measurement and Automation Explorer. 

“Fast Scan CV.vi” is the main program shell.  The user sets the scan rate, the initial/final potentials and the switching potentials.  The initial potential should be between the switching potentials.  The scan direction is set by the order of the switching potentials.  The applied potential will start at the initial potential, change smoothly to the first switching potential, visit the second switching potential, and then return to the initial/final potential setting.  The first frame of this program calls “CV only engine.vi” and then displays the final CV on the front panel.  The other frames save the data as a text spreadsheet file (E,I couples) and uses the same filename with the “hdr” extension for a file in which the experimental parameters have been saved.

Previous and current (CHE 0911537) support by NSF is gratefully acknowledged for this work.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
JLSx
Member
Member
on

This is awesome Mike - seeing lots of your stuff recently - thanks so much!!!

Best,
JLSx
Sixclear
VI High - LabVIEW Programming Video Blog
mahesh3524
Member
Member
on

Will I be able to do this using a NI myDAQ?  I am trying to interface BASi CV-27 to a computer to obtain cyclic voltammograms. Any kind of help is appreciated.

roadchem
Member
Member
on

I am not familiar with the details of the myDAQ.  The product info on the NI site makes it seem very well suited to the task, though.  The problem will be in programming.  If you are using Labview, then the program I have written will be a good starting point, but will need some modification.

The most recent version of the program posted controls the CV-27 in my collaborator's lab.  In this application, you let Labview control the applied potential so the synchronization between scan and data recording is easy.  If you want to let the CV-27 control the scan, then you'll have to rewrite parts of the program to add a trigger function so the myDaq will start recording when you start the sweep.

mahesh3524
Member
Member
on

Thank you for your quick response. I will try to set everything up and let you know how everything goes.

mahesh3524
Member
Member
on

Hi roadchem,

Do you think I will be be able to obtain a cyclic voltammogram by simply connecting the App E and I Out from the potentiostat to the two analog input channels of the NI myDAQ? In other words, is it necessary to generate a triangle waveform and apply to the external input of the potentiostat?

Thank you,

Mahesh

roadchem
Member
Member
on

The program I wrote does not work that way, but there is no reason why you can't use the myDaq simply as an X-Y recorder.  I suspect that the myDaq comes with vi's (oscilliscope vi's) that would allow you to record both channels at once.  The issue you will have is making sure that the myDaq is triggered to start recording once the scan begins.  It may require a little programming to get your system to record data exactly the way you want it to.

mahesh3524
Member
Member
on

Hi roadchem,

Thanks again for your quick respose. I am using DAQ Assistant to configure two analog input channels (App E and I Out) and trying to display them in a X-Y graph. Do you know if the current response from the potentiostat is the actual current or does it require any conversion factor? The current response I am getting does not match with the one displayed on the potentiostat.

Thanks,

Mahesh

roadchem
Member
Member
on

I-out is in volts from the CV-27, and the exact conversion ratio is controlled on the front panel by the "gain" knob in mA/V.

mahesh3524
Member
Member
on

Hi roadchem,

Thanks for your promt reply. For cyclic voltammetry measurements, the CV-27 manual says to set the gain to 0.05 mA/V. Does this mean that I have to multiply my current output which is in volts by 0.05 to get current in miliamps.

Thanks,

Mahesh

roadchem
Member
Member
on

Yes that is correct.  Volts times mA/V will give the output in mA.

roadchem
Member
Member
on

By the way, the gain on the CV-27 should be set to a value which is appropriate to both the electrode size, the analyte concentration, and the set of scan rates.  Since you want good sensitivity, you should try to have the CV signal take up the majority of the scale.

Balance this against the fact that potentiostats often have faster response when set to less sensitive settings.

mahesh3524
Member
Member
on

Hi roadchem,

Thanks a lot for your help. Now, I am able to see the cylic voltammogram on my labview program although it is not perfect. I guess I have to play with the gain settings to get nice oxd/red peaks.

Sincerely,

Mahesh

Contributors