Skip to content

rxhhha/LiFi

Repository files navigation

LiFi Prototype

Description

Experimental Li-Fi system using Arduino for optical wireless data transmission.


Materials


Protocol

  • Default state: HIGH
  • Threshold: Set dynamically at startup based on ambient lighting
  • Setup: Delay at the beginning to ignore setup noise

Encoding schemes:

  • Non-Return-to-Zero (NRZ): HIGH = 1, LOW = 0
  • Manchester Encoding: HIGH → LOW = 1, LOW → HIGH = 0

Experiments

1. Arduino-LED-Solar NRZ

  • Transmitter: 3 white LEDs
  • Receiver: Solar panel
  • Protocol: NRZ on-off
    • Sample in the middle (sampling time * 1.5)
  • Setup: Threshold 150; box 25cm × 17cm; transmitter and receiver diagonally placed, 20cm apart
  • Performance: Smallest reliable sampling time: 4ms; 3ms works with some errors

2. Arduino-LED-Solar Manchester

  • Setup: Same as above
  • Protocol: Manchester
    • 1: HIGH → LOW (first half of bit)
    • 0: LOW → HIGH (first half of bit)
    • Receiver samples after < sampling time * 1.5
  • Threshold: ~0.6 × LDR value when LED is ON
    • More LEDs → larger optimal threshold range
  • Performance: Smallest reliable sampling time: 2ms

3. Arduino-LED-Solar 4B/5B

  • Setup: Without box

  • Protocol: 4B/5B encoding + NRZ

    • 4-bit nibbles mapped to 5-bit codes (see table below)
    4B Data 5B Code
    0000 11110
    0001 01001
    0010 10100
    0011 10101
    0100 01010
    0101 01011
    0110 01110
    0111 01111
    1000 10010
    1001 10011
    1010 10110
    1011 10111
    1100 11010
    1101 11011
    1110 11100
    1111 11101
  • Threshold: Use adaptive rate to adjust threshold dynamically while receiving

    • Able to handle background light changes (e.g., turning on/off room light)
    • Max distance depends on room light intensity
  • Performance: Smallest reliable sampling time: 2ms

  • TODO: Implement NRZI and use control signals


TODO

  • Implement error detection/correction (e.g., parity bits, checksums)
  • Explore other signal encoding methods: color, brightness, timing, on-off combinations
  • Transmitter improvements:
    • Use laser
    • Different colors and brightness levels
  • Receiver improvements:
    • Replace solar panel with phototransistor for higher sensitivity
  • Optimize threshold calculation and sampling time for new setups

References

About

Light-based wireless data transmission with NRZ, Manchester, and 4B/5B protocols.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages