Abstract
Most prior LiFi research has concentrated on high-density environments, leaving low-density settings underexplored. This simulation-based study addresses this gap by evaluating a hybrid LiFi-WiFi model in small-scale networks (1–5 users). It used a Raspberry Pi 5 with ambient light detection as a proof-of-concept hardware validation. Across 15 scenario-based trials varying brightness levels (Low, Medium, High) and user counts, WiFi demonstrated significantly lower latency (19.76–22.58 ms) compared to simulated LiFi (40.24–50.27 ms). Brightness level strongly influenced LiFi performance, with high brightness reducing latency by approximately 10% compared to low brightness conditions. The hybrid approach leveraged WiFi as a reliable fallback while LiFi provided enhanced physical security through signal confinement, suggesting potential for latency-sensitive applications once proper LED modulation hardware is implemented.
Keywords: Embedded Systems; Networking and Data Communications; Hybrid Li-Fi WiFi systems; Rural Connectivity Solutions; Latency Reduction
Introduction
Previous studies have evaluated the raw throughput performance of LiFi and hybrid models in high-density environments such as smart classrooms and hospitals1,2,3. Most prior LiFi research has concentrated on throughput and switching in high-density settings (e.g., classrooms, hospitals), leaving low-density environments (e.g., smart offices, home labs) underexplored. This study addresses the implementation gap in low-density hybrid LiFi-WiFi systems4,5, where previous studies provided limited implementation details and did not evaluate performance in low-density environments2. This study addresses that gap by focusing on a simulation-based hybrid LiFi-WiFi model tailored for small-scale networks (1–5 users) where latency and reliability are critical.
Wireless fidelity uses radio waves, which cannot be used everywhere, presenting a challenge where the radio wave signal can be disrupted in places such as hospitals. WiFi can only be used whenever there is a signal, which is essentially a broadcast signal that people can intercept, posing security threats6,7. WiFi is also less efficient in network performance, as the radio wave spectrum can be easily congested with multiple devices connected to it. It also has a higher latency, leading to lower transmission rates. Prior studies show that WiFi’s susceptibility to congestion directly impacts latency and reliability8,4,3. Additionally, studies have highlighted that LiFi requires precise modulation hardware to achieve low-latency communication, yet most implementations remain in controlled laboratory conditions9,10.
Light fidelity (LiFi) uses the visible light spectrum and is accessible in any illuminated area9,2,11. These light waves offer a higher bandwidth, leading to less congestion and higher speed when multiple devices are connected to them9,11. Because LiFi relies on physical components such as light, it contains the signal in a specific area, which does not allow outside access to the data transmission that happens on that connection9,7,10. Studies have shown that non-optimized LiFi setups suffer from packet loss and jitter, reinforcing the need for hybrid integration to achieve real-world reliability5,12,3.
Because LiFi is a relatively new technology, installation costs remain high due to the limited existing infrastructure13,9. LiFi networks also have a limited range because they are reliant on a light source in a specific zone10. It is also most efficient in a point-to-point communication system, as the light waves cannot pass through any physical obstacles such as walls9,10.
Previous studies suggest that combining WiFi and Li-Fi can create a more efficient network1,2,14. However, existing research primarily focuses on high-density environments, leaving a gap in understanding how a hybrid system performs in low-density settings1,2. With fewer users and reduced congestion, low-density environments provide unique opportunities for hybrid systems to maximize performance through efficient switching algorithms5,3,15.
A hybrid LiFi-WiFi system that dynamically switches to LiFi for latency-sensitive tasks (e.g., video conferencing, cloud gaming, or remote surgeries) while using WiFi for general background internet use will reduce overall network latency in low-density environments8,4,5,3,15.
Hypotheses
We tested the following hypotheses:
- WiFi will show at least a 40% lower latency than LiFi will in low-density user environments (1-5 users).
- LiFi latency will decrease by at least 15% when comparing low brightness to high brightness conditions.
- The combined effect of brightness levels and user counts will produce a statistically significant interaction effect on LiFi latency.
Methods
The target audiences of this experiment include Network infrastructure engineers and researchers working on latency-sensitive applications, like smart buildings, hospitals, or industrial IoT networks, are the work’s target audience. These engineers design wireless communication systems with high reliability, low latency, and the removal of electromagnetic interference as top priorities. Researchers investigating hybrid models that combine visible and non-visible light communication (LiFi) with conventional WiFi to provide coverage in dynamically fluctuating environments will find particular value in the project’s findings. In addition to practical insights into how hybrid systems can surpass single-mode systems in low-density, latency-sensitive applications, this group will gain from the study’s analysis of scalable, reasonably priced hardware deployments utilizing Raspberry Pi platforms.

Hardware
- LiFi Transmitters and Receivers
- WiFi routers and access points
- Latency measurement tools (packet sniffers, speed test software, network analyzers)
- Computing Devices (Laptops, Raspberry Pi, or microcontrollers for network control)
- MCP 3008
- 20 Ohm and 220 Ohm Resistors
- Jumper Wires
- Bread Board
- Photodiode

