3
\$\begingroup\$

I am looking at this schematic from Nuts and Volts of a semi-auto ranging capacitance meter, which I will eventually hook up to an Arduino or some other microcontroller. Its range is 0.1F–0.01µF, but I am trying to get a range of 200µF–20pF.

Schematic simulation on LTSpice

  1. What should be added/modified in the original 555 circuit to get this range?
  2. What can an Arduino do to calculate capacitance?

I simulated this on LTspice, and you measure from 6/7 on the One-Shot timer to see the charging voltage.

Any help is greatly appreciated.

\$\endgroup\$
2
  • \$\begingroup\$ The article uses switches to change range. Analog switches or MOSFETs controlled by micro would select your different ranges. \$\endgroup\$ Commented Jul 18 at 6:42
  • 1
    \$\begingroup\$ Be aware that parasitic capacitances in a typical measurement setup can easily be tens of picofarads, even hundreds if poorly laid out. You'll need a way to cancel out parasitics if you want accurate readings below a nanofarad or so. \$\endgroup\$ Commented Jul 18 at 13:23

2 Answers 2

2
\$\begingroup\$

There are very many ways to approach this: this is just one way described concretely.

Although it's certainly possible to measure analogue voltages on many microcontrollers (including those used in Arduinos), it's usually a lot easier to deal with timing directly.

The Nuts and Volts circuit consists of three parts: the one-shot which generates a pulse based on the unknown capacitance and known resistance, a circuit (to the right of output pin 3) to turn that into a voltage to measure on your meter, and an oscillator (left of input pin 2) to keep doing this repeatedly.

To do this with a microcontroller, let's keep the one-shot and its mechanism, but send start pulses (red) from a GPIO output, and time the resulting pulse (green) on a GPIO input. You can use one of the timer circuits or any number of mechanisms for timing a pulse. If you've never done it, timing with a busy-wait is worth doing once just to see why it's a bad idea. Run it not from 12V but 5V for a 5V microcontroller. (If you have 3.3V microcontroller, find a 555 variant which runs on that voltage.)

schematic

simulate this circuit – Schematic created using CircuitLab

Choosing the component values: the datasheet for the 555 gives the duration of the pulse as t = 1.1 RC. Suppose we want pulses around 10 ms (as being easy to measure), we can then calculate the resistors for the various ranges:

C R t
100 µF 100 Ω 11ms
10 µF 1 kΩ 11ms
1 µF 10 kΩ 11ms
100 nF 100 kΩ 11ms
10 nF 1 MΩ 11ms
1 nF 10 MΩ 11ms Dubious accuracy, use 1MΩ (1.1ms)
100 pF 100 MΩ 11ms Very dubious accuracy, use 1MΩ (110µs)

You are likely to find that accuracy is poor to terrible at the extremes, and you may wish to make your timing longer or shorter as appropriate.

enter image description here
From TI NE555 datasheet

\$\endgroup\$
4
  • \$\begingroup\$ You should probably link to the source of that graph. You can't use N-channel MOSFETs to switch the resistors, those would basically be just source-followers, unless you apply gate potentials far exceeding \$V_{CC}\$, which GPIO outputs will not do. P-channel would work though. \$\endgroup\$ Commented Jul 18 at 11:37
  • \$\begingroup\$ According to the TI NE555 datasheet trigger and threshold pin currents are around 1μA, close to capacitor current \$\frac{5V}{10M}=0.5μA\$. Any \$R_A\$ over 1MΩ is going to have terrible accuracy, so for certain ranges it would be necessary to stick to 1MΩ and measure 1ms pulse times or shorter. It surprises me that there's even a plot for 10MΩ on that graph. \$\endgroup\$ Commented Jul 18 at 11:37
  • \$\begingroup\$ @SimonFitch many thanks. Graph: clarified. Mosfets: changed, does it read okay now? Accuracy: indeed, clarified a bit. \$\endgroup\$ Commented Jul 18 at 11:56
  • \$\begingroup\$ That looks like it would work, yes. I also wrote my own answer, which does away with the 555 altogether, but it uses BJTs where your MOSFETs are. I don't think channel leakage current would be as bad as the datasheets say (1μA), but it could be a problem on the 1MΩ range. \$\endgroup\$ Commented Jul 18 at 13:16
2
\$\begingroup\$

There are issues using the NE555 related to threshold and trigger pin currents up to 1μA or so, so capacitor current would have to be significantly larger than 1μA. This makes the NE555 inappropriate for measuring capacitances under 10nF. A CMOS version of the 555, like the 7555, would fare much better.

Using an Arduino (or some kind of microcontroller, MCU) directly removes any need for a timer IC.

A capacitor \$C\$ charging through a resistor \$R\$ will take \$R\times C\$ seconds to reach 63% of its final voltage. This is easy to see in a simulation:

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

V1 applies +5V across R1 and C1 at 2ms. At 3ms, exactly \$\Delta t = R_1C_1 = 1ms\$ afterwards, capacitor voltage \$V_Y\$ reaches \$63\% \times 5V = +3.16V\$. If you can use an MCU to apply those 5V, and time how long it takes for the capacitor to reach 3.16V, then you have the basis for a system to measure capacitance.

Before you get too excited, accurately measuring under 1nF is going to be difficult to impossible using such a simple system, because parasitic capacitances can easily be many tens of picofarads. Even the wiring to the capacitor under test will heavily influence the measurement. Simply having your hand near the capacitor and its wires while measuring is enough to ruin accuracy.

You'll need a way for the MCU to select resistor R1, and a means of discharging the capacitor quickly. Here's what I suggest:

schematic

simulate this circuit

I wouldn't recommend using MOSFETs to switch the resistances, because each could have up to 1μA of leakage current, which would become problematic at very low currents, similar to the problem of input currents on the 555. BJTs have lower collector leakage current, but also have \$V_{CE}\$ not-quite-zero when saturated. It's a trade-off - I think leakage current is a bigger problem for small capacitances.

The capcitor under test is Cx.

The MCU will first discharge the capacitor by bringing OUT4 high, and waiting a second or so. It's a bit hit-and-miss how long it would take to discharge the capacitor, you could use another comparator, and another input to detect when capacitor voltage falls under 0.1V or so.

Then select which transistor Q1, Q2 or Q3 to switch on, by bringing OUT1, OUT2 or OUT3 low. Time how long it takes for CMP1 output to go high (perhaps use an interrupt to halt a timer-counter).

This gives you time constant \$\tau=R_XC_X\$, from which you can calculate \$C_X\$. I estimate that you'll not get better than 5% accuracy using this technique, but I would wager that it's more accurate than using the 555 timer IC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.