ARA Applied Spark Notes

We Code, built, and share our thoughts to do chemistry

Tuesday, 13 October 2026

Our potentiostat circuit design approach compared to a glucometer

Previously, we rebuilt a potentiostat circuit to improve our design. We built it on a breadboard as we can experiment with it. You can watch our potentiostat circuit we built on potentiostat below:

We did make some improvements on our design approach. The main change is that we change how the voltage is added or subtracted. Previously we used resistor tricks to force the output of differential amplifier to be the signal voltage minus half of the reference voltage.


Differential and summing amplifier resistor tricks.

By employing this approach, we can use the common reference voltage from power supply or voltage regulator such as 3.3V and 5.0V to provide half of the reference voltage. However, our approach used asymmetric value of resistors in order to make the tricks work. This method might introduce errors and inaccuracies as the we have to make the half of the reference voltage in each op-amp operation, such as in differential and summing amplifier. In this case, the half of the reference voltage produced might be less reliable as we use different resistor to produce half of the reference voltage. It forces us to go back to use the more reliable input of the opamps in which the output is the difference of each signal without doing the resistor tricks. 

We still need half of the reference voltage. We didn't have the voltage source with such value as we only have 3.3V and 5.0V voltage sources from our power supply. In this case, we used voltage divider followed by a voltage follower.
Voltage divider and follower.

When we saw the design of NXP's MED-GLU AFE design block(source), we found that our approach is similar as them. We are quite delighted to see how far we've learned that looked similar to what the industry has implemented.
MED-GLU AFE Voltage generator circuit (source)


In their design, they added 100uF capacitor. We believe it's a decoupling capacitor to stabilise the voltage. Well, it's addition worth considering in our improved design.

By halving the reference voltage, we no longer need to use resistor trick to create our desired output. Now, the half of the reference voltage is uniform across the input creating making the device more reliable.

There are some part in their design we still don't understand. One of them is connecting the negative voltage to the non-inverting input of the opamp in the transimpedance amplifier or current-to-voltage converter. We're not sure whether this approach would make the voltage positive so that's it's readable by the ADC of the microcontroller.
MED-GLU AFE TIA (source)

The notes stated that output would be the current of WElect1 multiplied  by the feedback resistor of R3. We're not pretty sure about this as the amplification approach might be different.

At the end of the video, we stated that adding RC filter before ADC measurement is one of the improvement we can do. It turns out, this approach is actually used in the design. 
MED-GLU AFE amplification and filtered circuit (source)

Their design employed 8Hz cutoff frequency. While it might work well on the glucometer, potentiostat has higher bandwidth as measurement frequency can vary from every second to multiple measurement per seconds. At the moment, we measure the signal every 100ms, 10Hz bandwidth. We might need twice the bandwidth for the cutoff frequency to filter out the unwanted noise as well as preventing our signal to be attenuated.

Finally, one thing we're still working on. Making the most of USB protocol to communicate between device and the PC. USB protocol is a little bit complicated and when we can fully implement this, we can get better data transfer than UART. While we might need to redesign the communication for the frontend, it would be worth it as once we can do it, we can level up our programming and manage measurement that require high data transfer such as EIS. but that's for another discussion.

All in all, if we look back and see how improved we are, it was great though we still have lots of things to learn. We're still going to take the step slowly but surely.







Monday, 10 August 2026

Thoughts: Arduino shield

Intro

We've recently uploaded a video about our latest design for our potentiostat signal processing. 

After redesigning our potentiostat, we happened to see a video about electronic modules got bumped and it kind of messed up the circuits. The solution was to made module easily connected to the dev board -- shield. This gave us some inspiration on what we should have approached the design for our potentiostat. 

Our setup approach that still uses breadboard to connect the modules, microcontrollers and signal generator and data acquisition.

Currently, the voltage source and the analog voltage are installed in the breadboard, connected by a wire. It's not perfect but it works. However, if we want our project to be more product-ready, we need to integrate the whole module into one reliable and working systems. Since at the moment we haven't explored to build a custom microcontroller, we need to fit the design with the markets, in this case the arduino-compatible shields.

Our design plan

