LiFi Communication System – DIY

LiFi Communication or Li-Fi! We all have heard about it. It sounds exciting and can disrupt the future; changing the way we communicate with each other. 

After working and researching on Li-Fi based applications over the past 2 years, we finally decided to make a DIY tutorial as a lot of people were emailing us for the same. As you all must have heard about LiFi Communication (or Li-Fi), it stands for Light-Fidelity.


LiFi Communication technology, proposed by the German physicist—Harald Haas, provides transmission of data through illumination by sending data through an LED light bulb that varies in intensity faster than the human eye can follow.  We have always heard about he comparison between Li-Fi with Wi-Fi and how Li-Fi has speed advantage than the latter. 

LiFi Communication vs WiFi Communication

Wi-Fi is great for general wireless coverage within buildings, whereas Li-Fi is ideal for high density wireless data coverage in confined area and for relieving radio interference issues.

Li-Fi provides better bandwidth, efficiency, availability and security than Wi-Fi and has already achieved blisteringly high speed in the lab. By leveraging the low-cost nature of LED’s and lighting units there are many opportunities to exploit this medium, from public internet access through street lamps to auto-piloted cars that communicate through their headlights.

LiFi Communication

Haas envisions a future where data for laptops, smart phones, and tablets will be transmitted through the light in a room. Consider the following use case shown in the image below.

LiFi Communication Project Details

In the application we try to implement a very low level Li-Fi data communication where we send some data through a small led at a low data rate.

We referred to few blogs and journals and are very thankful for their research and information sharing.

Transmitter Section

  1. We use an Arduino to capture the input from a 4×4 Keypad and display it on the LCD.
  2. We then transmit the same data by encoding it into a light signal using a LED and Serial Communication (UART) protocol. For better communication, high wattage LED’s or LED arrays can be used.   

Receiver Section

  1. To capture the light signal, we use a LDR (Light Sensor) and filter/amplify the signal using a comparator circuit (LM358). Now tuning this receiver circuit takes time and some effort
  2. We then decode the transmitted signal and display it on the LCD screen.

NOTE : The sensor is prone to external light interference and can give garbage data so ensure you tune it in consistent light conditions. Connection Diagram and codes are given below, please look carefully.

Components required :

1) 2 x Arduino Uno R3 Board (Buy here) or Arduino Nano (Buy here)
2) 1 x 16×2 LCD Display (Buy here)
3) 1 x 4×4 Keypad Matrix (Buy here)
4) 1 x 840 Point BreadBoard (Buy here)
5) 40 pcs x Male to Male Jumper Wire (Buy here)
6) 5 x LED’s  (Buy here)
7) 1 x BMES LDR Module (Buy here)
8) 1 x PCB (Buy here)
9) 1 x Resistor pack (Buy here


1) Tools (Buy here)

Connection Diagram & Code Files

Tx Section
Receiver Section

In case of any questions or queries, feel free to post below.

Subscribe to our YouTube Channel and check out other tutorials of DIY projects.

Some Project Ideas using Lifi Communication