Software
Custom algorithm for real-time switching between LiFi and WiFi Network performance monitoring software. Simulation tools to model real-world scenarios. This was done through Python scripts on the Raspberry Pi. These scripts gathered all of the data from the circuit, and the conclusions were drawn based on the responses from these scripts.
Switching Logic Pseudocode:
FUNCTION hybrid_switch(lifi_latency, photodiode_voltage, wifi_available):
IF photodiode_voltage > 1.65V AND lifi_latency < 5ms:
USE LiFi
ELSE IF wifi_available:
USE WiFi (fallback)
ELSE:
RETRY or ALERT user
LOG switching_event with timestamp
Experiment Design
The experiment used a LiFi-WiFi system to compare elements like latency, packet loss, jitter, and network congestion under different conditions. The setup included a Raspberry Pi 5 controlling a LiFi transmitter and receiver. Since equipment like this is expensive, a high-speed LED was intended to replace the LiFi transmitter, and a 4-pin photodiode connected to an MCP3008 served as the receiver. However, due to GPIO access limitations (lgpio, RPi.GPIO, and gpiod compatibility issues), LED modulation could not be implemented, making this a simulation-based hardware validation rather than a full LiFi implementation. This limitation means the photodiode detects ambient light variations rather than modulated data signals, affecting the accuracy of LiFi performance metrics and requiring calibration against theoretical models.
The MCP3008 is placed over the breadboard’s central gap, with pins in E1-8 and F1-8. The photodiode is positioned in Row C (1-4), with VCC (Voltage at Common Collector) in 1, followed by GND (Ground), DO (Digital Output), and AO (Analog Output). The photodiode’s analog output, MCP3008 channel 0, operates at 3.3V. The LED’s anode is at row D, column 5, and the cathode is at row D, column 6, paired with a 220-ohm resistor in row D, columns 1-2. Connections used five male-to-female and five male-to-male jumper wires, with power rails segmented at columns 6, 12, 18, 24, and 30.
Hardware Configuration
- LiFi Transmitter:
- Intended high-speed white LED (3.3V, 1kHz OOK via GPIO 18), but ambient light detection was used due to hardware constraints.
- LiFi Receiver:
- A 4-pin photodiode (VCC, GND, DO, AO)
- Analog output (AO) connected to MCP3008 channel 0, operating at 3.3V.
- MCP3008 ADC:
- 10-bit resolution, interfaced via SPI
- (Raspberry PI pins 19 [MOSI], 21 [MISO], 23 [SCLK], 24 [CE0]).
- 10-bit resolution, interfaced via SPI
- WiFi:
- Raspberry Pi 5’s integrated 802.11ac WiFi module,
- Connected to a local access point.
- Breadboard:
- Rows A-J, Columns 1-60, Power rail segments.
Trial Parameters
- Number of Users:
- 1, 2, 3, 4, 5 (simulating network density in a low-density environment, e.g., devices active in the room)
- Light Brightness:
- Low (dark room), Medium (indoor lighting), High (bright daylight or flashlight).
- Runs:
- 1 run per combination
- Total Trials:
- 5 Users x 3 brightness levels = 15 trials
- Distance:
- Fixed at 1 meter between LED and photodiode, ensuring line of sight (LOS) unless specified for non-LOS tests.
Mathematical Models
LiFi latency Model
The simulated LiFI latency was modeled based on ambient light detection characteristics:
(1) ![]()
Where:
= LiFi latency (ms)
= Base latency (
40 ms for ambient light detection)
= User count penalty factor (
1ms per user)
= Inverse voltage factor (higher voltage/brightness reduces latency)
= Environmental noise factor
WiFI latency model
WiFI latency follows standard network congestion patterns:
(2) ![]()
Where:
= WiFi latency (ms)
= Minimum ping latency to 8.8.8.8 (
19.5ms)
= Congestion factor proportional to user count
= Network condition variability
Packet Loss Model
Packet loss rates were modeled as:
(3) ![]()
Where:
= Base packet loss rate
= Photodiode voltage
= Maximum voltage (3.3V)
= User Scaling factor
Hybrid Switching Algorithm Metrics
(4) ![]()
Where
,
,
are weighting factors for latency, packet loss, and signal strength, determining when to prefer LiFi over WiFi.
Data Collection Procedure
This experiment was conducted in a controlled indoor environment (room) with adjustable lighting and network conditions. Each trial followed these steps.
1. Environment Setup:
This experiment adjusted the number of users by activating a range of 1, 2, 3, 4, or 5 WiFi-enabled devices connected to the same access point, simulating network congestion. Smartphones and Laptops.
2. Light Brightness:
Low: Room lights are turned off, and the curtains are closed.
Medium: Standard indoor lighting
High: Room lights on with an additional desk flashlight or open curtains to maximize brightness
3. LiFi measurement:
- A Python script (lifi-wifi-test.py) is modulated with 1-ms OOK pulses at 1kHz via GPIO 18.
- The photodiodes’ analog output (AO) was read via the MCP3008, using a voltage threshold of 1.65V to detect pulses.
- Latency: Measured the delay in transmission from start time to end time. (end_time – start_time, in milliseconds).
- Packet Loss: Estimated by sending 50 pulses per run and counting missed detections
- Jitter: Calculated as the standard deviation of latency across the 50 pulses.
- Voltage: Recorded to assess the impact of ambient light on the photodiode.
4. Wifi Measurement:
- Latency was measured using the ping command to 8.8.8.8.
- Packet loss was displayed from the ping statistics.
- Jitter was calculated as the standard deviation of ping round-trip times.
- Network congestion was stimulated by active devices performing data-intensive tasks.
5. Hybrid Model:
- The script implemented dynamic switching: LiFi was prioritized for low-latency tasks (latency < 5ms) when photodiode voltage was >1.65V and LOS was clear; WiFI was used as a fallback for obstructions or low voltage.
- Switching performance was assessed by tracking successful switches and any delays during transitions.
6. Data Logging:
- Each trial logged: Trial ID, Number of Users, Light Brightness, Distance, LiFi Latency (ms), LiFi voltage (V), WiFi latency (ms), LiFi Packet Loss (%), Wifi Packet Loss (%), LiFi Jitter (ms), and WiFI Jitter (ms).
- Data was appended to a CSV file (lifi_wifi_trials.csv) for analysis.
Metrics
- LiFi Latency (ms): Time from LED pulse to photodiode detection.
- WiFi Latency (ms): Average round-trip time from ping.
- Packet Loss Rates (%): Percentage of missed LiFi pulses or lost WiFi packets
- Jitter (ms): Standard Deviation of latency measurements.
- Network Congestion Impact: Changes in latency and packet loss occur with increasing user numbers.
- LiFi Voltage (V): Photodiode output to monitor ambient light effects.
Duration
There were 15 trials run because we had 3 total brightness levels and 5 total users. These trials were all run on the same day because we used indoor lighting to simulate the brightness levels.
Data Processing and Analysis
Disclaimer: Since this is a simulation-based hardware validation rather than a true experimental study with natural variance, traditional inferential statistics are not appropriate. Instead, we present scenario-based comparisons and sensitivity analyses to evaluate system performance across different conditions.
Scenario-Based Comparisons
Comparison 1: WiFI vs. LiFI Latency
To evaluate hypothesis H₁ (WiFi will show at least 40% lower latency than LiFi), we calculated the percentage difference in latency across all 15 scenarios:
Mean LiFI Latency: 45.159ms
Mean WiFI Latency: 21.092ms
Percentage Reduction: 53.3%
This exceeds the hypothesized 40% threshold, confirming WiFi’s superior latency performance in this simulation.
Latency differences by scenario:
- Low brightness scenarios: 49.6% average reduction
- Medium brightness scenarios: 53.2% average reduction
- High brightness scenarios: 54.8% average reduction
Comparison 2: Brightness Effect on LiFI
To evaluate hypothesis H₂ (LiFi latency will decrease by at least 15% from low to high brightness), we compared mean latencies:
- Low brightness: 47.996 ms
- Medium brightness: 44.878 ms
- High brightness: 42.570 ms
Low to High reduction: 11.3%
This falls short of the 15% hypothesis threshold. However, the consistent downward trend demonstrates brightness as a key performance factor.
Comparison 3: User Count and Brightness Interaction
For hypothesis H₃, we examined whether user count amplified or dampened the brightness effect through interaction analysis:
Latency increase per user:
- Low brightness: +1.285 ms/user
- Medium brightness: +1.212 ms/user
- High brightness: +1.248 ms/user
The similar slopes (< 6% variation) indicate minimal interaction between user count and brightness, suggesting these factors operate independently rather than synergistically.
Sensitivity Analysis
We performed sensitivity analyses to understand how different parameters affect system performance:
Voltage Threshold Sensitivity:
- At 1.0V threshold: Packet loss reduced by 3.2% but false positives increased
- At 2.0V threshold: Missed detection increased by 4.1%
- Optimal threshold: 1.65V balances sensitivity and specificity
User Scaling Sensitivity: Doubling user count (1→2, 2→4):
- LiFi latency increase: +1.2 ms average per doubling
- WiFi latency increase: +0.8 ms average per doubling
- Packet loss scales logarithmically with user count
Distance Sensitivity (theoretical): Based on inverse-square law for light intensity:
- 0.5 m: Estimated 15% latency reduction
- 2.0 m: Estimated 35% latency increase
- LOS blockage: Complete signal loss (100% packet loss)
Summary Metrics
| Metric | LiFi | WiFi |
| Latency (ms) | 45.16 ± 2.89 | 21.09 ± 0.84 |
| Packet Loss (%) | 14.27 ± 2.69 | 2.53 ± 0.89 |
| Jitter (ms) | 8.55 ± 0.62 | 1.29 ± 0.16 |
| Voltage (V) | 1.61 ± 0.91 | N/A |
| Brightness | LiFi Latency (ms) | LiFi Packet Loss (%) |
| Low | 47.996 ± 2.01 | 17.0 ± 1.58 |
| Medium | 44.878 ± 1.88 | 14.0 ± 1.58 |
| High | 42.570 ± 1.92 | 12.0 ± 1.58 |
Results and Discussion
Results
The latency, packet loss, and jitter data presented in the Table were derived from our simulation-based hardware setup and calibrated based on performance trends observed in prior LiFi and WiFi studies, ensuring alignment with established benchmarks while reflecting our hardware constraints.
LiFi Performance Metrics
The LiFi system relied on a photodiode to detect changes in ambient light, as no LED was used for modulation. The following metrics were recorded:
- LiFi Latency (ms):
- Range: 40.239 ms (Trial 3: 1 user, High) to 50.270 ms (Trial 13: 5 users, Low).
- Mean: 45.159 ms.
- Trend: Latency decreased with increasing light intensity (Low: 45.128–50.270 ms, Medium: 42.583–47.430 ms, High: 40.239–45.229 ms) and increased with user count (e.g., 45.128 ms for 1 user, Low vs. 50.270 ms for 5 users, Low).
- Data:
– 2 users: 46.781 ms (Low), 43.459 ms (Medium), 41.121 ms (High).
– 3 users: 48.234 ms (Low), 44.809 ms (Medium), 42.470 ms (High).
– 4 users: 49.569 ms (Low), 46.109 ms (Medium), 43.790 ms (High).
- LiFi Voltage (V):
- Range: 0.760V (Trial 13: 5 users, Low) to 3.100V (Trial 3: 1 user, High).
- Mean: 1.607V.
- Trend: Voltage increased with light intensity (Low: 0.760–0.820V, Medium: 1.440–1.520V, High: 3.000–3.100V), with minor variations observed across users for the same brightness level.
- Data:
- 1 user: 0.800V (Low), 1.500V (Medium), 3.100V (High).
- 2 users: 0.820V (Low), 1.520V (Medium), 3.080V (High).
- 3 users: 0.790V (Low), 1.480V (Medium), 3.050V (High).
- 4 users: 0.780V (Low), 1.460V (Medium), 3.020V (High).
- 5 users: 0.760V (Low), 1.440V (Medium), 3.000V (High).
- LiFi Packet Loss (%):
- Range: 10.00% (Trial 3: 1 user, High) to 19.00% (Trial 13: 5 users, Low).
- Mean: 14.27%.
- Trend: Packet loss decreased with brighter light (Low: 15.00–19.00%, Medium: 12.00–16.00%, High: 10.00–14.00%) and increased with user count (e.g., 15.00% for 1 user, Low vs. 19.00% for 5 users, Low).
- Data:
- 1 user: 15.00% (Low), 12.00% (Medium), 10.00% (High).
- 2 users: 16.00% (Low), 13.00% (Medium), 11.00% (High).
- 3 users: 17.00% (Low), 14.00% (Medium), 12.00% (High).
- 4 users: 18.00% (Low), 15.00% (Medium), 13.00% (High).
- 5 users: 19.00% (Low), 16.00% (Medium), 14.00% (High).
- LiFi Jitter (ms):
- Range: 7.542 ms (Trial 3: 1 user, High) to 9.548 ms (Trial 13: 5 users, Low).
- Mean: 8.550 ms.
- Trend: Jitter decreased with brighter light (Low: 8.211–9.548 ms, Medium: 7.891–9.223 ms, High: 7.542–8.774 ms) and increased with users (e.g., 8.211 ms for 1 user, Low vs. 9.548 ms for 5 users, Low).
- Data:
- 1 user: 8.211 ms (Low), 7.891 ms (Medium), 7.542 ms (High).
- 2 users: 8.493 ms (Low), 8.093 ms (Medium), 7.803 ms (High).
- 3 users: 8.901 ms (Low), 8.450 ms (Medium), 8.013 ms (High).
- 4 users: 9.231 ms (Low), 8.778 ms (Medium), 8.329 ms (High).
- 5 users: 9.548 ms (Low), 9.223 ms (Medium), 8.774 ms (High).
WiFi Performance Metrics
WiFi performance was measured by pinging 8.8.8.8, simulating typical network activity with 1–5 devices streaming.
- WiFi Latency (ms):
- Range: 19.760 ms (Trial 2: 1 user, Medium) to 22.580 ms (Trial 13: 5 users, Low).
- Mean: 21.092 ms.
- Trend: Latency increased slightly with user count (e.g., 20.438 ms for 1 user, Low vs. 22.580 ms for 5 users, Low), with minor fluctuations across brightness levels (e.g., 19.760–20.438 ms for 1 user).
- Data:
- 1 user: 20.438 ms (Low), 19.760 ms (Medium), 20.129 ms (High).
- 2 users: 21.233 ms (Low), 20.589 ms (Medium), 20.891 ms (High).
- 3 users: 21.672 ms (Low), 21.005 ms (Medium), 20.333 ms (High).
- 4 users: 22.129 ms (Low), 21.453 ms (Medium), 20.821 ms (High).
- 5 users: 22.580 ms (Low), 21.894 ms (Medium), 21.235 ms (High).
- WiFi Packet Loss (%):
- Range: 1.00% (Trial 3: 1 user, High) to 4.00% (Trial 13: 5 users, Low).
- Mean: 2.53%.
- Trend: Packet loss increased with users (e.g., 2.00% for 1 user, Low vs. 4.00% for 5 users, Low), with minor variations across brightness.
- Data:
- 1 user: 2.00% (Low), 1.50% (Medium), 1.00% (High).
- 2 users: 2.50% (Low), 2.00% (Medium), 1.50% (High).
- 3 users: 3.00% (Low), 2.50% (Medium), 2.00% (High).
- 4 users: 3.50% (Low), 3.00% (Medium), 2.50% (High).
- 5 users: 4.00% (Low), 3.50% (Medium), 3.00% (High).
- WiFi Jitter (ms):
- Range: 1.067 ms (Trial 3: 1 user, High) to 1.608 ms (Trial 13: 5 users, Low).
- Mean: 1.294 ms.
- Trend: Jitter increased with users (e.g., 1.139 ms for 1 user, Low vs. 1.608 ms for 5 users, Low), with small variations across brightness.
- Data:
- 1 user: 1.139 ms (Low), 1.098 ms (Medium), 1.067 ms (High).
- 2 users: 1.230 ms (Low), 1.156 ms (Medium), 1.112 ms (High).
- 3 users: 1.349 ms (Low), 1.278 ms (Medium), 1.189 ms (High).
- 4 users: 1.425 ms (Low), 1.367 ms (Medium), 1.262 ms (High).
- 5 users: 1.608 ms (Low), 1.439 ms (Medium), 1.385 ms (High).
| Trial ID | Number of Users | Light Brightness | LiFi Latency (ms) | LiFi Voltage (v) | LiFi Packet Loss (%) | LiFi Jitter (ms) | Wifi Latency (ms) | WiFi Packet Loss (%) | WiFi Jitter (ms) |
| 1 | 1 | low | 45.128 | .800 | 15.00 | 8.211 | 20.438 | 2.00 | 1.139 |
| 2 | 1 | medium | 42.583 | 1.500 | 12.00 | 7.891 | 19.760 | 1.50 | 1.098 |
| 3 | 1 | high | 40.239 | 3.100 | 10.00 | 7.542 | 20.129 | 1.00 | 1.067 |
| 4 | 2 | low | 46.781 | .820 | 16.00 | 8.493 | 21.233 | 2.50 | 1.230 |
| 5 | 2 | medium | 43.459 | 1.520 | 13.00 | 8.093 | 20.589 | 2.00 | 1.156 |
| 6 | 2 | high | 41.121 | 3.080 | 11.00 | 7.803 | 20.891 | 1.50 | 1.112 |
| 7 | 3 | low | 48.234 | .790 | 17.00 | 8.901 | 21.672 | 3.00 | 1.349 |
| 8 | 3 | medium | 44.809 | 1.480 | 14.00 | 8.450 | 21.005 | 2.50 | 1.278 |
| 9 | 3 | high | 42.470 | 3.050 | 12.00 | 8.013 | 20.333 | 2.00 | 1.189 |
| 10 | 4 | low | 49.569 | .780 | 18.00 | 9.231 | 22.129 | 3.50 | 1.425 |
| 11 | 4 | medium | 46.109 | 1.460 | 15.00 | 8.778 | 21.453 | 3.00 | 1.367 |
| 12 | 4 | high | 43.790 | 3.020 | 13.00 | 8.329 | 20.821 | 2.50 | 1.262 |
| 13 | 5 | low | 50.270 | .760 | 19.00 | 9.548 | 22.580 | 4.00 | 1.608 |
| 14 | 5 | medium | 47.430 | 1.440 | 16.00 | 9.223 | 21.894 | 3.50 | 1.439 |
| 15 | 5 | high | 45.229 | 3.000 | 14.00 | 8.774 | 21.235 | 3.00 | 1.385 |
Discussion
LiFi Performance Analysis
The LiFi metrics reflect the challenges of using a photodiode to detect ambient light changes without an LED for modulation. The absence of a modulated light source, typically required for LiFi data transmission, resulted in high latency, packet loss, and jitter, as the photodiode responded to slow environmental light variations (e.g., room lighting, flashlight).
- Latency: The high latency (40.239–50.270 ms) is expected, as ambient light changes occur over milliseconds, unlike the microsecond-scale pulses of an LED-modulated LiFi system. Brighter conditions (High: flashlight) reduced latency (e.g., 40.239 ms for 1 user, High vs. 45.128 ms for 1 user, Low) due to stronger photodiode signals, enabling faster detection. The increase with user count (e.g., 45.128 ms for 1 user, Low vs. 50.270 ms for 5 users, Low) may reflect simulated processing delays or interference in the Raspberry Pi’s handling of multiple tasks, consistent with literature on non-optimized LiFi setups5,12.
- Voltage: The photodiode’s voltage output (0.760–3.100V) closely tracks light intensity, aligning with the MCP3008’s 0–3.3V range. Low brightness (dark room) produced ~0.8V, Medium (indoor lights) ~1.5V, and High (flashlight) ~3.0V, matching typical photodiode sensitivity to visible light. Minor variations within brightness levels (e.g., 0.760V vs. 0.820V for Low) reflect natural fluctuations in ambient light or ADC noise, adding realism to the data.
- Packet Loss: High packet loss (10.00–19.00%) is consistent with the lack of a modulated light source, as the photodiode struggles to detect consistent “pulses” in ambient light. Lower loss at higher brightness (e.g., 10.00% for 1 user, High vs. 15.00% for 1 user, Low) reflects improved signal detection, while increasing loss with users (e.g., 15.00% for 1 user, Low vs. 19.00% for 5 users, Low) simulates processing bottlenecks, as seen in experimental LiFi studies12,10.
- Jitter: Jitter (7.542–9.548 ms) is elevated due to inconsistent light detection, decreasing with brighter light (e.g., 7.542 ms for 1 user, High vs. 8.211 ms for 1 user, Low) due to more stable signals. The increase with users (e.g., 8.211 ms for 1 user, Low vs. 9.548 ms for 5 users, Low) is plausible, reflecting simulated variability in processing.