Since we use STM32 nucleo board, it both supports arduino uno and ST morpho pinouts we can utilise for our projects. We are planning to make "sandwiches" of modules. On the bottom, the STM32 Nucleo board, the second layer is voltage regulator for powering up the opamps and the ADC and DAC module. it also houses the DAC and ADC modules connected through pinout so that it's easily replacable when it has issues. The voltage source, DAC, ADC and ground would be extended for the third layer, the potentiostat signal processor.

Since we managed to shrink the potentiostat into smaller dimension, we believe we can shrink it further fitting the arduino shield morphology. This way, we can make the whole design more compact and keep the modularity in mind. 

Pinout conundrum

As arduino has its designated pinout, it can restrict our design approach. However, we don't think that the shield should have the same number of pin as the arduino, we only add the necessary pinouts in the shield. Therefore, the module would still fit the arduino while adding more flexibility and room for the PCB design.

This is our current shield design that fits with ST morpho. The design is yet to complete as we haven't placed any socket for the DAC output and ADC input. We just show our incomplete design to emphasise the approach we are going to choose. Furthermore, if we look at the current schematics, there are so many non-connected pins. We plan to remove these pins and only keep the ones that can have connections by just employing the socket pins in the exact position. This way we can keep the connection as well as providing more space in our design to place another components.

Our current design for the shield in our potentiostat (incomplete)


That's the direction of our potentiostat design. Let me know your thoughts.

Wednesday, 29 July 2026

Notes & Thoughts: The state of ARAStat

Intro: Why ARAStat exist in the first place

At the beginning, I built ARAStat because I wanted to apply for jobs in electrochemistry doing lithium-ion battery recycling and hydrogen production. I had interest in hydrogen production from water splitting. My Uni at the time didn't have access for potentiostat which stopped me for the research. Therefore, at the time I was thinking why not just try building one?

It turned out, it was way harder than I thought. At first, the capability design was that it can perform CV and EIS. However, due to the complexities in components (bandwidth, sample rate),  producing high frequency signals and some skill issue on processing fast data stream, I changed the scope to cyclic voltammetry only. After several design iterations, ARAStat was born. 

Did I get the job? sadly no, but my knowledge of programming and electronics improved a lot. However, when I started making YouTube videos about designing our potentiostat, there's been interest I have never expected. Well, there's always something to gain despite not achieving the results I expected after all.

Let's talk about ARAStat

At first, we built our potentiostat with modularity in mind. Variable voltage range, upgradable opamps, even at first we design our transimpedance amplifier (TIA) with a swappable resistor (I killed this because I ran into some issues). During testing, we used bulk-scale electrodes and the voltage spiked when we used higher resistor values in TIA. Therefore we only used certain values such as 100, 1K and 10K ohms for the TIA. 

These videos shows how we designed the potentiostat from simulation to PCB design.


To reduce complexities in assembly, we use the through-hole footprints for the component so that it's easy to solder. However, this approach has consequences. We couldn't find the resistor with 0.1% error with this type of footprint. Since we heavily use resistor to do the voltage subtraction and addition in our potentiostat, the resistor 1% may introduce higher margin of error especially when we deal with microamp currents.

In addition to resistor error, the highest resistor value is 10K ohm. assuming the TIA output is 10mV, the potentiostat can work up to the microamp range. On the other hand, precision potentiostat can work up to nanoamp, or even picoamps which is far from what our device is capable of. We can add more TIA resistors to reach nanoamps or even picoamps. However, our current opamps would also introduce noises since its input bias is in nanoamp range. Instead of measuring the potentiostat current, we got noises from opamps.

Improving the Design

There are lots of things to change if we want to make our device more precise. From changing the footprint from through-hole to SMD to fit the resistor with 0.1% error, adding more TIA resistor values, and upgrade the opamps. However, these changes would alter the whole design. For example, this is our latest PCB design for our potentiostat. 

Our latest design iteration.

The design becomes more lean as it has more space. We believe we can squeeze it further even after adding resistor arrays for the TIA. This design would still stand if we the opamps we use have the same pinout as OP07, or else it would all be a complete makeover.

In this video, we also analyse some flaws in our design and how to tackle it

Wall to hit

