Michael Faraday's experiment to demonstrate inductance in 1831, engraving from Magnetism and Electricity by Arthur Poyser (1892). Primary coil (A) attached to battery (on right), secondary coil (B) attached to galvanometer (C).

Inductance is a key part of many technologies in daily life, for example:

  • charging - electric toothbrushes, the latest smartphones and some wireless, in-ear headphones;
  • heating - induction cooking with metal cookware;
  • communication - contactless smartcards using NFC, RFID tags and traditional tuning circuits for radios;
  • power supplies - transformers reduce the mains AC voltage to a more practical level;
  • metal detection - airport security, automatic car park exit gates, pipe/cable finders and hunting for treasure.

Leon Theremin's The Thing is an interesting, minimalist example of a resonant cavity microphone, the equivalent of using an inductor for LC tuning, an application of band-pass filtering.

Inductance and Permeability

A current flowing produces a magnetic field around it. Inductors are electrical components designed to store energy in that magnetic field. These are typically coils and often wrapped around a core. The magnetic field can be affected by:

  • the material it passes through, this property is referred to as magnetic permeability;
  • the presence of a conductor nearby changing the effective inductance of the coil from the induced eddy currents in that conductor creating their own magnetic field;
  • other magnetic fields.

These first two properties make the inductor useful for detecting conductive objects.

MAKE Presents: The Inductor is an excellent video introduction to inductors by Collin Cunningham.

Metal Detection

The effect of nearby conductors on an inductor makes them a useful component for detecting metal. A classic implementation of this in electronics uses heterodyning where the beat frequency from mixing an inductor-based search oscillator with a reference oscillator is output to headphones.

Beat Frequency From An Oscillator Pair

The schematic on the left from R.M. Marston's 20 Solid State Projects For The Home (1969) shows a transitor-based detector with two colpitts oscillators. One oscillator uses the search coil and the other a tuneable reference coil which the users adjust to reduce the beat frequency audio output to near 0Hz away from the target material.

RLC Filters

Filters can easily be created with a resistor (R), an inductor (L) and a capacitor (C). There are a variety of configurations of RLC filters and many of them could be used to filter the square wave output from a microcontroller which could then be sampled to check the attenuation of the filter which would vary with the inductance.

An initial test of this approach with an Adafruit CLUE and a low-pass filter didn't yield promising results. The plots below show theoretical plots for a band-stop (notch) filter made with a resistor and a parallel LC circuit which might be worth exploring.

Bode plot for a band-stop (notch) passive R-LC filter. The different lines are for various resistor values. The animation varies the inductance to show the frequency shift.

The lower resistor values might not be practical as they put a higher current demand on the GPIO port.

The annotated linear plot below is better for seeing how this attenuation could potentially be used to detect small variations in inductance.

A linear plot with an example measurement of signal magnitude at a specific frequency as the inductance varies.

This would require sampling the 989Hz signal to determine the attenuation by the filter. A high inductance is attractive here as it will lower the frequency making the determination of the attenuation more accurate.

A frequency sweeping approach is an alternative for finding the frequency of the filter. This is likely to be slower but it would be less ambiguous. A simple measurement approach at one frequency, say 2.741V, corresponds to two frequencies and therefore two different inductance values.

Charging a Capacitor with RLD

An Arduino-based project on Instructables uses an RL circuit with the output rectified with a diode which then charges a capacitor. The steps in the measurement of the inductance are:

  1. A few pulses are output through the circuit to charge the capacitor. A higher inductance will result in a higher final voltage across the capacitor.
  2. An analogue input then measures the capacitor's voltage with over-sampling aiming to improve the accuracy.
  3. The analogue input is changed momentarily to output mode to empty (sink) the charge from the capacitor.

A C++ program (sketch) on the Arduino Uno offers precise timing. This is essential for this approach to give accurate results for the inductance.

In CircuitPython, the pulseio library can be used for creating PWM signals and pulse trains with microsecond precision. In general, as an interpreted language with garbage collection, it does not offer precise timing. The unpredictable delay between step 1 and step 2 is likely to affect the final accuracy of the measurement causing sporadic, spurious indications.

Continuous Charge/Discharge with RLD

The previous approach can be used in a continuous fashion where a constant series of pulses flow through the RLD. A circuit diagram from the Falstad Circuit Simulator is shown below.

Circuit simulation of the continuous charging approach. The 200 milliohm resistor represents the parasitic resistance of the coil. The 400k is an estimate of the input impedance of the GPIO in analogue input mode. (This is a short animated loop hence the incorrect current flow on the right side of the diode.)

This design could be considered as an RL filter with an envelope detector.

The value of the capacitor affects how quickly it discharges. A tiny capacitance will cause a rapid discharge causing a ripple which may reduce the accuracy or complicate the voltage measurement. A large capacitor value will take time to charge and discharge and this could make the sensing unresponsive.

A value of 0.1uF (which can be written as 100nF) was chosen from experimental testing. For comparison, a simulation with 100pF (top left) shows a very undesirable 197mV of ripple whereas 0.1uF only has ~1mV ripple.

A small amount of steady voltage drop around 1mV is actually useful here to ensure over-sampling is an effective technique to improve the resolution. In the (unlikely) absence of noise or variation, a theoretically perfect analogue to digital converter (ADC) would output the same value repeatedly for a constant voltage. The ADC Analysis page takes a closer look at this.

Two Coil Systems

Modern metal detectors using the induction balanced approach use two, often partially overlapping search coils. One is used for transmitting and one for receiving. A relatively small overlap will create a section with increased sensitivity. These detectors can discriminate to some extent between metals by reporting on the phase difference between the transmitted and received signal. This is typically presented to the user as a numerical value with different ranges giving an approximate identification. Garrett's chart for their AT Pro metal detector is shown below.

Garrett AT Pro metal detector numeric target identifier chart.

CLUE Metal Detector

Some initial testing of the Continuous Charge/Discharge with RLD approach worked well so this was selected for the project.

The CLUE has an onboard LIS3MDL, a triple-axis magnetometer. This is a useful addition for finding magnets and magnetised items.

This guide was first published on May 13, 2020. It was last updated on May 13, 2020.
This page (Design) was last updated on Jul 11, 2020.