You are on page 1of 5

2017 International Conference on Computer Communication and Informatics (ICCCI -2017), Jan.

05 – 07, 2017, Coimbatore, INDIA

PC to PC Data Transmission using


Visible Light Communication
Sandip Das
Ankan Chakraborty, Debjani Chakraborty, Sumanjit Moshat
Electronics and Communication Engineering
University of Engineering and Management
Jaipur, Rajasthan-303807
Email: info.sandipec@gmail.com, ankan50894@gmail.com, debjani.prankster@gmail.com, moshatsumanjit94@gmail.com

Abstract—Visible Light Communication (VLC) can be concisely addition to acting as light sources [4]. This ensures the
stated as Data Transmission Through Illumination. Data abundance of visible light communication systems and the low
transmission through visible light communication is much more cost to implement them. Lastly, since light cannot propagate
secure and is capable of achieving high data transmission rates as through walls unlike radio waves, the data cannot be received
compared to existing conventional wireless technologies like Wi- by a receiver present on the other side of the wall [5]. This
Fi, Bluetooth, Wi-max, etc., which uses radio frequency
spectrum. This project aims at building a wireless VLC system
property of light ensures security, as information here, is not
capable of transmitting text data between two computers using broadcasted for external sources to receive. This technology is
visible light. A Light Emitting Diode (LED) is used as the still in its early stage of development. More recent works
transmitter, air as the transmission medium and a Light began in 2003 in Japan. In 2006 a research work proposed a
Dependent Resistor (LDR) as the receiving component. Text data broadband communication system for indoor applications [6].
gets transmitted as strings of 1s and 0s as the LED flickers on In 2010 a research work has been able to establish a visible
and off, rapidly at a rate undetectable to the human eye. This light communication system which can transmit data up to 500
binary data is received by the LDR, converted into the Mbit/s .But this technology is still several years away from
appropriate format and displayed on the output screen. Both proper commercialization. LEDs, in addition to their
hardware (Arduino Uno microcontroller) and software (Matlab)
are required for successful data transmission and reception. Two
illumination capabilities, require low power for their operation
computers are used as the end devices. The computers, with the and have very high switching speeds such that intensity
help of Arduino IDE installed in them, are used to interface variations of LEDs are so rapid that they are undetectable to
software to the hardware. the human eye. The purpose of this research work is to
Keywords: Visible Light Communication, wireless technologies, establish a visible communication system using Arduino
Light Emitting Diode, Light Dependent Resistor microcontroller. In this paper a simple system is proposed
which uses two Arduino UNO boards, White LED as
I. INTRODUCTION transmitter) and LDR (Light dependent resistor) as receiver.
VLC (Visible Light Communication) refers to transmission Matlab is used for data processing at both transmitting and
of information using visible light portion (380nm to 780nm) of receiving ends as Arduino solely, is not capable of handling
the electromagnetic spectrum. LED (Light Emitting Diode) is higher amount of data. In this system, the user can enter up to
used as a transmitter, air as the transmitting medium and an 30 characters in the transmitting end. Arduino causes the LED
appropriate photodiode acts as the signal receiving component. to flicker at a higher rate which is undetectable to the human
In the last two decades, there has been a tremendous increase eye. It changes the intensity of light from a higher range to a
in the demand for wireless data communication. Wireless lower range depicting pulses of 1s and 0s respectively. In the
communication using radio frequency spectrum being the most receiving end the LDR receives the transmitted data as a bit
popular till the present era has led to the congestion of this stream which is then converted back into characters. Matlab is
spectrum [1]. The advent of Visible light communication used for taking character input from the user in the transmitter
opens up a new possibility for future communication between end and for converting the binary bit stream back into
any kind of devices. Firstly, visible light spectrum bandwidth, character form in the receiver end.
which ranges from 430 THz to 750 THz is much larger than
the radio frequency spectrum bandwidth ranging from 3 KHz
II. SYSTEM MODEL
to 300 GHz. Due to this larger bandwidth, it is possible to
achieve a much higher rate of data transfer and also a large A system model (as shown in fig. 1.), is designed and
number of users can be accommodated [2]. Secondly, using constructed. The system consists of 2 PCs, one at the
radio frequency can be life threatening in certain places like transmitter end and the other at the receiver end, two
space stations, hospitals and mines whereas visible light being microcontrollers (Arduino UNO) at both ends, a white LED at
a sustainable means of existence of life is unquestionably safe
[3]. Thirdly, light sources being ubiquitous and abundant, once
replaced with LED lamps, can also act as transmitters in