Precision devices has the design with as low as noise possible. There might be some possible noise we haven't really thought of such as the noise from the power outlets (we might need to add low pass filter) and any other sources. Furthermore, "precision" opamps is more expensive than the general purpose opamps that we currently use. Furthermore, finding the upgrade that still suits with our pinout and footprints would be challenging. Sooner or later doing design makeover is inevitable. Not only is inevitable, we believe it's going to be expensive as well. We can cut some cost by using dual or quad channels opamps. Changing the opamps would create a design makeover, but on the hand the change wouldn't be too significant as we still use similar principles.

Alternative: Analog Front End (AFE) Potentiostat Chip

The alternative to upgrade and minimise the noise from our design is to scrap almost everything and use analog front end (AFE) IC. AFE comprises of multiple components such as DACs, signal processor and ADC packaged in one chip. Because our design direction is going to use SMD footprint, considering integrating AFE to our design can also be our consideration. After doing some research, we've found that AD5941 of Analog Devices (source) offer high performance with competitive cost compared to our redesign. It can perform EIS, voltammetry, amperometry. This chip can read up to 50pA, that's in the picoamps which is suitable for precision measurement. The chip interfaces with our microcontroller  through SPI communication. All we need is just some precision voltage sources, crystal oscillators, and some RC filters to filter out the noises.

Despite it sounds like a silver bullet, AD5941 has some limitations, especially in the voltage range limited to -/+ 1.1V. It might work for certain applications such as ion analysis or testing out the redox mediator for LFP batteries. However, for our use case such as hydrogen evolution reaction, we might need to find some workaround if we want to use this chips for our next potentiostat project.

Final Thoughts: What will we do?

To conclude this post, there are certain things we are planning to do. First, since we already redesign the PCB into SMD, we will stick with this design and find some upgrade replacements for opamps with the same pinout as OP07. We know that eventually we will have to do the redesign because of the number of opamps we use. We can rear it down by using dual and quad channel precision opamps not only to cut some cost but also to save space. We might also need to integrate reed switch to choose the TIA resistor making the measurement more automatic and less prone to errors.

Another thing, if we look at AD5941, it doesn't seem to have any negative input voltage whereas we use negative input voltage for our opamps. We believe there is something we haven't fully implement and explore in our design, i.e virtual ground. For certain range, we can utilise the AD5941 for the measurement. However, when we want to extend the range, we would have to integrate the signal generator for our potentiostat and allow AD5941 acts as the TIA chips.

Tuesday, 14 July 2026

Devlog & Thoughts - Reliability issues and Glucose test strips.

Intro: Reliability Issues

Recently, our potentiostat is having some reliability issues. The external ADC stopped working, the reference electrode also seemed to have issues as well as the measurement is off. Moreover,The reference electrode cap is glued and it's been tricky to remove.

While ADC issue can be rectified by using built-in ADC from the microcontroller, the programming was a little bit tricky on STM32 boards. There were so many possible configurations we needed to set to have it running properly. Previously the issue we faced was the ADC only read one channel instead of two. For cyclic voltammetry it might not be an issue as we can read the current. However, to ensure the reference voltage loop works properly, having additional ADC channel would be beneficial. Furthermore, as the built-in ADC has higher sampling rate, we can use it for more advanced applications such as electrochemical impedance spectroscopy (EIS) if we can utilise the internal ADC to the fullest. 

Thankfully, we can rectify the issue. Even better, we can also implement direct memory access (DMA) from the ADC which would allow us to stream high amount of data when we can implement EIS later (our opamps cannot withstand high bandwidth of EIS for now). 

Another issue we're having is we believe our dedicated reference electrode needs replacement. Well, replacing one is quite expensive until we tried several alternatives such as screen printed electrodes. It provides a uniform performance as the size of electrodes are defined and it works more reliably compared to our current setup. However, the trade-off that it can only be used one time, several time maximum. We can perform cyclic voltammetry with the fraction of the cost. It cut some cost upfront but unclear for long-term measurement projects. We almost give up being frugal about this by purchasing reference electrode replacement until a glucose test strip crossed our minds. We know that the glucometer is an electrochemical instrument which in principle works similarly with what we have done. Moreover,  the glucose test strips are so ubiquitous in the market making it more cost-effective to purchase than using research screen printed electrode, especially for our current purpose of testing our potentiostat.

