Close
0%
0%

Turning Cheap Audio Chips into Industrial TDR

Turn a $3 USB soundcard into a cm-accurate industrial TDR. We use DSP and formal logic to find automotive wire faults for under $5.

Similar projects worth following
The Problem
Automotive wire fault detection (like CAN-bus) usually requires expensive industrial Time Domain Reflectometers (TDR). We built a low-cost, accurate alternative using a standard USB soundcard, a passive interface, and deterministic math.

The Concept
Instead of pulse-based time-of-flight, TraceVena sends a 4kHz/8kHz sine wave down the cable. Using the soundcard's ADC, we measure the phase shift caused by the cable's parasitic capacitance to calculate distance.

The Hardware & Software
To safely connect a PC to a 12V harness, we built the TraceVena V1 perfboard interface. It uses an SPDT switch for range selection (13 kΩ for long cables, 1 MΩ for short wires) and a hardware firewall (1 µF film capacitor and 3.3V Zener diodes) to block DC voltage and AC spikes. Our software processes the raw audio via a Goertzel algorithm and Float64 precision, converting phase shift into cm-accurate distance.

1. The $10,000 Problem in Automotive Diagnostics

Finding a broken wire or a short circuit in a modern automotive wiring harness (such as a CAN-bus network) is incredibly frustrating. Mechanics usually face two choices:

  • Strip the entire dashboard and manually trace the wires (guessing and checking).
  • Buy a proprietary, industrial Time Domain Reflectometer (TDR) that can easily cost upwards of $10,000.

We wanted to democratize this process. We realized that the hardware required for precise signal processing is already mass-produced and sits on everyone's desk: a standard USB sound card.

2. The Core Hack: Audio-Driven TDR

Traditional TDRs send a sharp electrical pulse down a wire and measure the time it takes for the echo to return (Time-of-Flight). This requires very fast, expensive hardware to measure nanosecond differences.

TraceVena takes a completely different approach. We use cheap C-Media USB audio chips, which have surprisingly robust ADCs and DACs optimized for audio frequencies. Instead of a pulse, we transmit a continuous 4kHz or 8kHz sine wave down the suspect cable. We then "listen" to the reflection. The parasitic capacitance of the cable causes a minute phase shift in the sine wave. By measuring this phase shift, we can calculate the distance to the fault.

3. Hardware Architecture (The Frugal Interface)

You cannot plug a car's 12V or 24V electrical system directly into your laptop’s microphone jack. To make this work safely, we designed a minimalist, $5 analog interface (currently built on a perfboard) that acts as a hardware firewall and measurement bridge.

Key Components of the Interface:

  • The Measurement Bridge (SPDT Switch): We use a toggle switch to change the measurement range. The "AUTO" mode uses a 13 kΩ resistor (R2) for long, high-capacitance automotive cables. The "PREC" mode uses a 1 MΩ resistor (R3) for short, micro-pF precision wires.
  • The DC Blocker: A 1 µF Film Capacitor (C1) sits right at the input. We specifically use film (not ceramic) because its capacitance remains perfectly stable regardless of the voltage. It blocks 12V/24V DC from frying the system, allowing only the AC measuring signal to pass.
  • The Overvoltage Protection: Two 3.3V Zener Diodes (D1, D2) are placed back-to-back to instantly clip any high-voltage AC spikes before they reach the soundcard.

4. The Software Brain (MetaSpace Engine)

When pushing a signal through a 1 MΩ resistor, the return amplitude drops massively, approaching the quantization noise floor of a cheap soundcard. A standard audio driver would just treat this as background noise.

To solve this, we bypass standard audio processing. Our custom software engine uses Float64 precision and a highly optimized Goertzel algorithm to extract the exact phase of the 4kHz/8kHz signal from the raw audio bitstream.

More importantly, the software uses deterministic logic (via the Z3 SMT solver). It dynamically calibrates itself to the parasitic capacitance of the hardware firewall (the capacitor and diodes), setting that as the absolute 0.00 cm baseline. If the signal-to-noise ratio drops too low, the formal verification layer acts as a fail-safe: it formally proves the measurement condition is unmet rather than wildly guessing in the noise.

5. Next Steps

