X Building A Microcontroller Based Potentiostat
X Building A Microcontroller Based Potentiostat
Gabriel N. Meloni*
Instituto de Qumica
Universidade de So Paulo
05508-000
*e-mail: [email protected]
Table S1. Component values used during the electrochemical experiments on the main
manuscript. Components are labeled as on Figure S1.
Power supply
Most operational amplifiers (Op-Amp) such as the LM324 (Texas Instrument) used
on this report are usually powered by symmetrical power supplies i.e. they need to be
powered with both a positive and negative voltage (symmetrically) with respect to ground.
Although this is not true for all Op-Amp applications, it is true for the proposed circuit. The
+/- 6.5V supply shown on figure S1are designed to allow for a +/- 5V output on the Op-
Amp (after the internal voltage drop, commonly 1.5V) which is within the microcontroller
avoid damage to the microcontroller, as it is the 5.1V Zener diode connected between the
output of the Analog to digital converter (ADC) (Figure S1 and S2) and ground. The
LM324 quad Op-Amp can be powered with a dual power supply up to +/- 16V with respect
to common ground1 and thus can be powered by a PC ATX power supply +12V and -12V
rails. ATX power supplies are readily available and can be often salvage from old PC
The -5V supplied to the summing amplifier and current to voltage converter (Figure
1ii (A) and 1ii (C) on the main manuscript) should be stable and precise, as any fluctuation
on this voltage will cause an offset on both the applied potential to the electrochemical cell
and the current read from it. A voltage regulator such as the LM79L05 can be used to
provide a stable -5V from the -12V rail of the ATX power supply.
As the Arduino Uno boards do not have a true digital to analog converter (DAC) but
only pulse-width modulation (PWM) and for a cyclic voltammetry experiment, a potential
ramp should be applied on the potential controller (Figure 1ii (B) of the main manuscript),
the square wave generated by the PWM must be converted into a potential ramp. One
alternative is to use an RC filter to convert PWM values into true analog values. The
drawback of using this approach is that for a Uno board the PWM has an 8-bit resolution,
generating only 256 discreet potential values. This might result in poorly defined
voltammograms, especially if performing experiments with less than the maximum and
minimum potential limit of the equipment. The summing amplifier as seen in Figure 1ii (A)
gives those limits. Besides the resolution problem, most Arduino boards have low
frequency PWM signal, ranging from 400 Hz to 960 Hz2, resulting in a high time constant
for the RC filter. These frequencies are determined by an integer divider on the internal
clock of the board, meaning that the frequency can be changed by changing the divider
value, resulting in frequencies up to 3.1 kHz, much more suitable for the intended
application. Table S2 lists the truth table for the PWM based DAC.
Table S2. Truth table for the summing amplifier, showing its voltage output as a function of
the DAC voltage/PWM level.
Input Output
(V/PWM level) (V)
0/0 1
2.5/127 0
5/255 -1
The PWM voltage of the Uno board is 5 V and the DAC can only provide voltages
we are interested to vary the potential between negative and positive values. As most of the
window for water is not greater than 1.5 V for most working electrode (WE) materials,
there is no point in sweeping the potential up to 5 V. Thus, the summing amplifier can be
designed to output voltages in a more usable range. As the 8-bit resolution will be used in
the whole span of the potential window, the design of the summing amplifier is a
compromise between the potential resolution and potential window width. The width of the
Applying Kirchhoff's law and Ohms law on the inverting input of the summing amplifier,
= ( + ).
Figure S3 shows a plot of the output of the DAC and summing amplifier for the
setup described in Figure S1.
5
1.0
4
0.5
3
E/V
E/V
0.0
2
-0.5
1
-1.0
0
0 10 20 30 40 50
t/s
Figure S3. E vs. t plot of the DAC output (black line) and summing amplifier output
(grey line).
-Scan rate
The maximum scan rate for the designed device is dependent on the rise time of the
RC filter used on the ADC. In addition, the potential window and resolution will affect the
maximum scan rate. All those parameters can be changed allowing for some experimental
setup flexibility. As the DAC bit resolution is fixed (8-bit) the DAC can generate 256
different levels. With a potential window of 2V (from -1V to 1V) as used for the
electrochemical experiments, the DAC resolution is 0.0078V. With a DAC RC filter rise
time of 0.01s (10k resistor and 470nF capacitor and 3.1kHz PWM) the maximum scan
rate on the setup used for the electrochemical experiments would be 0.780 Vs-1. The
256
= ( )
Where:
The current reading part of the equipment is highlighted in Figure 1ii (C) in the
(transimpedence amplifier) connected to the counter electrode (CE). The current to voltage
converter (CVC), as its name suggests, converts the current that flows through the
electrochemical cell into a potential that the microcontroller can read. To avoid any damage
to the microcontroller the Op-Amps are supplied with +6.5 V, which is within the
microcontroller limits. This means that an overload in the current reading will only result in
a saturated amplifier and not cause damage to the equipment. The current limit is given by
the resistor R 6 (Figure S1) connected to the transimpedence amplifier feedback loop. Using
the property of Op-Amps3,4 and Ohms law, one can easily see that the current limit is
given by
where V CVC is the output voltage of the converter. The potentiostat was designed to
use the maximum dynamic range of potential reading form the microcontroller (0-5 V) and
engineered taking into account that the Arduino Uno board does not read negative
potentials, meaning that a value of 0 A on the current to voltage converter should result in
2.5 V (Table S3). This was achieved by the addition of a bias potential on the inverting
Table S3. Truth table of the current to voltage converter, showing its voltage output and
ADC level as a function of the current flowing through the counter electrode.
0 2.5 511
200 5 1023
Table S4. Current and voltage limits for the potentiostat used during the experiments
performed in the main manuscript.
Min. Max.
Potential (V) -1 1
Arduino sketch
Basic Arduino script used to run electrochemical experiments. The latest Arduino
IDE can be downloaded from: https://www.arduino.cc/en/Main/Software.
The script presented below was used to automatically perform cyclic voltammetry
experiments at different scan rates as seen in the diffusion coefficient determination section
of the main manuscript. All the parameters (scan rates and potential window) can be
defined in the software. This shows the flexibility and versatility of the design (both
hardware and software) in allowing to perform multiple experiments and automating
repetitive procedures.
//Script starts
include <LiquidCrystal.h>
int a = 10;
int val = 0;
float c = 0;
int n = 0;
long intervalos[count];
void setup() {
TCCR1B = TCCR1B & B11111000 | B00000001; //Set dividers to change PWM frequency
Serial.begin(9600);
pinMode(a,OUTPUT);
pinMode(ct,INPUT);
void loop() {
intervalos[pos]=(1000000L/((vevals[pos])*128L));
n = 0;
analogWrite(a,val);
Serial.print(val);
delay(intervalos[pos]);
c =analogRead(ct);
Serial.print(" ");
Serial.print(c);
Serial.print(" ");
Serial.print(n);
Serial.print(" ");
Serial.print(vevals[pos]);
Serial.print(" ");
Serial.println(intervalos[pos]);
analogWrite(a,val);
Serial.print(val);
delay(intervalos[pos]);
Serial.print(" ");
Serial.print(c);
Serial.print(" ");
Serial.print(n);
Serial.print(" ");
Serial.print(vevals[pos]);
Serial.print(" ");
Serial.println(intervalos[pos]);
n=n+1;
//Script ends
Data acquisition
Aiming to provide a flexible and free solution that is supported by the open source
and DIY community, the proposed device uses the Arduino IDE serial communication
capabilities to receive and send data. The data can be sent by the Arduino board as text in a
tab separated value (tsv) format that can be further manipulated using any data processing
software or as a graph on Arduino IDE 1.6.6 and above. The simple serial communication
enables for user with programming skills to make their own communication programs on
3 1 1
= 268,6002 2 2
RandlesSevcik equation at 25C5 where:
Peak current Ampere
Bill of materials.
Table S5. Material list for the fabrication of 1 unit of the proposed potentiostat. Items
marked with * represent items to be used only if not using an adjustable power supply.
Device construction
Figure S4 show multiple angles of the device used for all the measurements
presented so far. The device was fabricated using a breadboard type of construction
Figure S4. Pictures of the device used on the experiments showing its breadboard
construction. Highlighted are the jumper wire connections to the ADC and DAC (top left
image) and to the reference, counter and working electrodes (bottom left picture).
etched printed circuit board (PCB). The PCB design is based on Arduino shield design
making it easy to connect to an Arduino Uno board without the concern of mismatching the
pins. The use of a secondary shield (small PCBs on the top pictures) containing R 5 and R 6
allow the current range to be changed on a PCB construction witch is intrinsically less
Figure S5. Multiple pictures of the proposed potentiostat design fabricated using a custom
etched PCB in an Arduino shield configuration. The small PCBs on the top pictures are
shield that can be attached to the main PCB to allow for current range changing.
Even though the use of a PCB construction can reduce the electronic noise on the
measurements and delivers a more robust device that can still allow for hardware flexibility
(using alternatives like the small shields for current range), it is not necessary. A device