Exploring the glucose test strips schematics.

Here's the video of us exploring the what's inside the glucose strips.

Glucose test strips has a limited documentation as they are proprietary. They only describe what it does, not the schematics like a research screen printed electrode. When I peeled the layer of the strips, it looked more complicated than the normal screen printed electrodes.

Fig 1. Glucose test strips.

Usually there are only 3 traces, reference, counter, and working electrodes. This test strips? it has 5 traces and as there might be fill detection electrodes (source) and it's quite hard to tell which is which.  Traditionally, we can tell which is reference electrode by looking at silvery traces to indicate Ag/AgCl reference electrode. Since counter and working electrodes are made of the same materials but different in size, sometimes we chose one of them for the either of the electrodes. It might have some consequences which we would discuss later.

In the glucose test strips, we couldn't see any Ag/AgCl reference electrode in the glucose strips. It turns out, the reference electrode can be either Ag/AgCl or inert metals such as gold or palladium (source). It's kind of fascinating that the inert metals can keep the reference voltage for the measurements instead of the electrode we studied in the literature such as Ag/AgCl or calomel electrode.

Fig 2. Glucose test strips after the top layer is removed

Because of this complexities, things now become more like a guesswork. Because the most bottom part of the traces can be connected to the screen printed electrode, that's the electrode combination we explored. 

The Result

We connect the left traces of the test strip in Fig 2. to the reference electrode and didn't fully document for other traces connecting to which electrodes. We used ~1mM ferricyanide in 0.1M KCl solution with sweeping voltage from 400mV to -600mV, scanrate of 100mV/s and quiet time for 1s. The result is shown in the following image. We use our potentiostat to perform this measurements.

Cyclic Voltammogram using glucose test strip. Top: Voltage Applied vs Current. Bottom Reference Voltage vs Current.

We managed to see both anodic and cathodic peaks in our potentiostat. If we look at both plots, the voltage applied and the reference voltage are in good agreement showing that the feedback control loop in the counter electrodes work properly. Well, there is a big gap between peaks. However, all in all it answers the questions that glucose test strip can be used to perform cyclic voltammetry.

The Caveats

One issue we were having was that we couldn't replicate the measurements. We retried the combinations, used a new test strip, we couldn't have the initial results. We tried to investigate the hardware and rectify some issues, still we couldn't replicate the results. 

In a combination of electrodes, we managed to see that the applied voltage and the reference voltage are in good agreements. But we didn't get the result We used the old solution for latest measurement though, could it be from the solution? Well, we need to redo the all the experiments all over again and see the results again for ourselves.














Saturday, 13 June 2026

Devlog & Thoughts - Making better data interface

 

Issue

Here used to be our potentiostat UART output. It's raw and messy. We need to extract the data manually before plotting the results. Our former workflow was to extract the data from the logs, remove the timestamps and unnecessary symbols printed in our logs, save the file as CSV and let the python script do the job to plot the data.

Our Potentiostat raw output
The plotting process takes a while as we have to look at the starting data all the way to the end. Then we have to name the file and configure the script about the parameters we used during the measurements. Finally we convert the voltage to current before we can plot the data.

Plotting our cyclic voltammetry data (ferricyanide)

For small amount of data, it's still manageable as the workflow is still simple and doesn't require a meticulous process. We can still include the parameters to the plotting function as we remember it. However, when we have lots of measurement data, extracting the data and considering so many measurement data would be cumbersome. Additionally, we need to store the whole data including the parameters to make the data more accurate and reliable when we want to replicate the experiment. Therefore, additional data such as device parameters need to be included. However, a conundrum would appear, if we add another column in the CSV files just for tthe device parameters, the CSV would be more complicated and full of empty data. 

Solution: JSON

in order to store all of the experimental and its metadata (device configurations), JSON format is more appropriate as we can integrate structured and unstructured data into one. We can store both metadata as a value and experiments data as arrays. This way,  the data is more structured and we don't have to fill any empty data just like CSV.