978-1-4673-8855-9/17/$31.00 ©2017 IEEE


2017 International Conference on Computer Communication and Informatics (ICCCI -2017), Jan. 05 – 07, 2017, Coimbatore, INDIA

available for reading from the serial port is obtained and the
incoming serial data is read. A HIGH or a LOW value is
written to the digital pin 13. Pulse Width Modulation (PWM)
is implemented here that is the duration of the pulse is varied
according to the bit stream [10]. For example- if the
transmitting string is 101, one high pulse will be transmitted
for bit 1 followed by a low pulse for bit 0 followed by another
high pulse for the least significant bit 1. A specific delay is
provided for high pulse=1. Similarly, another specific delay is
Fig. 1. Block Diagram for data transmission between two PCs using Visible provided for low pulse=0. Thus, data gets transmitted as the
Light Communication
LED flickers rapidly according to the different duration of
delay provided for the high pulse and the low pulse [11].
Human eye detects frames every 1/10th of a second. Thus, the
the transmitter end and a LDR at the receiver end. At the
rapid flickering of the LED is undetectable to the human eye.
transmitting end, the PC is connected to the Arduino UNO
which is connected to the white LED. The Arduino causes the
LED to flicker rapidly at a speed undetectable to the human 1) Matlab Algorithm: Matlab algorithm for transmitter
eye [7], transmitting data simultaneously. These rapid is shown below [12], [13], [14].
flickering of LED creates pulses with different durations [8]. Matlab takes the user input and stores it into a string. Then
At the receiving end the LDR is connected to the Arduino
which is connected to the PC. The LDR detects the rapid Algorithm 1 Algorithm for Matlab at Transmission end
flickering of LED. By using a special function in the Arduino 1: START.
2: PERFORM INTERFACING WITH ARDUINO.
IDE, the duration of the pulses, created by the flickering, are
3: TAKE AN USER INPUT IN THE FORM OF A STRING.
calculated. Depending on the durations, HIGH and LOW 4: TRANSMIT THE STRING INPUT TO ARDUINO.
pulses are distinguished and a binary bit stream is generated. 5: STOP
This bit stream is sent to Matlab for further processing and
output generation. Arduino IDE faces lots of problems while
handling large amount of data which Matlab can handle with
ease. Moreover, certain predefined Matlab function facilitates it passes the string to the Arduino IDE. Arduino converts each
the process of output generation. letter into its respective ASCII value and into the binary
equivalent thereafter.

A. Transmitter 2) Arduino Algorithm: Arduino algorithm for


