Deep JSCC for Visible Light Communication

Hardware-in-the-loop Deep JSCC transmitting semantic features via analog light intensity using a custom 8-bit R-2R DAC.

A hardware-in-the-loop Deep Joint Source-Channel Coding (Deep JSCC) Visible Light Communication (VLC) system developed for ELEC4010: Introduction to Microelectronics at VinUniversity.

Unlike traditional digital communication that transmits raw binary bitstreams (0s and 1s) over discrete modulation schemes, this system compresses high-dimensional images into semantic latent representations (k = 16) using a Deep Convolutional Autoencoder and transmits them directly as analog light intensities via a custom-built 8-bit R-2R resistor ladder DAC, op-amp buffer, and BJT emitter-follower driver.

Course:
ELEC4010 Microelectronics
Hardware Architecture:
8-bit R-2R DAC + LM358 + 2N2222
Compression Ratio:
98% (~49× payload reduction)
Transmission Speedup:
~50× faster than UART

Project Links & Documentation:


🎥 Live Demonstration: End-to-End Optical Transmission

The video below demonstrates the complete end-to-end hardware-in-the-loop system in action. A transmitter PC encodes handwritten digits into 16 analog symbols, sends them through the 8-bit DAC and LED driver over free-space light to a TEMT6000 photodetector, and the receiver PC reconstructs the digit in real time:

Video 1: Hardware-in-the-Loop VLC Demo — Real-time transmission of handwritten digits from the transmitter PC to the receiver PC via analog light intensity modulation.


1. Motivation: Analog Deep JSCC vs. Brittle Digital Transmission

Traditional Visible Light Communication (VLC / Li-Fi) systems transmit digitized bits using binary modulation techniques such as On-Off Keying (OOK) or Pulse Amplitude Modulation (PAM). For image transmission, raw pixels are digitized into hundreds or thousands of bytes:

  • Transmitting a single 28 × 28 grayscale image (e.g., MNIST) requires 784 bytes (6,272 bits).
  • In low Signal-to-Noise Ratio (SNR) or turbulent optical conditions, a single corrupted bit can cause catastrophic bit errors or desynchronization (the “cliff effect”).

The Deep JSCC Paradigm:
Rather than separating source compression and channel coding, our system uses a Deep Convolutional Autoencoder to jointly compress the source image and encode it into continuous semantic features (k = 16). Each feature is mapped directly to a continuous analog light intensity. When channel noise occurs, the reconstructed image experiences smooth, graceful degradation rather than total structural failure.

Figure 1: End-to-End System Architecture — The transmitter neural encoder compresses the 784-pixel input image into a 16-dimensional latent vector, which is converted to analog light intensities by the 8-bit DAC and transmitted over the optical channel to the receiver neural decoder.

Benchmarking: Analog JSCC vs. Traditional Digital UART

Metric Traditional Digital Transmission (UART) Proposed Analog Deep JSCC
Data Representation Raw Pixels (Digital Bits) Latent Semantic Features (Analog Voltages)
Payload Size 784 bytes 16 analog symbols
Channel Symbols 6,272 bits (1 byte/pixel) 16 physical optical pulses
Noise Resilience Brittle (single bit-error corrupts pixel) Robust (graceful degradation)
Transmission Speed 1× (Baseline) ~50× faster
Bandwidth Savings Baseline (0%) ~98% compression

2. Microelectronics Circuit Design & Hardware Implementation

The hardware layer converts parallel 8-bit digital words from an Arduino into precise, continuous analog optical levels across three tightly coupled circuit stages:

Figure 2: System-level block diagram showing the 8-bit R-2R ladder, op-amp buffer, BJT LED driver, and the optical channel.

Circuit Topology & Stage Breakdown

  1. 8-bit R-2R Ladder Network:
    Constructed from precision 1% metal film resistors (R = 1 kΩ, 2R = 2 kΩ). Driven by 8 digital GPIO pins (0–5 V), the ladder produces 256 discrete analog voltage steps:
\[V_{\text{DAC}} = V_{\text{ref}} \sum_{i=0}^{7} \frac{b_i}{2^{8-i}} = 5\,\text{V} \times \frac{D}{255}\]

with an ideal step size (LSB) of V_LSB = 5 V / 256 ≈ 19.53 mV.

  1. LM358 Op-Amp Voltage Follower (Buffer):
    The raw output impedance of an R-2R ladder equals R = 1 kΩ. Connecting a load directly causes substantial voltage sag. Feeding $V_{\text{DAC}}$ into an LM358 op-amp configured as a unity-gain buffer ($V_{\text{out}} = V_{\text{in}}$) provides near-infinite input impedance (> 1 MΩ) to prevent loading, and low output impedance to drive the subsequent stage.
  2. 2N2222 BJT Emitter-Follower LED Driver:
    Standard op-amps cannot supply high continuous drive currents. The buffered analog voltage drives the base of a 2N2222 NPN BJT in emitter-follower configuration. With current gain β ≈ 100–300, the emitter supplies proportional current through a high-brightness Blue LED.
  3. Isolated Optical Channel & TEMT6000 Receiver:
    The transmitter LED and TEMT6000 phototransistor receiver are aligned within a light-shielded cylindrical optical tube to eliminate ambient room lighting interference. The sensor’s analog output is sampled by the receiver’s ADC.
Figure 3: Conceptual 4-bit R-2R ladder DAC schematic with op-amp buffer.
Figure 4: Complete schematic of the 8-bit R-2R DAC with LM358 buffer and 2N2222 LED driver.

