Back to Advanced Projects

📶 Li-Fi Data Transfer System

Wireless light-based communication. Transmit data or audio through modulated visible light using an LED and photodiode.

📋 Overview

Light Fidelity (Li-Fi) is an innovative, high-speed, and secure wireless communication technology that uses visible light waves to transmit data instead of radio frequencies. This project implements a hardware transceiver system.

What you'll learn: Optical signal modulation and demodulation, analog photodiode threshold sensing, operational amplifier filtering, and building optical wireless transmitter/receiver circuits.

Estimated time: 2-3 hours. Difficulty: ⭐⭐⭐⭐ Advanced.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R3 (x2)5V Logic2One for transmitter, one for receiver
Solar Panel or PhotodiodeSmall 5V / BPW341Light receiver
LM358 Op-AmpDual channel1Amplifies received signals
High-Power White LED1W / 3.3V1Light transmitter
TIP122 TransistorNPN Darlington1Drives high-power LED
Resistors & Capacitors100uF, 10k, 1k, 220 Ohm1 setFor filtering circuit

📖 Step-by-Step Tutorial

1

Assemble Transmitter Circuit

Connect Arduino Pin 3 (PWM/Serial TX) to the base of the TIP122 transistor via a 1k resistor. Wire the high-power LED to the transistor collector with an external power source.
2

Assemble Receiver Circuit

Wire the photodiode or small solar panel to the non-inverting input of the LM358 operational amplifier to boost the weak optical pulses into a clean 5V square wave.
3

Establish Communication Protocol

Write a serial transmitter protocol that modulates data by turning the LED on and off at high frequencies (baud rates).
4

Upload Transmitter Code

Upload the serial packet sender code to the transmitter Arduino, modulating high-speed data bits into light.
5

Upload Receiver Code

Upload the serial packet decoder code to the receiver Arduino to parse incoming light pulses and reconstruct the sent text.
💡
Keep the transmitter and receiver in a straight line-of-sight path. High ambient room lighting can create signal noise; use a dark tube around the receiver to isolate it.

💻 Code / Configuration

lifi_transfer.ino
INO
// Li-Fi Transmitter Modulation Code - Volt X
int txPin = 3; // Modulating LED pin

void setup() {
  Serial.begin(9600);
  pinMode(txPin, OUTPUT);
}

void loop() {
  if (Serial.available()) {
    char data = Serial.read();
    transmitChar(data);
  }
}

void transmitChar(char c) {
  // Simple bit-bang UART emulation over light
  digitalWrite(txPin, LOW); // Start bit
  delayMicroseconds(104);  // 9600 Baud rate duration
  
  for (int i = 0; i < 8; i++) {
    digitalWrite(txPin, (c & (1 << i)) ? HIGH : LOW);
    delayMicroseconds(104);
  }
  

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...