This project demonstrates a simple light-based data communication system using Raspberry Pi Pico boards. Data is transmitted through visible light using a laser diode as the transmitter and an LDR sensor as the receiver. The system supports text message transfer between two computers through a light channel.
LiFi (Light Fidelity) uses visible light instead of radio waves for wireless communication. This project shows a basic LiFi prototype capable of sending and receiving text messages. Each character is converted into binary data, transmitted as light pulses, and decoded back into readable text.
Hardware
- Raspberry Pi Pico (2 units)
- Laser Diode or LED (Transmitter)
- LDR (Light Dependent Resistor) for Receiver
- BC547 Transistor for amplification
- Resistors and breadboard
- USB cables for serial communication
Software
- MicroPython for Pico firmware
- Python (Tkinter, PySerial) for PC interfaces
pi_tx.py – Transmitter Pico code
pi_rx.py – Receiver Pico code
tx_ui.py – Sender PC interface
rx_ui.py – Receiver PC interface
- The transmitter Pico reads a message from the PC.
- Each character is converted to binary and sent as light pulses (ON/OFF).
- The receiver Pico reads light intensity values using the LDR.
- These signals are converted back to binary and decoded to text.
- The PC displays received messages through a GUI.
-
Flash MicroPython on both Raspberry Pi Pico boards.
-
Upload:
pi_tx.pyto the transmitter Pico.pi_rx.pyto the receiver Pico.
-
Connect:
- Laser diode/LED to GPIO15 (TX side)
- LDR to ADC pin 28 (RX side)
-
Edit COM port numbers in
tx_ui.pyandrx_ui.py. -
Run both UI scripts:
python tx_ui.py python rx_ui.py
-
Type messages in the transmitter window to send data over light.
- Range: 1–2 meters
- Speed: ~30 bps
- Accuracy: 95–98% in stable lighting
- Secure short-range data transfer with low power consumption
- Use photodiodes for faster response
- Add error correction
- Improve data rate with better modulation
- Enable multi-node LiFi networking
- Tholkappiyan B – 23BCE20158
- Pranav P S – 23BCE7250
- Muhammad Sajid Y – 23BCE7802
- Ganesh M – 23BCE8887
- V K Rohith – 23BCE8997
- Hari Prasath M – 23BCE8999


