0% found this document useful (0 votes)
40 views6 pages

Arduino Li-Fi Project Guide

This document describes how to build a DIY Li-Fi system using an Arduino Uno. It involves using an LED and light dependent resistor (LDR) connected to an Arduino. The Arduino code transmits data by turning the LED on and off, which is received by the LDR. It provides steps to set up the connections and code to transmit a sample data value. Further applications mentioned include modifying the code to transmit characters or using a light bulb instead of an LED.

Uploaded by

Andi Mandi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views6 pages

Arduino Li-Fi Project Guide

This document describes how to build a DIY Li-Fi system using an Arduino Uno. It involves using an LED and light dependent resistor (LDR) connected to an Arduino. The Arduino code transmits data by turning the LED on and off, which is received by the LDR. It provides steps to set up the connections and code to transmit a sample data value. Further applications mentioned include modifying the code to transmit characters or using a light bulb instead of an LED.

Uploaded by

Andi Mandi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

technology workshop craft home food play outside costumes

DIY Li-Fi using Arduino Uno


by UdayN on March 19, 2016

Table of Contents

DIY Li-Fi using Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: DIY Li-Fi using Arduino Uno . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Setting up connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 3: Setting up even light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4: Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5: Further applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

[Link]
Intro: DIY Li-Fi using Arduino Uno
Very simple and useful project to understand the working of Li-Fi, you can also make your own Li-Fi device with a bit more modifications to the design and code provided.
You actually need two arduino's, one to send and the other to receive to make it more fun.

Step 1: Getting Started


Components needed

100 ohm resistor,

1 K resistor,

LED,

LDR,

Arduino Uno

Step 2: Setting up connections


Connect one end of 100 ohm resistor to pin number 13 and the other end to the positive terminal of led, the other end of led goes to GND pin. Also connect the ldr as
shown. You can also use male to female jumper wires directly for connecting the resistor and ldr.

[Link]
[Link]
Step 3: Setting up even light
As the ldr values depend upon the surrounding light and also led cannot emit even light I have used a small paper pipe and placed the led through one end and ldr at the
other end of it.

Now you are all set to start coding.

Step 4: Code
//copy this code and start modifying

int sensorPin = A0; // select the input pin for ldr

int sensorValue = 0; // variable to store the value coming from the sensor

int light=0;

int i=0;

int d[32];

int temp=1;

int k=0; int add=0;

int a=1001;//-------------- replace with any value of your choice

void setup()

{ pinMode(13, OUTPUT); //pin connected to the relay

[Link](9600); //sets serial port for communication

[Link](sensorPin);

int b;

[Link]
while(a!=0)

b=a%2; //converts binary to decimal

a=a/2;

if(b==1)

digitalWrite(13,HIGH);

delay(2);

sensorValue=analogRead(sensorPin);

d[i]=sensorValue; }

else

digitalWrite(13,LOW);

delay(2);

sensorValue=analogRead(sensorPin);

d[i]=sensorValue;

i++;

} i--;

// for converting binary to decimal

while(i>=0)

if(d[i]>=14)

k=i;

while(k!=0)

temp=temp*2;

k--;

add=add+temp;

temp=1;

i--;

[Link](add); // Final recieved value gets printed

digitalWrite(13,LOW); }

void loop()

[Link]
Step 5: Further applications
You can make few changes to the code and make it work for characters and also you can use a light bulb instead of led which can give more light evenly than the led
which is the actual concept of Li-Fi.

Enjoy.

Related Instructables

Arduino: breakout pinball


Electronic Dice Peanut Satay LiFi: Transmit Automatic color DIY Semaphore
by chaudown music using detector using
(using random Ramen by Lantern by
numbers) by Not_Tasha light by LDR by ajmal Tymkrs
redryno1221 el10savio hassan

Advertisements

Comments
1 comments Add Comment

DIY Hacks and How Tos says: Mar 19, 2016. 2:57 PM REPLY
Cool Li-Fi project.

[Link]

Common questions