transmitter is shown below [14], [15]. Arduino IDE takes the
In the transmitter side of the VLC system a personal computer input string
(PC 1) is used. The Arduino IDE software and the MATLAB
software needs to be installed in PC 1 in order to facilitate the Algorithm 2 Algorithm for Arduino IDE at Transmission end
execution of the system. This computer acts as the data source. 1: START.
An Arduino UNO board (Arduino UNO 1) is connected to PC 2: CONFIGURE THE PIN TO WHICH THE LED IS
1 via a USB cable. A white LED is connected to digital pin CONNECTED TO BEHAVE AS AN OUTPUT.
number 13 of the Arduino board. MATLAB programming is 3: RECEIVE THE STRING INPUT FROM MATLAB.
done in order to take an input from the user and transmit the 4: CONVERT IT INTO ITS RESPECTIVE ASCII VALUE.
respective input data [9]. An interfacing is done between 5: GENERATE THE RESPECTIVE BINARY BITS FROM
MATLAB and Arduino to facilitate this transfer of input data. THE ASCII VALUE.
Firstly, a serial port object (s) associated with serial port 6: TRANSMIT THE BITS BY FLASHING THE LED FOR
COM6 of the Arduino is created. The Baud Rate that is the DIFFERENT DURATIONS USING PWM.
number of signal or symbol changes occurring per second is 7: WRITE A HIGH OR A LOW VALUE TO THE PIN TO
set to 9600 bits per second. The serial port object is then WHICH THE LED IS CONNECTED.
connected to the Arduino. The MATLAB program takes an 8: STOP.
input from the user in the form of a string and sends this input
to the Arduino IDE. The serial port object is then disconnected
from the Arduino. A computer code written in Arduino IDE
software, receives the string input from MATLAB. It converts from Matlab, generates the binary bit stream and creates the
the string into its respective ASCII value and then generates pulses. The LED flickers at a very high rate. For a naked
its corresponding binary bit stream. Firstly, digital pin number human eye the LED acts as a constant source of light.
13 on the Arduino board is defined and configured to behave
as an output. Then the baud rate is set to 9600 bits per second
for serial communication. The number of bits (characters)
2017 International Conference on Computer Communication and Informatics (ICCCI -2017), Jan. 05 – 07, 2017, Coimbatore, INDIA

B. Receiver stream of bits in a single one dimensional array, a predefined


An Arduino UNO board is connected to the PC 2 via a USB library function reshape() is used. The bit stream is then
cable. A Light Dependent Resistor (LDR) is connected to the converted to character array (String) with the help of the
analog pin A0 of the Arduino UNO 2. The LDR is placed six function char(). A second loop is initiated which goes on for n
centimeters away from the LED such that a direct line of sight cycles where n=number of characters given as input. At the
is maintained between them. The Light Dependent Resistor end of each cycle, 8 bits are taken i.e. for the first cycle it will
detects the rapid flickering of the LED since its resistance take up to 8 bits in a string. In the second cycle, 9th to 16th
varies with the variations in the amount of light incident on it bits are considered in a string and in the third cycle, it will take
from the LED, while transmitting 0 or 1[12]. 17th to 24th bits and so on. But each time the characters need
to be retrieved and stored. So, in each cycle 8bits are stored in
an array. Then the array is converted into a string by using the
predefined library function num2str(). There is yet another
problem to be dealt with. The transmitted bit stream is
received in reverse order. Suppose the transmitting bit stream
is 100 then it will be received as 001 at the receiving end. So
the received bit stream needs to be reversed in order to get a
correct output. The string is reversed by using the predefined
fliplr() function. Now the required 8 bits are suited for
character conversion. Their respective ASCII values are
obtained by operating a predefined library function bin2dec().
Predefined library function char() takes the ASCII values and
generates the respective characters. The characters are stored
in an empty character array. At the end of the loop all
characters get stored in a string. The string is displayed using
the function disp() after exiting the loop. Thus, the received
data displayed on the screen of PC 2 is identical to the string
user input provided for transmission.
Fig. 2. Hardware Circuitry of Transmitter and Receiver
1) Matlab Algorithm: Matlab algorithm for receiver is
A predefined library function pulseIn() is used to read the shown below[12], [13], [14]. In the receiving end the LDR
incoming (HIGH or LOW) pulses to the A0 pin. This function
returns the width or durations of the pulses in microseconds. Algorithm 3 Algorithm for Matlab at Receiver end
1: START
Two ranges of time durations are obtained with the help of
2: STORE THE RECEIVED BIT STREAM IN VECTOR
pulseIn(). Now as specific delays or specific pulse durations
have been set for high and low pulse at the transmitter end, the FORM.
3: EXTRACT 8 BITS FOR EACH CHARACTER.
LED glows with a certain intensity when high pulse is
4: STORE THE EXTRACTED BITS IN AN ARRAY.
transmitted and with a different intensity when low pulse is
5: CONVERT THE ARRAY INTO STRING.
transmitted. The LDR is capable of sensing this intensity
6: REVERSE THE STRING.
variations. After the duration of the received pulses are
7: CONVERT THE BINARY BITS INTO THEIR
obtained with the help of pulseIn(), the high and the low pulses
are easily detected with the help of a conditional if else RESPECTIVE ASCII VALUES.
8: CONVERT TO RESPECTIVE CHARACTERS FROM
statement where pulses having longer duration are treated as
high pulse=1 and pulses having shorter duration are treated as OBTAINED ASCII VALUES.
9: STORE THE OBTAINED CHARACTERS IN A
low pulse=0. After obtaining the high and the low pulses, a
binary bit stream of 0 and 1 is generated. The obtained bit STRING.
10: DISPLAY THE STRING.
stream is then passed on to MATLAB for obtaining an output
11: STOP.
in the form of a string, identical to the input provided by the
user. At the receiving end, a bit stream is received by Matlab.
Characters are extracted from this received bit stream. Each
character is represented by 8 bits. But redundant bits are senses the pulses and depending on the length of the pulses it
present at times. For example, while transmitting 1, 2, 3 creates the binary bit stream. Arduino IDE reads this binary
characters, 8, 16, 24...bits are to be considered respectively at data and feeds it into Matlab. Now after receiving the binary
the receiving end. A loop is initiated and the entire stream of data into Matlab a lot of processing still needs to be done. The
bits is stored in a vector form. Then the required number of whole bit stream is in reverse order. Each character is
bits are extracted corresponding to the number of characters represented by 8 bits. The bit stream needs to be divided and
transmitted. The transmitted bit stream gets stored in a single arranged properly to get the characters. Matlab has some
column at the receiving end. In order to obtain the transmitted predefined functions for this kind of processing. With the help
2017 International Conference on Computer Communication and Informatics (ICCCI -2017), Jan. 05 – 07, 2017, Coimbatore, INDIA

