Read all the "RC Circuits Transient Analysis with Raspberry Pi and Scoppy" series:

In the third episode we are going to do some measurements and data analysis.

Scoppy Setup

In the previous episode we built out circuit using the following nominal values:

  • \(R = 220 \Omega\) as the resistance value
  • \(C = 10 \mu F\) as the capacity value

so the Time Constant will be:

$$\tau = 220\,\Omega \times 10\,\mu\text{F} = 2.2\,\text{ms}$$

This means that, if the square wave will have a frequency of \(10\,\text{Hz}\) (\(T=100\,\text{ms} \gg 2.2\,\text{ms}\)) we should be able to observe full charge and discharge curves.

When powering up the Pico, the 22 Pin will send a test signal, which is a 1 kHz square wave:

RC Circuit

The signal generator can be customized from the Scoppy App: MENU / SIGNAL GENERATOR. From there you have to set the following values:

  • Signal Type: Square
  • Frequency: 10 Hz

Once everything is correctly set up you should see a nice signal on Scoppy:

RC Circuit

If you do not see the correct signal (or no signal at all), try the following:

  • verify the connection between Scoppy and Pico (either USB or Wi-Fi)
  • verify that the components are securely connected to the breadboard
  • verify polarization
  • verify that the ground is connected

Measurements

Scoppy, like any oscilloscope, has built-in cursors to help you take time and voltage measurements with great precision:

RC Circuit

This is how I use them:

  • place the first cursor at the beginning of the event (charge or discharge)
  • the second cursor will be used to gather data as difference between the two:
    • \(\Delta X\): x-axis measures time
    • \(\Delta V\): y-axis measures voltage

As you can see from the screenshots, the signal (at least in my case) was perfectly clean with no visible noise. For this reason I decided to keep the uncertainty at minimum using the resolution of Scoppy cursors, i.e.:

\begin{align*} \delta_{V_C} & = \pm 0.01 V \text{ (uniform)} \\ \Rightarrow \sigma_{V_C} & = \frac{\delta_{V_C}}{\sqrt{3}} = 0.0057 V \sim 0.006 V \end{align*}

Data Analysis

The analysis will focus on the Charge Phase.

With the multimeter I measured the following actual values for resistor and capacitor:

\begin{align*} R & = 222 \Omega\\ C & = 10.33 \mu F \end{align*}

Then I loaded the data in a Jupyter notebook and performed a fit using iminuit package, leaving \(\tau\) as the only free parameter and an initial estimate of \(\tau_0 = 2.2 ms\).

The iminuit fit has found the following parameters:

\begin{align*} \tau_\text{fit, ideal} & = 2.786 \pm 0.003 ms \\ \chi_\text{rid} & = 93.8 \end{align*}

The following chart compares the curve that fits measured values vs the theoretical model (see 1 - Introduction):

RC Circuit

Clearly there's something not quite right: the dashed green curve sits above the fitted curve, and the residuals (the bottom part of the chart) show a peculiar structure. Also, a \(\chi_\text{rid} = 93.8\) is a clear symptom of a problem with the model.

So the model is promising (the curve has "the right shape") but some parameters have been underrated. The most important thing to check first is parasitic resistance of the GPIO. On the user forums I've found that a typical value would be around \(40-50 \Omega\)

The following new model takes in account for this parasitic resistance \(R_\text{Pico}\):

$$ V_C(t) = V_g\left(1 - e^{- \frac{t}{(R + R_\text{pico})C}}\right) $$

This time in the fit I clamped \(R\) and \(C\) to their measured values, and left iminuit handle \(R_\text{Pico}\) as free parameter. The fit came back with a promising value for \(R_\text{Pico}\):

$$ R_\text{pico} = 47.7 \pm 0.3 \Omega $$

which is compatible with the above statement from other Pico users (\(R_\text{Pico} \sim 40-50 \Omega\))

Chart:

RC Circuit

This new reparametrization does not fix the statistical problem (\(\chi_\text{rid} = 93.8\)), but it gives us a physical explanation of the bias introduced by the GPIO parasitic resistance, making it possible to design and implement more precise experiments that can rule out other biases in the circuit.

Next Steps

In the next article (4 - Further Experiments) we will explore further possibilities of this setup.