We are currently soldering the final V1 perfboard prototypes and preparing to take them out to the garage for real-world field tests on actual damaged vehicle harnesses. Stay tuned for the project logs!

  • Log #2: The Software Pivot - Moving to "Automotive Scale"

    László SZŐKE4 小時前 0 comments

    The Hardware Wall (and How We Broke Through It)

    Now that the V1 Interface is soldered and we're safely using the 13 kΩ resistor (Automotive Bridge) to protect the soundcard, we hit a massive software wall.

    When you push an audio signal through a 13 kΩ resistor and look for the reflection from a wiring harness, the returning signal amplitude (Magnitude) drops into the $10^{-5}$ range. That’s deep below the noise floor of a standard Realtek soundcard. The previous software version treated this return signal as a hardware error. We had to completely pivot our DSP architecture.

    MetaSpace v8.0 Architecture: The "Statistical Shield"

    To solve the noise problem, we restructured the MetaSpace engine into six independent, professional-grade modules. The most critical upgrade was creating what we call the "Statistical Shield":

    1. Massive Integration Windows: We ditched standard audio processing. The DSP engine now uses a vector-averaged Lock-in amplifier with a massive 16,384 sample window to integrate the signal out of the noise floor.
    2. Atomic-Sync: To combat the inherent jitter of Windows/Realtek drivers, the measurement now starts with a synchronous chirp. This "Atomic-Sync" cancels out jitter with fractional-sample precision, allowing the software to know exactly when the physical response begins.
    3. Deterministic Stability: Even on consumer soundcards, we achieved a measurement stability of 0.0001 radians (~0.005 degrees).

    Real-World Validation: It Works!

    We empirically calibrated the V8 engine using a 60 cm precision cable, and the results are incredibly promising:

    • OPEN (Wire Break): The system reliably measures the phase shift caused by parasitic capacitance, resolving the 60 cm cable with 1 cm resolution.
    • SHORT (Short Circuit): When the signal collapses completely (Magnitude drops below the noise floor), the deterministic logic refuses to guess. Instead of outputting random numbers, it correctly identifies the state as a SHORT and flags it as unlocalizable.

    What's Next?

    The core http://localhost:8080 engine is stable. The next step is macroscopic field testing: taking the hardware out to the garage and testing it on actual 3 to 6-meter automotive wire harnesses to measure larger phase jumps (0.3 - 1.5 rad).

  • Log #1: From a Janky TRRS Prototype to the V1 Perfboard

    László SZŐKE5 小時前 0 comments

    The Ugly Truth Behind the Math 

    Up until now, the TraceVena MetaSpace software engine (with all its Float64 precision and Z3 deterministic proofs) has been running on what can only be described as a "janky" hardware setup.

    To prove the core concept of audio-driven TDR and phase-shift measurement, I didn't have a fancy board. I literally used a raw TRRS jack, twisted a bare 13 kΩ resistor onto the wires, and plugged it straight into my soundcard. No hardware firewall, no Zener diodes, no mode switching. Just pure, unprotected proof-of-concept spaghetti wiring.

    It worked beautifully to validate the math and the Goertzel algorithm extraction, but let's be honest: taking an unprotected TRRS jack and clamping it onto a live automotive wiring harness is basically begging for a blown laptop motherboard.

    Building the First "Real" Interface Now that the software logic is solid, it's time to build the hardware that matches the schematic I posted in the project details. Today, I'm firing up the soldering iron to assemble the TraceVena V1 Universal Interface on a proper perfboard.

    The goals for this build session:

    1. Adding the Switch: Installing the SPDT toggle so I can physically switch between the Automotive Mode (13 kΩ) and the Precision Mode (1 MΩ).
    2. Building the Firewall: This is the most crucial part. I'm soldering the 1 µF film capacitor (for DC blocking) and the back-to-back 3.3V Zener diodes. This is the "armor" that will let me safely probe 12V/24V systems without frying the C-Media audio chip.
    3. Proper Connectors: Moving away from the twisted TRRS nightmare to clean, dedicated input/output TRS male plugs and proper alligator clips.

    I'll post photos of the soldered perfboard once it's done. If the hardware firewall calibrates correctly in the software (setting our parasitic 0.00 cm baseline), we are ready for actual garage field tests.

    Time to warm up the soldering iron!

View all 2 project logs

Enjoy this project?

Share

Discussions

László SZŐKE wrote 4 小時前 point

Hi everyone! Thanks for checking out TraceVena.

I’m currently moving from my 'janky' TRRS prototype to the V1 perfboard. The biggest challenge I’m facing is the 1 MΩ measurement bridge; pushing a sine wave through that much resistance puts the return signal right at the quantization noise floor of a standard C-Media ADC.

I’m using a massive 16,384-sample integration window and a Z3-based fail-safe to prove the phase shift, but I’d love to hear your technical critique on the analog front-end. Specifically, do you think the 1 µF film cap and back-to-back Zeners will introduce too much parasitic drift for cm-accurate TDR, or is my software-based baseline calibration enough to compensate?

Looking forward to your thoughts and 'destructive' criticism!

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates