If you need sub-micron metal proximity detection, thickness measurement, or non-contact position sensing, the Texas Instruments FDC2214 is the industry-standard IC. To build a reliable metal sensor circuit around this chip, you wire it to your ESP32 via I2C (SCL to GPIO 22, SDA to GPIO 21), power it with a clean 3.3V supply, and convert the 28-bit raw register read into physical inductance (Henrys) using the sensor's resonant frequency equation. Unlike basic digital proximity switches, this circuit requires precise LC tank component selection and mathematical scaling to yield usable distance data.

The Inductive Sensing Principle

When an alternating current flows through a sensor coil, it generates an oscillating magnetic field. If a conductive metal target enters this field, eddy currents form on the metal's surface. These eddy currents generate their own opposing magnetic field, which effectively reduces the inductance of the sensor coil. The physical gap between the coil and the metal dictates the strength of this coupling—closer metal means stronger eddy currents and a measurable drop in inductance.

The FDC2214 does not measure inductance directly. Instead, it forms an LC resonant tank circuit with your sensor coil and a parallel capacitor. The IC excites this tank and counts the zero-crossings (oscillations) over a precise time window defined by an internal 40 MHz reference clock. By comparing the sensor's resonant frequency to the reference clock, the chip outputs a highly stable 28-bit digital word that shifts as the metal target moves, completely bypassing the noise issues inherent in analog voltage measurements.

Target Metal Characteristics and Coil Selection

The physical properties of your target metal drastically alter the sensor's range and sensitivity. High conductivity yields stronger eddy currents, while high magnetic permeability concentrates the flux lines. When designing your coil (typically a flat spiral PCB trace or a wound SMD inductor), you must match the coil diameter to the target material. A general rule of thumb is that the maximum sensing distance is roughly 50% of the coil's outer diameter for highly conductive metals, but drops significantly for resistive alloys.

Table 1: Target Metal Characteristics and Optimal Coil Pairing
Target Material Conductivity (MS/m) Rel. Permeability (μr) Min. Coil Diameter Max Sensing Range (Approx)
Aluminum (6061-T6) 25.0 ~1.0 10 mm 4.0 mm
Copper (C110) 58.5 ~1.0 8 mm 5.0 mm
Carbon Steel (1018) 6.9 100 - 200 15 mm 6.0 mm
Stainless Steel (304) 1.4 ~1.05 20 mm 2.5 mm

Note: Ferromagnetic materials like carbon steel exhibit a complex response. At low frequencies, high permeability increases the coil's inductance. At the higher operating frequencies of the FDC2214 (typically 1 MHz to 10 MHz), the eddy current effect dominates, causing the expected inductance drop. Always test with your specific alloy grade.

ESP32 Wiring and Power Delivery

The FDC2214 operates strictly on a 2.7V to 3.6V supply. Do not connect the VCC pin to a 5V rail, or you will instantly brick the IC. If you are using a standard 5V Arduino Uno, you must use a bidirectional logic level shifter for the I2C lines. For the ESP32 DevKit v1, the native 3.3V logic is a perfect match.

Bench Tip: The ESP32's internal I2C pull-up resistors are typically around 45kΩ, which is far too weak for the 400 kHz fast-mode I2C bus required by the FDC2214. Always solder external 4.7kΩ pull-up resistors from SDA and SCL to the 3.3V rail on your breakout board to prevent data corruption and I2C bus lockups.
Table 2: FDC2214 to ESP32 DevKit v1 Pinout
FDC2214 Pin ESP32 Pin Function Hardware Notes
VCC 3V3 Power Supply Supply range: 2.7V to 3.6V. Use a dedicated LDO if ESP32 3V3 rail is noisy.
GND GND Ground Keep return path short and direct to the ESP32 ground plane.
SCL GPIO 22 I2C Clock Requires external 4.7kΩ pull-up to 3.3V.
SDA GPIO 21 I2C Data Requires external 4.7kΩ pull-up to 3.3V.
ADDR GND Address Select Tie to GND for I2C address 0x2A. Tie to VCC for 0x2B.
SD 3V3 Shutdown Active low. Tie directly to 3.3V to keep the IC awake.
IN0 N/A Sensor Input Connect to LC tank. Keep PCB trace under 5mm.

Raw-to-Inductance Math and Calibration

A common point of confusion for beginners is the output signal type. The FDC2214 does not output an analog voltage or current that you can read with a multimeter or an ADC pin. The output is strictly a 28-bit unsigned digital integer transmitted over I2C, split across two 16-bit registers (Data MSB and Data LSB). To get a physical distance, you must mathematically convert this raw digital word into frequency, and then into inductance.

Step 1: Extract the 28-bit Raw Data
Read the MSB and LSB registers. The top 4 bits of the MSB register are status flags and must be masked out.

uint32_t msb = Wire.read() & 0x0F; 
uint32_t lsb = Wire.read();
uint32_t raw_data = (msb << 16) | lsb;

Step 2: Calculate Sensor Frequency (Hz)
Using the TI datasheet formula, where f_ref is your reference clock (typically 40,000,000 Hz) and RC_COUNT is the conversion time interval set in the configuration registers (e.g., 0xFFFF):

fsensor = (raw_data × fref) / (RC_COUNT × 228)

Step 3: Calculate Inductance (Henrys)
Once you have the resonant frequency, use the standard LC resonance equation. C is the value of your parallel tank capacitor in Farads (e.g., 33pF = 33e-12).

L = 1 / (C × (2π × fsensor)2)

Calibration and Scaling:
Raw inductance is rarely your final unit; you usually want distance in millimeters. You must perform a "free-air" calibration by taking the baseline inductance reading with no metal present. As metal approaches, the inductance drops. Because the relationship between distance and inductance is non-linear (it follows an inverse-cube law at close range), you cannot use a simple linear map. Record inductance values at known 0.5mm increments using a feeler gauge, then fit a 3rd-order polynomial curve in your ESP32 code to translate ΔL into physical distance.

Interference Sources and PCB Layout Rules

Inductive sensing is highly sensitive to environmental variables. If your readings are drifting or noisy, one of the following interference sources is likely the culprit:

  • Dielectric Absorption and Temperature Drift: The parallel tank capacitor is the most critical component in your circuit. Never use standard X7R or Y5V ceramic capacitors. Their capacitance shifts wildly with temperature and DC bias, which the FDC2214 will interpret as a moving metal target. You must use C0G/NP0 dielectric capacitors, which offer near-zero temperature coefficients.
  • Switching Power Supply Noise: The ESP32's onboard switching buck converter generates high-frequency EMI that can couple into the sensor coil. If you see a 10kHz-100kHz ripple on your raw data, power the FDC2214 analog section using a dedicated low-dropout (LDO) linear regulator fed from the 5V USB line, rather than the ESP32's internal 3.3V rail.
  • Parasitic Capacitance from Long Traces: The trace connecting the FDC2214 IN0 pin to the sensor coil adds parasitic capacitance to the LC tank. This lowers the resonant frequency and reduces sensitivity. Keep this trace as short as physically possible (under 5mm) and avoid routing it over split ground planes.
  • Ferromagnetic Mounting Hardware: Steel screws, brass standoffs, or aluminum enclosures located near the back or sides of the sensor coil will distort the magnetic field. Maintain a clearance zone of at least 1.5× the coil diameter around the sensor, free of any conductive or magnetic materials.

For authoritative design guidelines on LC tank component selection and coil geometry, refer to the TI FDC2214 Datasheet and the application notes on inductive sensing design rules. Proper layout and C0G capacitor selection will transform this circuit from a noisy science experiment into a sub-micron precision industrial sensor.