I've searched the forum and found kind of similar topics for performing cyclic voltammetry with Arduino. But the design and question are different here, hence creating a new thread.
I'm a chemist with elementary electronics background.
The target is to build a potentiostat that can apply a digitized triangular waveform to a two-electrode cell (could be a battery, supercapacitor, electrochemical cell, etc.) and records the current at the end of each potential step, to extract chemical information about the system under study.
Minimal hardware list:
- Arduino uno (replicate);
- ADS 1115 16 bits ADC for potential measurement;
- 2 X INA219 DC current sensors with the default 0.100 Ohm shunt resistor replaced with 1.00 and 10.0 Ohms for 10 uA and 1 uA measurement resolution, respectively.
- 2 X 1 kOhm, 200 uF RC filters for smoothing the pwm output (will be optimized later);
A schematic of the circuit is attached as a Figure1.
The minimal code is attached. Please note that due to the necessity of polarity reversal, two pwm outputs are used, with one of them shorted to the GND when the other pin applies a positive bias.
Problem: The voltage-time triangular waveform looks fine when there is no load connected between the two electrodes (i.e., open circuit conditions) as can be seen from the attached Figure 2. However, when a cell is connected, the applied voltage by the microcontroller deviates from the expected value, depending on the magnitude of the current flowing through the system. The maximum magnitude of the current (~ 500 uA max) is well below the current limit of the pwm pins. Also, the slope of Voltage-time curve gets affected by this (Figure 3).
Question: is the applied duty cycle of the pwm a function of current passed through the pin? if yes, then what would be a safe current where the duty cycle can be assumed almost independent from the magnitude of the current? If not, is it something that I'm missing in my circuit that causes this out of control behavior?
In the next phase, I'm planning to use 12-bit DAC chips instead of pwm to have better control over the potential resolution. But if this is a common problem, it may still suffer from the same problem.
Any hint is much appreciated.
PotentialCycler.ino (14.5 KB)