of these functions the characters are retrieved and stored in a Figure 3 shows the generated pulses for one character. Binary
string. In the end the string is displayed in the output console. ‘1’ is represented by a HIGH pulse and binary ‘0’ is
represented by a LOW pulse.

2) Arduino Algorithm: Arduino algorithm for receiver is


shown below [14], [15].

Algorithm 4 Algorithm for Arduino IDE at Receiver end


1: START.
2: CONFIGURE THE PIN TO WHICH THE LDR IS
CONNECTED TO BEHAVE AS AN OUTPUT.
3: READ THE PULSES ON THE PIN TO WHICH THE
LDR IS CONNECTED.
4: RETURN THE WIDTH OF THE PULSES IN
MICROSECONDS.
5: CHECK THE CONDITION FOR DETERMINING
WHETHER PULSE IS HIGH OR LOW. Fig. 4. Arduino console while transmitting a string
6: PRINT VALUES 1 OR 0 ACCORDINGLY.
7: PASS ON THE OBTAINED STREAM OF BITS TO Figure 4 shows the console of Arduino IDE while transmitting
MATLAB. a string ‘ANKAN’.
8: STOP.

III. RESULT

A model was designed and successfully constructed in order to


demonstrate Serial communication between two PCs. The
objective was to establish a visible light communication
system which transmits and receives text. In the initial stage,
Arduino UNO microcontroller and Arduino IDE were used to
transmit and receive a single character. Later on, a step by step
process was used for text transmission using Matlab. In the
end upto 18 characters were successfully transmitted and Fig. 5. Transmitting a string ’GOOD GRIEF’ from Matlab using VLC
received. The distance between the LED and the LDR was set
to 6 centimeters. A pictorial representation of a Pulse Width
Figure 5 shows the console of Matlab at the transmitting end.
Modulated (PWM) signal, followed by pictorial
After running the code the console takes a string as user input
representations of the Arduino and Matlab consoles depicting which in this case is ‘GOOD GRIEF’.
the transmission and reception of data, is included in the
following page.

Fig. 6. Receiving a string ’GOOD GRIEF’ in Matlab

Figure 6 shows the console of Matlab in the receiving end.


