The Sensing Principle: Transformers with a Moving Core
A Linear Variable Differential Transformer (LVDT) is an electromechanical transducer that converts linear displacement into an electrical signal. At its core, it is simply a transformer with one primary coil and two secondary coils wound symmetrically around a hollow, non-magnetic bobbin. A separate ferromagnetic core, attached to the object you are measuring, slides freely through the center of this bobbin without making any physical or electrical contact with the coils.
When an alternating current (AC) excites the primary coil, it induces an AC voltage in the two secondary coils via mutual inductance. Because the secondaries are wired in series opposition, the net output is the difference between their voltages. When the core is perfectly centered, the induced voltages cancel out to zero. As the core moves left or right, the magnetic coupling shifts, causing one secondary's voltage to rise while the other falls. This differential output provides infinite resolution, limited only by the noise floor of your readout electronics and the mechanical play of the core shaft (Omega Engineering).
Signal Conditioning and the ADS1115 Pinout
The most critical mistake makers make with an LVDT position sensor is attempting to wire the raw sensor directly to a microcontroller's analog pin. A raw LVDT outputs a differential AC voltage. An ESP32 or Arduino cannot read this. You must pass the signal through a demodulator and signal conditioner (like the Analog Devices AD598) to convert it to a proportional DC voltage, or purchase a "DC-LVDT" which has the oscillator and demodulator built into the sensor housing.
For precision metrology, we also avoid the ESP32's internal ADC. The internal 12-bit ADC is notoriously non-linear at the extremes of its 0-3.3V range and suffers from high noise. Instead, we use an external 16-bit I2C ADC like the Texas Instruments ADS1115, which provides the stable reference and resolution required for sub-millimeter LVDT tracking (TI ADS1115 Datasheet).
Wiring and Pin Mapping Table
The following table assumes a standard industrial DC-LVDT (0-5V output, 12-24VDC supply range) interfaced through an ADS1115 breakout board to an ESP32-WROOM-32.
| Component | Pin / Wire | Connects To | Supply / Signal Range | Notes |
|---|---|---|---|---|
| DC-LVDT | Red (Power) | 24V DC Power Supply (+) | 12V to 24V DC | Do not power from ESP32 VIN. |
| DC-LVDT | Black (Ground) | Power Supply (-) & ADS1115 GND | 0V (Common Ground) | Must share ground with ADS1115. |
| DC-LVDT | White (Signal Out) | ADS1115 A0 (Single-Ended) | 0V to 5V DC | 0V = -Full Scale, 2.5V = Center, 5V = +Full Scale. |
| ADS1115 | VDD | ESP32 3V3 Pin | 3.3V | Powers the I2C logic and internal reference. |
| ADS1115 | GND | ESP32 GND & LVDT Black | 0V | Equipotential bonding point. |
| ADS1115 | SCL | ESP32 GPIO 22 | I2C Clock (3.3V) | Use 4.7kΩ pull-up to 3.3V. |
| ADS1115 | SDA | ESP32 GPIO 21 | I2C Data (3.3V) | Use 4.7kΩ pull-up to 3.3V. |
| ADS1115 | ADDR | ESP32 GND | Logic Low | Sets I2C address to 0x48. |
The Math: Converting Raw ADC Readings to Millimeters
Calibration and scaling are mandatory. A standard DC-LVDT with a ±10mm stroke outputs a 0.5V to 4.5V signal (using a 0.5V deadband at the rails to indicate fault conditions). The ADS1115, configured for a 6.144V full-scale range (FSR), will output a 16-bit integer.
Here is the exact mathematical pipeline from raw integer to physical displacement:
- Raw to Voltage: The ADS1115 single-ended reading maxes out at 32767 (15-bit positive range).
Voltage = (Raw_ADC / 32767.0) * 6.144 - Voltage to Displacement: The sensor's center point (0mm) is at 2.5V. The span is 4.0V (from 0.5V to 4.5V) representing 20mm total travel.
Scale_Factor = 20.0 mm / 4.0 V = 5.0 mm/VPosition_mm = (Voltage - 2.5) * 5.0
ESP32 Arduino Implementation
#include <Wire.h>
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads;
// Sensor calibration constants
const float ADC_FSR_VOLTAGE = 6.144; // ADS1115 gain setting
const int16_t ADC_MAX_COUNT = 32767; // 15-bit positive max for single-ended
const float SENSOR_CENTER_V = 2.5; // Voltage at 0mm displacement
const float SENSOR_SPAN_MM = 20.0; // Total stroke (+10mm to -10mm)
const float SENSOR_V_SPAN = 4.0; // 4.5V max - 0.5V min
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA, SCL for ESP32
ads.setGain(GAIN_SIX); // +/- 6.144V range (1 bit = 0.1875mV)
if (!ads.begin(0x48)) {
Serial.println("Failed to initialize ADS1115. Check wiring.");
while (1);
}
}
void loop() {
int16_t adc_raw = ads.readADC_SingleEnded(0);
// 1. Convert raw ADC to Voltage
float voltage = (adc_raw * ADC_FSR_VOLTAGE) / ADC_MAX_COUNT;
// 2. Convert Voltage to Millimeters
float position_mm = ((voltage - SENSOR_CENTER_V) / SENSOR_V_SPAN) * SENSOR_SPAN_MM;
// Fault detection (LVDTs often use 0-0.5V and 4.5-5V as wire-break flags)
if (voltage < 0.4 || voltage > 4.6) {
Serial.println("FAULT: LVDT wire break or core out of range!");
} else {
Serial.print("Voltage: "); Serial.print(voltage, 3);
Serial.print("V | Position: "); Serial.print(position_mm, 2); Serial.println(" mm");
}
delay(50); // 20Hz sample rate is usually sufficient for mechanical position
}
Defeating EMI: Interference Sources and Shielding
LVDTs are frequently deployed in harsh industrial environments near variable frequency drives (VFDs), contactors, and heavy motors. While the LVDT's differential nature inherently rejects common-mode noise, the long cable runs between the sensor and your signal conditioner act as antennas. The most common interference sources include:
- Capacitive Coupling: High dV/dt switching from nearby VFDs induces high-frequency noise onto the signal wires. This is solved by using shielded twisted pair (STP) cable. The shield must be grounded at the signal conditioner end only to prevent ground loops.
- Ground Loops: If the LVDT housing is bolted to a steel chassis, and the signal conditioner is grounded to a different chassis, 50/60Hz mains current will flow through the cable shield, corrupting the low-voltage signal. Use an isolated DC-DC converter for the sensor excitation, or ensure single-point star grounding at the ADS1115 ground plane.
- Thermal Drift: The copper windings inside the LVDT change resistance with temperature (approx. 3900 ppm/°C). If you are driving a raw AC LVDT with a simple voltage source instead of a constant-current or ratiometric drive, ambient temperature swings in a workshop will look like physical displacement. Signal conditioners like the AD598 use ratiometric decoding to cancel this out natively.
Frequently Asked Questions
How do I wire a raw AC LVDT position sensor to an Arduino without a signal conditioner?
You cannot do this reliably without external analog hardware. A raw LVDT outputs an AC waveform (e.g., 3V RMS at 3kHz). An Arduino's ADC only samples DC voltages between 0V and 5V. To interface a raw AC LVDT, you must build or buy a demodulator circuit that multiplies the secondary output by the primary excitation signal, followed by a low-pass filter to extract the DC envelope. For under $80, buying a pre-conditioned DC-LVDT or a dedicated interface IC like the Analog Devices AD598 saves days of bench debugging.
What is the typical output signal of a raw LVDT position sensor?
The raw output is a differential AC voltage. The amplitude is typically specified in millivolts per volt of excitation per unit of displacement (e.g., 2 mV/V/mm). If you apply a 5V RMS excitation at 3kHz, and move the core 5mm off-center, the differential output will be an AC sine wave with an amplitude of 50 mV RMS. The phase of this AC wave flips by 180 degrees as the core crosses the null (center) point, which is how the conditioning circuit determines the direction of travel.
LVDT position sensor vs hall effect linear sensor: which is better for my project?
Choose the LVDT position sensor when you need absolute linearity, infinite resolution, and zero friction over a long operational lifespan (e.g., CNC tool offset measurement, hydraulic cylinder feedback). LVDTs have no solid-state drift and survive extreme radiation or temperature environments. Choose a linear Hall effect sensor (like the Allegro A1324) when you are constrained by budget (under $5 vs $150+), physical size, or need a simple 3-pin analog output without external power supplies. Hall sensors suffer from temperature drift and magnetic hysteresis, making them unsuitable for metrology-grade positioning.