Simulation & Experimental Hardware Setup

Prior to breadboard fabrication, the ladder and buffer stages were simulated in PSpice to verify step uniformity and monotonicity:

Figure 5: PSpice transient simulation results showing a 4-bit binary counting sequence producing a discrete, linear staircase output.
Figure 6: Experimental benchtop setup featuring the transmitter workstation, breadboard R-2R DAC and LED driver, optical isolation tube, and receiver workstation.

3. Physical Channel Characterization & Differentiable Learning

Real optical hardware deviates substantially from textbook linear models. Accurately characterizing physical non-linearities and embedding them into the deep learning pipeline was essential for reliable communication.

Physical Non-Linearity & Noise Analysis

To model the physical link, we collected an empirical dataset of 5,000 samples (final_merged_dataset.csv) sweeping DAC input values from $0$ to $255$ and recording photodetector ADC responses:

  1. Non-Linear Transfer Characteristic:
    The Blue LED requires a threshold voltage (V_th ≈ 2.7 V) before conducting significant current. Below D ≈ 120, the LED emits negligible light (dead zone). At high DAC values (D > 180), current saturation and phototransistor non-linearity cause response flattening.
  2. Heteroscedastic Hardware Noise:
    Analysis revealed that noise is heteroscedastic — the standard deviation σ_noise is not constant but scales with optical intensity (shot noise and optical fluctuations dominate at higher illumination).
Figure 7: Empirical transfer function of the optical channel (DAC input vs. Photodetector ADC output), showing the turn-on dead zone, active linear region, and saturation.
Figure 8: Hardware noise analysis — Residual error distribution (Left) and heteroscedastic noise standard deviation scaling with signal amplitude (Right).

Dynamic Waveform Validation

Oscilloscope measurements across multiple dynamic input trials confirmed high signal stability (consistent period $\approx 4.9\,\text{ms}$), discrete quantization steps, and monotonicity across full sweeps:

Figure 9a: Trial 1 — Quantization steps visibility.
Figure 9b: Trial 2 — Signal stability verification.
Figure 9c: Trial 3 — High-frequency consistency.
Figure 9d: Trial 4 — Strict monotonicity ramp check.

Channel Linearization & Differentiable Approximation

To enable gradient-based backpropagation through the physical channel:

  1. Channel Linearization (createlinear.py):
    We isolated the monotonic, high-sensitivity operating regime (D ∈ [140, 170] corresponding to V ∈ [2.74 V, 3.33 V]) and constructed an optimal mapping table (good_dac_map.json).
  2. Differentiable Channel Layer (real_channel.py / trainlinear.py):
    During training, the PyTorch autoencoder uses a differentiable hardware-in-the-loop simulation layer that applies the empirical transfer function and heteroscedastic noise distribution. This allows the neural network to learn feature encodings that are inherently robust to optical non-linearities and physical noise.
Figure 10: Histogram distribution of DAC values generated by the neural encoder across the test set, demonstrating optimal utilization of the linear operating window.

4. Experimental Results & Performance Evaluation

The end-to-end system was evaluated on the MNIST dataset using a latent dimension of k = 16.

Semantic Reconstruction Quality

Despite compressing 784 image pixels into just 16 analog light pulses (98% compression), the receiver neural decoder faithfully reconstructed digit semantics, stroke continuity, and morphology under real physical channel noise:

Figure 11: Experimental transmission results — Original MNIST digits (Top row) versus Reconstructed digits received through the physical analog VLC channel (Bottom row).
Figure 12: High-resolution side-by-side reconstruction validation across multiple digit classes.

Power Consumption Analysis

To measure current consumption through the R-2R network without breaking the circuit, the Voltage Drop method was applied across individual branches:

  • Total current consumption of the R-2R ladder remained minimal at approximately 1.69 mA during peak operation.
  • The emitter follower efficiently sourced current directly from the 5 V rail, preventing any loading or thermal drift on the precision ladder resistors.

5. Bill of Materials & Technical Specifications

Component Function / Specification Quantity
Arduino Uno / R4 Microcontroller for 8-bit parallel GPIO control & 10-bit ADC sampling 2
Precision Resistors (1kΩ, 1%) R-2R Ladder Series Resistors ($R$) 9
Precision Resistors (2kΩ, 1%) R-2R Ladder Shunt Resistors ($2R$) 8
LM358 Operational Amplifier Dual General-Purpose Op-Amp configured as Unity-Gain Buffer 1
2N2222 NPN BJT Emitter-Follower Current Buffer for LED Drive 1
High-Brightness Blue LED Optical Transmitter ($\lambda \approx 460\text{–}470\,\text{nm}$) 1
TEMT6000 Sensor Silicon NPN Phototransistor Ambient Light Sensor 1
Optical Enclosure Cylindrical light-shielded optical isolation chamber 1

6. Credits & Project Information

  • Course: ELEC4010 — Introduction to Microelectronics, Fall 2025
  • Institution: College of Engineering & Computer Science, VinUniversity
  • Authors:
    • Nguyen Hong Phuc (System Architecture, Circuit Design, PSpice Simulation, Deep JSCC Autoencoder, Hardware-in-the-Loop Integration)
    • Vo Viet Duc (Hardware Assembly)
  • Supervising Faculty: VinUniversity Microelectronics Faculty
  • Source Code & Report: GitHub Repository · Download Report (PDF)

References