An indoor wireless optical communication link built around a continuous-wave laser instead of the usual LED, with a digital micromirror device (DMD) added on top to steer the beam. Done during my internship at MNIT Jaipur. The system is modeled end to end in OptiSystem, the DMD mirror physics come from COMSOL, and a MATLAB co-simulation block ties the two together.
Most LiFi setups use an LED as the transmitter because it's cheap and simple, but an LED's output is weak and spreads out in a wide cone. That spread is the problem: the farther the receiver sits, the more of that light misses it, so the bit error rate climbs fast with distance. A laser diode fixes this by putting more optical power into a much narrower, more directional beam. Less light gets wasted between transmitter and receiver, so the link tolerates more distance and more filtering before the signal degrades.
The chain runs like this: a PRBS generator produces the test bit pattern (10 Mbps, 128-bit sequence), an NRZ pulse generator turns it into an electrical waveform, and a Mach-Zehnder modulator stamps that waveform onto light from a 1552 nm CW laser running at 17 dBm. From there the beam crosses a line-of-sight free-space channel (6 m, with transmitter and receiver half-angles set to realistic room geometry), gets cleaned up by a Gaussian optical filter, and lands on a PIN photodiode alongside a simulated white-light source that stands in for ordinary room lighting and its interference. On the receive side a transimpedance amplifier boosts the weak photocurrent, a DC block strips the offset, and a third-order Chebyshev low-pass filter (0.5 dB ripple, 7.5 MHz cutoff) cleans up the recovered signal before it hits the BER analyzer.
Before settling on a final design, five filter types (Chebyshev, Gaussian, Bessel, Butterworth, Cosine) were swept across distances from 1 to 10 m to see which held up best. Gaussian and Bessel post the highest Q-factors at short range but fall off quickly past 5-6 m; Chebyshev and Butterworth are less flashy up close but stay flatter as distance grows, which matters more for a system meant to cover a whole room rather than just the first meter or two. Filter order and ripple factor were swept the same way. A third-order Chebyshev filter with 0.5 dB ripple came out as the best balance of Q-factor and bit error rate and is what the final design uses.
A DMD is an array of microscopic mirrors that each tilt between an "on" and "off" angle, normally used in projectors to steer light pixel by pixel. Here it's repurposed as a beam-steering element for the optical link: tilt the mirror to redirect the laser toward the receiver instead of just letting it spread.
The mirror's actual optical behavior (how much power survives at the "on" tilt versus the "off" tilt) isn't something you can just guess at, so it's simulated separately in COMSOL as a 1D transmittance-versus-tilt-angle sweep. At the 12-degree "on" state, that sweep gives a power transmittance of 0.9416. Since OptiSystem doesn't model micromirror arrays natively, a MATLAB co-simulation block reads that COMSOL result and applies it as an amplitude scaling factor to the optical signal passing through.
Two versions of this were built:
- Single mirror (
comsol/dmd_optical_switching.mph): one mirror switching the beam on and off. - 4-mirror array (
comsol/dmd_4_mirror.mph,matlab/dmd_component.m): four independently addressable mirrors combined coherently into one output. This version goes further than a simple on/off switch - it accounts for the small manufacturing differences between mirrors, the fact that real mirror arrays never reflect 100% of incoming light because of gaps between mirrors (modeled here as a 0.92 fill factor), and the phase shift each mirror picks up from sitting at a slightly different physical position (10.8 µm mirror pitch). The live MATLAB script goes one step further than what's described in the reports: it reads the incoming NRZ bit stream directly from OptiSystem and flips all four mirrors between the COMSOL "on" and "off" transmittance values in real time as the bits arrive, rather than assuming a fixed static state.
All three versions were tested under the same conditions (6 m, 17 dBm laser, third-order Chebyshev filter) and checked against a published reference design for the same kind of link:
| Configuration | Q-factor | BER | Eye height |
|---|---|---|---|
| Reference design (published) | 14.46 | 1.10 × 10⁻⁴⁷ | 0.0004 |
| Laser LiFi, no DMD | 15.21 | 1.45 × 10⁻⁵² | 0.0998 |
| + single-mirror DMD | 15.34 | 2.20 × 10⁻⁵³ | 0.0993 |
| + 4-mirror DMD array | 16.02 | 4.18 × 10⁻⁵⁸ | 0.0997 |
Each step improves both the Q-factor and the bit error rate, with the 4-mirror array giving the cleanest eye diagram of the three. The BER figures here come straight out of the OptiSystem Q-factor-to-BER formula (BER = 1/2 * erfc(Q/sqrt(2))), which is standard for this kind of link-budget analysis but assumes a Gaussian noise model - worth keeping in mind if you're comparing against a hardware measurement rather than another simulation.
comsol/ COMSOL 6.2 models of the DMD mirror physics
dmd_optical_switching.mph single-mirror on/off transmittance sweep
dmd_4_mirror.mph 4-mirror array geometry and field simulation
matlab/ the OptiSystem <-> COMSOL bridge
dmd_component.m live MATLAB co-simulation block (reads NRZ
bits, switches all 4 mirrors in real time)
dmd_4_mirror.mat raw COMSOL transmittance data the component
script is built from
optisystem/ the full system design
lifi_network.osd complete OptiSystem project - laser, modulator,
DMD block, channel, receiver chain, filters
figures/ block diagram, eye diagrams, and filter comparison plots
.mphfiles need COMSOL Multiphysics 6.2 (or newer - COMSOL files are generally forward-compatible)..mand.matfiles need MATLAB;dmd_component.malso runs standalone outside OptiSystem for quick testing - it auto-generates a dummy laser signal and random bit pattern if it doesn't detect an OptiSystem input port..osdneeds OptiSystem 23 or newer. Opening it will ask where to find the MATLAB component script - point it atmatlab/dmd_component.m.
Background reading the design was based on and compared against:
- S. Razzaq, N. Mubeen, F. Qamar, "Design and analysis of light fidelity network for indoor wireless connectivity," IEEE Access, vol. 9, pp. 145699-145709, 2021.
- M. D. Soltani et al., "Terabit indoor laser-based wireless communications: LiFi 2.0 for 6G," IEEE Wireless Commun., vol. 30, no. 5, pp. 36-43, 2023.
- C. Chen et al., "100 Gbps indoor access and 4.8 Gbps outdoor point-to-point LiFi transmission systems using laser based light sources," J. Lightw. Technol., vol. 42, pp. 4146-4157, 2024.
- H. Haas et al., "Introduction to indoor networking concepts and challenges in LiFi," J. Opt. Commun. Netw., vol. 12, no. 2, p. A190, 2020.