Powered by AI

Modifying the code in the DIY Li-Fi project allows for handling different data types by altering how data is encoded and decoded into light signals. For example, using an encoding scheme like Morse code could allow for text transmission, while adding error detection and correction algorithms could accommodate more complex data types with higher integrity. The flexibility of the Arduino platform supports these modifications, enabling custom logic to handle various encoding schemes needed for transmitting more than just basic binary data .

Component selection significantly impacts the flexibility and capabilities of the system. Using basic components like LEDs and LDRs allows for a simple and cost-effective setup but limits the range and data rate. High-quality components such as high-frequency LEDs and sensitive photodetectors can enhance transmission capabilities, allowing for more complex data types and longer transmission distances. The chosen resistors also determine the operational voltage and current, affecting power consumption and signal strength, thereby impacting overall performance .

The main limitation of using an LED in the Li-Fi project is its inability to emit even light, which can lead to instability in signal quality. This uneven light distribution results in fluctuating LDR values, potentially causing noise in data transmission. To mitigate this issue, the project uses a paper pipe to ensure consistent light detection. Additionally, the LED's modulation speed limits the data rate, restricting the system to relatively simple data transmissions .

The resistors act as a means of current limiting and voltage division in the circuit. They help manage the current flowing through the LED to prevent damage to it by limiting excessive current. Furthermore, they can help adjust the voltage across different parts of the circuit to ensure both the LED and LDR operate within their optimal specifications, thereby maintaining the integrity and functionality of the Li-Fi system .

Transitioning to a more robust Li-Fi system involves several key steps. First, upgrading components to support higher frequencies, such as using faster LEDs or alternative light sources like laser diodes for increased modulation speed. Second, implementing more sophisticated encoding and decoding schemes to increase data capacity and resilience to interference, such as using error correction codes. Third, improving the physical setup, possibly with better alignment mechanisms and environmental controls to manage ambient light interference. Additionally, expanding the code to support more data types and optimizing hardware to reduce power consumption while increasing range and efficiency .

Using two Arduino boards allows for the separation of tasks into distinct sending and receiving roles, which is necessary for effective Li-Fi communication. One board operates as the transmitter, controlling the LED to modulate light signals, while the second board functions as the receiver, using the LDR to detect changes in light intensity that represent modulated data. This setup reflects the fundamental operation of Li-Fi technology, where data is transmitted through light and then demodulated back into usable information .

The paper pipe is used to stabilize the light environment affecting the LDR, which helps ensure that the light emitted by the LED is more consistently detected by the LDR. This is crucial because the LDR values fluctuate with changes in ambient light conditions, and the LED might not emit even light across its surface. By confining the LED and LDR within a paper pipe, the project isolates these components from external light interference, improving the reliability of the readings .

The document suggests that by making modifications to the code, the system could be enhanced to transmit different types of data, such as characters, rather than just binary data. Additionally, replacing the LED with a light bulb that emits light more evenly would help apply the principles of Li-Fi more effectively, as it would improve signal quality and transmission capabilities .

The Arduino code first converts an integer into its binary form, sending this converted data using light modulation via the LED. The code cycles through each bit of the binary number, turning the LED on or off corresponding to the bit's value (1 or 0, respectively). During each cycle, the light intensity read from the LDR pin is stored. Post transmission, the code converts the recorded signals (light intensity values) back into a digital number, which is printed for verification. This process effectively demonstrates the conversion of binary data for transmission through Li-Fi .

Li-Fi technology offers several advantages over traditional Wi-Fi: it utilizes the visible light spectrum, which is much larger and unregulated compared to the overcrowded radio frequencies used in Wi-Fi, allowing for potentially higher data rates. Additionally, Li-Fi can enhance security since light does not penetrate walls, limiting exposure beyond physical barriers and reducing the potential for unauthorized access. The DIY project demonstrates Li-Fi's potential for fast, localized data transmission using minimal setup, indicating its suitability for environments where electromagnetic interference or data security are concerns .

You might also like