Now the question is how do we collect and store the data? As we know, we stream the UART data to the PC using serial port. This streaming process can be passed through the local server that would log the ouput into the data. We can capture the data based on the "topic" or "key" of the object so that we can selectively choose which data to plot. 

Selecting what to plot based on topic/object key is a good approach. However, this approach is still not bulletproof as we also use the same function to measure the voltage and current in the the potentiostat. Therefore, there should be a "flag" whether the device is running the measurement or just measuring the voltage for the background voltage. Therefore, when the running flag is disable, it would record the background voltage. On the other hand, when it's enabled it would collect the data and directly plot it to the graph. After the measurement is completed, the device would update the flag to false meaning the measurement is completed and the program would save the measurement as well as plotting the graph.
 

(plotting the graph)

That's the better approach rather than adding changing some sign in the output of the potentiostat device, our current approach as it's prone to error due to interrupt during streaming the data.









Thursday, 14 May 2026

Thoughts - The transistor switches and our learning progress

Few years ago, we built a reverse-polarised electrolyser. It was one of our earliest projects in electrochemistry in which we only had basic knowledge of electrochemistry and programming. Hardware design? little to none but we tried it anyway. 

We used H-bridge to control the polarity of the electrode. In order to switch it on/off the gate, we used transistors and control them using pulse-width modulation (PWM) whose duty cycle is programmable from microcontroller. By using this approach, we can 
(H-Bridge) 
For transistor selection, we could either used bipolar junction transistor (BJT) or metal oxide semiconductor field effect transistor (MOSFET). They differ in how we control them. BJT is current-controlled and MOSFET, on the other hand, is voltage-controlled. 

Our Learning Experiences

At the time, we used BJT as switches because we thought that the current generated would not be too high. When we tested the circuit, the voltage measured wasn't the one we expected. Furthermore, when we controlled the fan using similar approach, the fan didn't spin as we expect it would. We should have used MOSFET instead of BJT.

We were concerned about the need of higher voltage to drive the MOSFET at that time, therefore we chose BJT. BJT setup was a little bit complicated as we had to consider the resistor values to set the current. We could have used MOSFET to drive the switch. When the MOSFET isn't a logic-level type, we can add BJT to drive the the MOSFET switch. The design now becomes more a little bit more complicated, but if it works? it works.

Another thing is that we used ESP8266 as a microcontroller. We used RTOS SDK as our development project. It was overkill considering the size of our project. However, from that we learn about programming embedded devices in deeper lower level. At the time, controlling 2 pins at the same time felt impossible on arduino framework (until we learned about register logic). As we used 2 pins to control the bridge, we wanted to control them simultaneously, not one at a time. It was possible to do it with the ESP SDK which made the reason why we used it. The bright side is that, our programming skill improved quite well. 

The project might have failed to deliver but looking back on how far we've learned, it was worth it. However, we cannot be complacent with where we are now. There are many things we can still achieve.

Tuesday, 21 April 2026

Devlog - Porting our library to c++

 As our efforts to make our hardware more and accessible, our open-source library was previously written only in C. We are porting our library code base to C++ to reach out more as our videos show some interests (Thank you for the support by the way). Moreover, it could reach those who use arduino framework in their development.

The porting process wasn't that difficult as AI helped us to port the codebase. We didn't take all of the AI suggestion though. The main algorithm and the memory management still uses the same approach which make the code base is still C-like. AI just helped us make the struct-driven functions to more object-oriented programming. 

We have tested the basic functionality in both conventional and in-device (raspberry pi pico using arduino framework) for our library. It works! Despite all that, the codebase is still mainly tuned to our potentiostat in which the voltage generated is subtracted by half of the reference voltage. Moreover, some conversions are still reserved to the 12-bit DAC. It's still under development and we are planning to develop it further. 

We plan to show you how we use this library using arduino framework. However, we're currently having some issues with the interrupt and ISR as we don't use AVR but instead raspberry pi pico. Therefore the whole code might not be applicable to across all boards but the fundamental at the very least is.

This is our github repo: link



Our potentiostat circuit design approach compared to a glucometer

Previously, we rebuilt a potentiostat circuit to improve our design. We built it on a breadboard as we can experiment with it. You can watch...