Mission Brief
The LIDAR Distance Gauge is a fully synthesized FPGA instrument built in SystemVerilog RTL on a Digilent Cmod A7 35T. It reads real-world distance from a Garmin LIDAR Lite v3 PWM sensor, processes the signal through an 8-module hardware pipeline, and physically drives an automotive-style x27.168 gauge needle — no processor, no firmware, only synthesized logic.
The project evolved through three milestones: proving motor control on a Basys3, migrating to the Cmod A7 with live LIDAR input, and combining both into a fully calibrated real-time instrument. The Cmod A7's 12 MHz clock required recalculating every timing constant that the 100 MHz Basys3 had established.
Team: Mouhameth Ba · George Alabi · Denver Hoj | Course: ECE Digital Systems Design / FPGA Lab | Submitted: April 30, 2026
Signal Pipeline
PWM out
metastability
pulse → cm
64-sample avg
cm → step
homing / run
position ctrl
coil signals
needle position
Every stage is a distinct synthesizable module. The LIDAR's asynchronous PWM is safely crossed into the 12 MHz clock domain by a two-flop synchronizer. A 64-sample moving average removes jitter. A ±2-step deadband in the FSM suppresses noise without masking real movement.
The filtered distance also drives bin_to_bcd → seg7_mux_driver in parallel — the 4-digit 7-segment display shows the numeric distance while the needle tracks position simultaneously.
RTL Modules
Timing Calculations
Critical Migration: The Basys3 runs at 100 MHz; the Cmod A7 at 12 MHz. Every module that counts clock cycles encodes a frequency assumption. Missing a single recalculation produces a gauge that moves the wrong amount for any distance — physically plausible but numerically wrong, the hardest category of hardware bug.
| QUANTITY | CALCULATION | RESULT |
|---|---|---|
| Clock frequency | Cmod A7 system clock | 12 MHz |
| Clock period | 1 / 12 MHz | 83.33 ns |
| Clocks per µs | 12 MHz × 1 µs | 12 clocks |
| LIDAR scale factor | 10 µs/cm × 12 clocks/µs | 120 clocks/cm |
| 50 cm pulse count | 50 × 120 | 6 000 clocks |
| 100 cm pulse count | 100 × 120 | 12 000 clocks |
| Step tick divider | 12 MHz / 240 sps | 50 000 clocks/step |
| POR hold time | 8 cycles × 83.33 ns | ~667 ns |
Hardware Gallery
Photos and demo video of the physical build will live here — Cmod A7, LIDAR sensor, TB6612FNG driver, gauge assembly, and wiring. Replace the placeholders below with your actual files when ready.
Recommended: MP4, autoplay muted loop, border-radius:12px, width:100%