74 thoughts on “LiFi Communication System – DIY

  1. syed sheik mohammed P says:

    bro…i want to vehicle to vehicle data transmission using lifi program.if u like share the program with plzzz contact my gmail account or my phone number 9976885152 or 8248420395..plzz contact me….bro

  2. syed sheik mohammed P says:

    bro in your lifi data transmit project there is one error in program broo. I can’t solve the error. The error is “#include “.soo plzz tell me how to clear a error in program.

    • Mandeesh Singh says:

      The error can be of Keypad Library.
      You’ll have to download and install keypad library for the program to work.

  3. syed sheik mohammed says:

    Arduino: 1.8.8 (Windows 10), Board: “Arduino/Genuino Uno”

    In file included from Y:\Tx-files\Tx\Tx.ino:1:0:

    C:\Program Files (x86)\Arduino\libraries\Keyboard\src/Keyboard.h:29:2: warning: #warning “Using legacy HID core (non pluggable)” [-Wcpp]

    #warning “Using legacy HID core (non pluggable)”


    Tx:18:1: error: ‘Keyboard’ does not name a type

    Keyboard customKeyboard = Keyboard( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);


    Y:\Tx-files\Tx\Tx.ino: In function ‘void loop()’:

    Tx:53:20: error: ‘customKeyboard’ was not declared in this scope

    char customKey = customKeyboard.getKey();


    exit status 1
    ‘Keyboard’ does not name a type
    Bro i solve the keypad error but i have a another error an progrram. the error is given below:
    This report would have more information with
    “Show verbose output during compilation”
    option enabled in File -> Preferences.
    “keyboard does not name a type ” It is showing error on arduino.

    plzz tell how to solve the error.

    • Mandeesh Singh says:

      This is because you haven’t installed the library for keypad.
      1) Download Keypad library.
      2) Install it in Arduino.
      Google these instructions and once you have installed the library, try compiling the code again.

  4. syed sheik mohammed P says:

    bro i have another doubt in your data transmission using lifi projects. In receiver side we are using solar panel in data transmission. Where it is possible to use solar panel in receiver side?

  5. Jyotika vyas says:

    Sir,my name is jyotika vyas.I want to make basic lifi communication circuit.So,I want to purchase it .Is it possible.I live in Vadodara.How much cost of project.

  6. Suraj Singh says:

    Sir, I want to transmit Internet threw li – fi…. So I want your advice to make it.
    And will be I able to make it threw arduino?

    • Mandeesh Singh says:

      We are sending ASCII Serial data through Light in the form of HIGH’s and LOW’s as per data. HIGH = Light ON, LOW = Light OFF. The LDR module has been tuned to differentiate the series of HIGH and LOW in such a way that it is able to distinguish between valid/invalid data bits.

  7. yasmeen says:

    hello I’m doing this project but i want to ask for the transmitter part do we have to use white Leds? or it doesn’t matter.
    and for the receiver part I’m no getting any number in the lcd and I’m sure about the connection even the dashes I’m not getting them when you pass the flash.

    • Mandeesh Singh says:

      Color or LED’s don’t really matter but we have seen white give better results.
      In the receiver section, first ensure basic LCD sketch is working, i.e. you are able to display any text on the LCD. Once that is ensured, then you can try receiving the LiFi data.

  8. Tarun says:

    What alternative can be used for LDR sensor to increase data transfer speed ?
    How can other components be upgraded to increase data transfer speed ?

  9. Ololo chukwuemeka bright says:

    I am interested in this project
    I have studied few books on LiFi and it points to prof harald Haas
    But in PROF experiment an internet connection was established and people could browse websites on line , download and upload file using the internet
    I don’t know where they got the ISP that gave the service
    Sir I want to know is this project like they of the Prof’s

  10. Ololo chukwuemeka bright says:

    Is this the internet communication using LiFi
    Project like PROF HARALD HAAS

    • Mandeesh Singh says:

      LiFi technology is a mode of communication, it cannot generate its own internet. However, it can help in transmission of internet signals.

    • Mandeesh Singh says:

      LiFi technology is a mode of communication, it cannot generate its own internet. However, it can help in transmission of internet signals.

        • Mandeesh Singh says:

          You can try, we got results but after trying a lot. You can also try with a small solar panel which works and Phototransitor.

        • komal says:

          Hello sir,
          Can you please suggest any idea in order to avoid demerit of sensor circuit? sothat this prototype may work effectively? also I’m having trouble in finding the coding for Tx and Rx circuit.Please do guide
          Thank you

          • Mandeesh Singh says:

            Well no suggestions till now. We are working on improving the sensor circuit and will update the results. Code is in the blog, please check.

    • Mandeesh Singh says:

      Weird characters mean, you are very close to tune the receiver with incoming light data. Try adjusting the distance + potentiometer. There’ll be a point where it’ll work.

Leave a Reply

Your email address will not be published. Required fields are marked *