After running the code the console shows a string as the output
Fig. 3. Generated pulses while transmitting a single character
which is same as the input in the receiving end.
2017 International Conference on Computer Communication and Informatics (ICCCI -2017), Jan. 05 – 07, 2017, Coimbatore, INDIA

IV. CONCLUSION
[6] M. Kavehrad, P. Amirshahi, Hybrid MV-LV Power Lines and White Light
Emitting Diodes for Triple-Play Broadband Access Communications, IEC
In this paper a visible light communication system between Comprehensive Report on Achieving the Triple Play: Technologies and
two personal computers using Arduino microprocessors has Business Models for Success, ISBN 1-931695-51-2, The Pennsylvania State
been established. The system designed here is capable of University, January 2006.
transmitting and receiving up to 18 characters over a maximum
range of 6 centimeters. The value of pulse durations may vary [7] Stefan Schmid, Josef Ziegler, Thomas R. Gross , Manuela Hitz , Afroditi
Psarra , Giorgio Corvellini, Stefan Mangold , Visible Light Communication -
with different lighting conditions thereby affecting the Combining Illumination And Communication, ACM SIGGRAPH Emerging
flickering of LED in the presence of ambient light. Since Technologies, Article No. 13 , ISBN: 978-1-4503-2961-3, 2014 , Disney
transmission of multiple characters was not possible using Research ,Zurich.
Arduino IDE only, Matlab is used. White LED being used as
the optical transmitter and photodiode as an optical receiver, [8] Safaa Alaa Eldeen Hamza, Dr. Amin Babiker , A Nabi Mustafa , The Use
Of Pulse Width Modulation (PWM) Technique in LED Lighting Systems,
cost of building such a system was considerably low. International Journal Of Science and Research(IJSR), ISSN(Online):2319-
7064, Khartoum, Sudan.

[9] Filip Certik , Using Matlab Tools For Simulation Of The Optical
REFERENCES Transmission Medium, VEGA No. 1/0106/11, Institute of
Telecommunications,Slovakia.

[1] Jitesh Nagdev,Dipesh Sher,Rohit Nathan,Gaurav Kalwani, Wireless [10] Jean Armstrong, Optical Domain Digital-To-Analog Converter For
Data Transfer Using Light Fidelity, International Journal of Science and Visible Light Communications Using LED Arrays, Australian Research
Research (IJSR), India Online ISSN: 2319-7064, June 6 2013. Council Discovery, Doc. ID - 188184, Australia, July 2013.

[2] Mohammad Noshad,Maite Brandt-Pearce, Can Visible Light [11] Minseok Oh, A Flicker Mitigation Modulation Scheme for Visible Light
Communication Provide Gb/s Service ?”,August 2013, National Science Communication, Advanced Communication Technology (ICACT), 2013 15th
Foundation (NSF), Grant No.-ECCS-0901682 August 2013. International Conference, ISSN :1738-9445, Suwon,Korea, January 2013.

[3] Jacqueline J.George, Mohammed Hayder Mustafa, Nada Mahjoub Osman, [12] Z.Ghassemlooy , W.Popoola , S. Rajbhandari , Optical Wireless
Nuha Hashim Ahmed, Daad Mohammed Hamed, A Survey on Visible Light Communications- System and Channel Modelling with MATLAB, CRC
Communication, International Journal Of Engineering And Computer Press,Taylor And Francis Group, International Standard Book Number-13:
Science, ISSN:2319-7242 Volume 3 Issue 2, Page No. 3805-3808 , February 978-1-4398-5235-4, Northumbria University, June 2012.
2014 .
[13] http://in.mathworks.com/
[4] T. Komine and M. Nakagawa, Fundamental Analysis for Visible-Light
Communication System Using LED Lights, IEEE Transactions on Consumer [14] http://stackexchange.com/
Electronics, Vol. 50, no. 1, pp. 100-107, February 2004.
[15] http://playground.arduino.cc/
[5] M. V. Bhalerao, S. S. Sonavane,V. Kumar, A Survey of Wireless
Communication Using Visible Light, International Journal of Advances in
Engineering And Technology, Vol. 5, Issue 2, pp. 188-197 Jan 2013.

You might also like