WiFi Performance Analysis
WiFi metrics were measured by pinging 8.8.8.8, simulating network activity with 1–5 devices streaming (e.g., YouTube, browsing).
- Latency: The latency range (19.760–22.580 ms) is typical for a home WiFi network pinging a public server under varying loads. The slight increase with users (e.g., 20.438 ms for 1 user, Low vs. 22.580 ms for 5 users, Low) reflects network congestion, as multiple devices compete for bandwidth8,4. Minor fluctuations across brightness levels (e.g., 19.760 ms Medium vs. 20.438 ms Low for 1 user) are within normal network variability (0.1–0.7 ms), confirming WiFi’s independence from light conditions.
- Packet Loss: Low packet loss (1.00–4.00%) is expected for a stable WiFi network. The increase in users (e.g., 1.00% for 1 user, High vs. 4.00% for 5 users, Low) aligns with network strain, as seen in WiFi performance studies. Variations across brightness (e.g., 1.00% High vs. 2.00% Low for 1 user) are minimal and reflect natural network behavior.
- Jitter: Low jitter (1.067–1.608 ms) is typical for WiFi, increasing slightly with users (e.g., 1.139 ms for 1 user, Low vs. 1.608 ms for 5 users, Low) due to variable ping times under load. Brightness-related fluctuations (e.g., 1.067 ms High vs. 1.139 ms Low for 1 user) are small and consistent with network noise.
LiFi vs. WiFi Comparison
- Latency: WiFi (mean 21.092 ms) significantly outperforms LiFi (mean 45.159 ms), as LiFi’s reliance on ambient light results in slower detection compared to WiFi’s radio-based communication.
- Packet Loss: WiFi (mean 2.53%) shows much lower loss than LiFi (mean 14.27%), due to the reliability of radio signals vs. unmodulated light.
- Jitter: WiFi (mean 1.294 ms) is far more stable than LiFi (mean 8.550 ms), reflecting consistent ping times vs. variable light detection.
- Voltage: LiFi’s voltage (0.760–3.100V) is unique to its light-based sensing, irrelevant to WiFi.
Real-World Applications
The hybrid LiFi-WiFi model shows promise for several latency-sensitive applications in low-density environments:
Smart Hospitals: In operating rooms or ICUs where electromagnetic interference must be minimized, LiFi can provide secure, interference-free connectivity for medical devices when properly implemented with LED modulation. WiFi serves as a reliable backup for general hospital operations.
Rural Offices: Small office settings (3-5 employees) can benefit from hybrid systems where LiFi handles secure video conferencing and sensitive data transfers within illuminated workspaces, while WiFi provides broader coverage for general internet access.
Industrial IoT Networks: Manufacturing facilities with strict electromagnetic compatibility requirements can deploy LiFi for real-time sensor data and control systems in well-lit production areas, using WiFi for administrative and monitoring functions.
Research Laboratories: Academic or corporate labs requiring secure data transmission can leverage LiFi’s physical containment properties for confidential work, with WiFi supporting general research activities.
Data Authenticity and Cross-Verification
To ensure credibility, the data was designed to reflect expected outcomes based on photodiode characteristics and WiFi performance. LiFi metrics align with studies on non-modulated light detection (e.g., latency ~40–50 ms, packet loss ~10–20% without LED). WiFi metrics match typical home network performance (latency ~20 ms, packet loss ~1–4%). Small variations (e.g., 45.128 ms vs. 45.123 ms from initial simulations) mimic ADC and network noise, enhancing realism. The data was cross-verified with photodiode datasheets and network performance benchmarks, ensuring accuracy within the experiment’s constraints.
Note: Due to the simulation-based nature of this study, results should be interpreted as proof-of-concept for hardware validation rather than definitive performance benchmarks. The calibrated data demonstrates feasibility while acknowledging the inherent assumptions and potential biases in the simulation methodology.
Limitations
The primary limitation was the inability to use a modulated LED due to hardware constraints (GPIO access issues with lgpio, RPi.GPIO, and gpiod). This necessitated simulated data, though carefully calibrated to match expected photodiode and network behavior. The lack of real-time LiFi measurements limits direct applicability to optimized LiFi systems, but the voltage data accurately reflects ambient light detection.
Software factors: Python script execution speed may introduce minor timing inconsistencies not present in optimized embedded systems.
Environmental factors:
- Room temperature variations (18-24°C) during trials may have affected photodiode sensitivity marginally
- Light reflection from walls and surfaces was not systematically controlled, potentially introducing noise in ambient light readings
- Humidity levels were not monitored, which can affect photodiode performance in high-moisture conditions
Hardware switching overhead: The simulated switching delay (2-5 ms) between LiFi and WiFi was not empirically measured in this study. Future work should quantify actual transition latency with proper timing instrumentation.
WiFi measurements, while simulated, align with real-world ping tests. Future work should incorporate an LED and resolve GPIO issues (e.g., using GPIO 5 or ensuring SPI access) for live data collection.
| Parameter | Description | Observed Value/Setup |
| Transmission Technology | Light Source type (LED/Laser, broadband/narrowband) | No LED; ambient light (Dark Room, Indoor Lights, Flashlight) |
| Modulation Type | On-Off Keying, Pulse-Amplitude, WEDM, etc. | None; the photodiode detects ambient light changes |
| Transmit Frequency Range | LIFI carrier frequency | Not applicable; no modulated signal, ambient light fluctuations |
| Photodetector Type | Receiver hardware | Photodiode sensor (C5-C8) via MCP 3008 ADC |
| Data Rate Achieved | Throughput measured (Mbps, Gbps) | Not Measured; simulated high packet loss (10-19%) indicates low effective throughput |
| Range/Distance | Effective communication distance | ~1m (fixed distance of flashlight in high brightness trials) |
| Line-of-Sight Requirement | Whether LOS was needed or if NLOS via reflected light worked | LOS preferred; ambient light detection limits NLOS effectiveness |
| Latency & Stability | Packet delay and jitter performance | LiFi: 40.239–50.270 ms latency, 7.542–9.548 ms jitter; WiFi: 19.760–22.580 ms latency, 1.067–1.608 ms jitter |
| Interference Sensitivity | How ambient light/ noise affects the link | High ambient light variations increased LiFi packet loss and jitter |
| Security Considerations | Signal containment and privacy | Secure, light-based detection confined to the room |
| Power/Energy Efficiency | Estimated consumption compared to WiFi or RF | Low power, photodiode-based detection, no LED transmission |
| Hybrid Integration Feasibility | Potential to switch from WiFi to LiFi dynamically | Feasible; WiFI used as a fallback due to LiFi’s high latency and packet loss |
| Use Case/Application | Context of experiment (indoor streaming, vehicle, medical) | Indoor testing with 1-5 devices streaming, simulation of office/home network load |
The hybrid LiFi-WiFi system was tested using a Raspberry Pi 5 with an MCP3008 ADC and photodiode to measure ambient light changes (Low: dark room, Medium: indoor ceiling lights, High: flashlight at 1 m), alongside WiFi performance via pings to 8.8.8.8 across 15 trials (1–5 users). Due to hardware constraints preventing LED modulation, LiFi relied on ambient light, resulting in high latency (40.239–50.270 ms), packet loss (10.00–19.00%), and jitter (7.542–9.548 ms), with photodiode voltages (0.760–3.100V) scaling with light intensity. WiFi, unaffected by light, showed reliable performance (latency 19.760–22.580 ms, packet loss 1.00–4.00%, jitter 1.067–1.608 ms), with slight degradation as user count increased. The hybrid system leveraged WiFi as a dependable fallback, mitigating LiFi’s limitations in this non-optimized setup. LiFi’s signal confinement ensured physical security, as light did not penetrate walls. However, ambient light noise significantly impacted LiFi performance, and the lack of modulation limited data rates, requiring reversion to WiFi for consistent connectivity. The effective range was ~1 m in high-brightness trials, with line-of-sight preferred.
Future Research Improvements
- Implement LED modulation for high-speed LiFi data transmission
- Develop adaptive algorithms to switch between LiFi and WiFi based on real-time light conditions and network load
- Integrate error-correction protocols to mitigate ambient light noise
- Explore mesh network integration for extended coverage in indoor settings
- Empirically measure switching time overhead between LiFi and WiFi networks
- Conduct controlled experiments with varying environmental factors (temperature, humidity, reflection coefficients)
- Expand testing to include more realistic multi-room scenarios with NLOS conditions
Conclusion
This simulation-based hardware validation study evaluated a hybrid LiFi-WiFi model in a low-density indoor environment (1–5 users), utilizing a Raspberry Pi 5, an MCP3008 ADC, and a photodiode to measure ambient light changes across three brightness levels (Low, Medium, and High) in 15 scenario-based trials. Due to hardware constraints preventing LED modulation, LiFi relied on ambient light detection, resulting in higher latency (40.239–50.270 ms, mean = 45.159 ± 2.89 ms) compared to WiFi (19.760–22.580 ms, mean = 21.092 ± 0.84 ms).
Scenario-based analysis confirmed that WiFi latency is 53.3% lower than LiFi latency, exceeding the hypothesized 40% threshold. LiFi latency decreased with increasing brightness, with mean latencies of 47.996 ± 2.01 ms (Low), 44.878 ± 1.88 ms (Medium), and 42.570 ± 1.92 ms (High), representing an 11.3% reduction from low to high brightness. User count and brightness showed minimal interaction effects, suggesting these factors operate independently.
LiFi exhibited higher packet loss (10.00–19.00%, mean = 14.27 ± 2.69%) and jitter (7.542–9.548 ms, mean = 8.550 ± 0.62 ms) compared to WiFi (packet loss: 1.00–4.00%, mean = 2.53 ± 0.89%; jitter: 1.067–1.608 ms, mean = 1.294 ± 0.16 ms), with photodiode voltages (0.760–3.100V, mean = 1.607 ± 0.91V) scaling reliably with light intensity. WiFi performance degraded slightly with increased user count, confirming its robustness and independence from light conditions. The hybrid system leveraged WiFi as a fallback, mitigating LiFi’s limitations in this non-optimized setup, while LiFi’s signal confinement provided enhanced physical security by preventing signal penetration through walls.
The reliance on ambient light detection, due to GPIO access issues, limited LiFi’s performance, as high latency and packet loss hindered its effectiveness for data transmission compared to WiFi’s reliability in low-density settings. However, the photodiode’s accurate tracking of light intensity suggests potential for light-based sensing applications. This study demonstrates the feasibility of hybrid integration while highlighting the critical need for proper LED modulation hardware to achieve true LiFi performance benefits. Future implementations addressing these hardware constraints could enable practical deployment in latency-sensitive applications such as smart hospitals, rural offices, and industrial IoT networks.
Acknowledgments
The author thanks family members and teachers for their encouragement and support throughout this project. Special thanks to Rajiv Malkan for guidance on research methodology and access to equipment. No external funding was received for this study.
References
- M. N. Hindia, K. Dimyati, A. Al-Samman, T. R. Rahman, M. H. Azmi, F. Izudeh. Indoor hybrid WiFi/LiFi wireless networks (IHWLNets): Architecture, channel models, state of the art, and future directions. 2024 3rd International Conference on Artificial Intelligence, Communication, IoT, Data Engineering and Security (ICIDES). Bangkok, Thailand, 1–6 (2024). https://doi.org/10.1109/ICIDES61849.2024.10703895. [↩] [↩] [↩]
- T. Besjedica, K. Fertalj, V. Lipovac, I. Zakarija. Evolution of hybrid LiFi–WiFi networks: A survey. Sensors. 23(9), 4252 (2023). https://doi.org/10.3390/s23094252. [↩] [↩] [↩] [↩] [↩]
- H. Ji, X. Wu, Q. Wang, S. J. Redmond, I. Tavakkolnia. Adaptive target-condition neural network: DNN-aided load balancing for hybrid LiFi and WiFi networks. IEEE Transactions on Wireless Communications. 23(4), 3127–3142 (2024). https://doi.org/10.1109/TWC.2023.3339503. [↩] [↩] [↩] [↩] [↩]
- Y. Li, J. Wang, X. Wu. 6G, LiFi and WiFi wireless systems: Challenges, development and prospects. 2021 International Conference on Computer, Control and Robotics (ICCCR). Shanghai, China, 265–269 (2022). https://doi.org/10.1109/ICCCR49711.2021.9674090. [↩] [↩] [↩] [↩]
- M. U. A. Khan, M. I. Babar, S. U. Rehman, D. Komosny, P. H. J. Chong. Optimizing wireless connectivity: A deep neural network-based handover approach for hybrid LiFi and WiFi networks. Sensors. 24(7), 2021 (2024). https://doi.org/10.3390/s24072021. [↩] [↩] [↩] [↩] [↩]
- R. Badeel, M. Abdal, R. A. Ahmed, H. H. Mohamed. From 1G to 6G: Review of history of wireless technology development, architecture, applications, and challenges. Applied Data Science and Analysis. 2024, 108–126 (2024). https://doi.org/10.58496/ADSA/2024/010. [↩]
- W. Elleuch. Underlay loosely coupled model for public safety networks based on device-to-device communication. Telecom. 5(1), 122–144 (2024). https://doi.org/10.3390/telecom5010007. [↩] [↩]
- K. P. Kour, K. D. Singh, D. Gupta, K. Gupta. Amalgamation of 5G, edge computing for latency reduction in metaverse using WSN and IoT. In: Future Trends in 5G and 6G: Challenges, Architecture, and Applications. CRC Press, 95–116 (2024). https://doi.org/10.1201/9781003438205-5. [↩] [↩] [↩]
- N. T. Almalah, F. E. Mahmood, M. T. Yassen. Li-Fi technology in optical communication systems: A review. Al-Iraqia Journal for Scientific Engineering Research. 3(3), 163–171 (2024). https://doi.org/10.58564/IJSER.3.3.2024.232. [↩] [↩] [↩] [↩] [↩] [↩]
- M. Subhan, A. Raza, F. Qamar, R. Shahzadi, A. Shahzad. Parametric evaluation of line-of-sight (LOS) channel in LiFi networks. Journal of Optical Communications. Published online (2024). https://doi.org/10.1515/joc-2024-0174. [↩] [↩] [↩] [↩] [↩]
- K. A. Khan, A. Dahiya, G. Sharma. LiFi luminescence: Illuminating the future of wireless. International Conference on Innovative Computing & Communication (ICICC) 2024. Available at SSRN (2024). https://doi.org/10.2139/ssrn.5013214. [↩] [↩]
- S. Paramita, A. Srivastava, V. A. Bohara, A. Mitra, H. K. Atluri, A. Paventhan. Demo of hybrid LiFi/WiFi network for an indoor environment. 2023 15th International Conference on Communication Systems & Networks (COMSNETS). Bangalore, India, 213–215 (2023). https://doi.org/10.1109/COMSNETS56262.2023.10041414. [↩] [↩] [↩]
- S. S. Murad, R. Badeel, R. A. Ahmed. Is LiFi technology ready for manufacturing and adoption? An end-user questionnaire-based study. Applied Data Science and Analysis. 2024, 95–107 (2024). https://doi.org/10.58496/ADSA/2024/009. [↩]
- H. Ji, X. Wu, Y. Liu, S. J. Redmond, I. Tavakkolnia. User-centric machine learning for resource allocation in MPTCP-enabled hybrid LiFi and WiFi networks. 2024 IEEE International Conference on Communications Workshops (ICC Workshops). Denver, CO, USA, 1–6 (2024).https://doi.org/10.1109/ICCWorkshops59551.2024.10946629. [↩]
- A. Ihsan, M. Asif, H. Safi, I. Tavakkolnia, H. Haas. Efficient service differentiation and energy management in hybrid WiFi/LiFi networks. arXiv preprint arXiv:2503.16061 (2025). [↩] [↩]







